|
@@ -989,14 +989,6 @@ static void wait_barrier(struct r1conf *conf, sector_t sector_nr)
|
|
|
_wait_barrier(conf, idx);
|
|
|
}
|
|
|
|
|
|
-static void wait_all_barriers(struct r1conf *conf)
|
|
|
-{
|
|
|
- int idx;
|
|
|
-
|
|
|
- for (idx = 0; idx < BARRIER_BUCKETS_NR; idx++)
|
|
|
- _wait_barrier(conf, idx);
|
|
|
-}
|
|
|
-
|
|
|
static void _allow_barrier(struct r1conf *conf, int idx)
|
|
|
{
|
|
|
atomic_dec(&conf->nr_pending[idx]);
|
|
@@ -1010,14 +1002,6 @@ static void allow_barrier(struct r1conf *conf, sector_t sector_nr)
|
|
|
_allow_barrier(conf, idx);
|
|
|
}
|
|
|
|
|
|
-static void allow_all_barriers(struct r1conf *conf)
|
|
|
-{
|
|
|
- int idx;
|
|
|
-
|
|
|
- for (idx = 0; idx < BARRIER_BUCKETS_NR; idx++)
|
|
|
- _allow_barrier(conf, idx);
|
|
|
-}
|
|
|
-
|
|
|
/* conf->resync_lock should be held */
|
|
|
static int get_unqueued_pending(struct r1conf *conf)
|
|
|
{
|
|
@@ -1645,8 +1629,12 @@ static void print_conf(struct r1conf *conf)
|
|
|
|
|
|
static void close_sync(struct r1conf *conf)
|
|
|
{
|
|
|
- wait_all_barriers(conf);
|
|
|
- allow_all_barriers(conf);
|
|
|
+ int idx;
|
|
|
+
|
|
|
+ for (idx = 0; idx < BARRIER_BUCKETS_NR; idx++) {
|
|
|
+ _wait_barrier(conf, idx);
|
|
|
+ _allow_barrier(conf, idx);
|
|
|
+ }
|
|
|
|
|
|
mempool_destroy(conf->r1buf_pool);
|
|
|
conf->r1buf_pool = NULL;
|