diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2017-10-24 10:33:33 +0300 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-11-02 07:32:24 +0300 |
commit | f81f7302e86f5c0a21b59c94164f2510812b7764 (patch) | |
tree | b322717c9b2f2bae2ce792d13029232b246a76d8 /drivers/md/raid1.c | |
parent | 8db87912c9a8771c53b98845cd5516ea63b22e1e (diff) | |
download | linux-f81f7302e86f5c0a21b59c94164f2510812b7764.tar.xz |
raid1: remove obsolete code in raid1_write_request
There are some lines could be removed due to recent
change for raid1 such as commit 3956df15d634 ("md:
move suspend_hi/lo handling into core md code").
Also, seems some comments are put to wrong place,
move them before wait_barrier.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 038f5eb299ce..cc9d337a1ed3 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1286,27 +1286,15 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, int first_clone; int max_sectors; - /* - * Register the new request and wait if the reconstruction - * thread has put up a bar for new requests. - * Continue immediately if no resync is active currently. - */ - - if (mddev_is_clustered(mddev) && md_cluster_ops->area_resyncing(mddev, WRITE, bio->bi_iter.bi_sector, bio_end_sector(bio))) { - /* - * As the suspend_* range is controlled by userspace, we want - * an interruptible wait. - */ DEFINE_WAIT(w); for (;;) { prepare_to_wait(&conf->wait_barrier, &w, TASK_IDLE); - if (!mddev_is_clustered(mddev) || - !md_cluster_ops->area_resyncing(mddev, WRITE, + if (!md_cluster_ops->area_resyncing(mddev, WRITE, bio->bi_iter.bi_sector, bio_end_sector(bio))) break; @@ -1314,6 +1302,12 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio, } finish_wait(&conf->wait_barrier, &w); } + + /* + * Register the new request and wait if the reconstruction + * thread has put up a bar for new requests. + * Continue immediately if no resync is active currently. + */ wait_barrier(conf, bio->bi_iter.bi_sector); r1_bio = alloc_r1bio(mddev, bio); |