diff options
author | NeilBrown <neilb@suse.de> | 2010-12-09 07:59:01 +0300 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-09 07:59:01 +0300 |
commit | 2b74e12e567feb4163e32815bce0be57489e73b9 (patch) | |
tree | 2eef8f977209a7e5ff88b4366bd72ccf59c8a987 /drivers/md/md.c | |
parent | be20e6c67b6c6024c19094d3447f144d118733b0 (diff) | |
download | linux-2b74e12e567feb4163e32815bce0be57489e73b9.tar.xz |
md: remove handling of flush_pending in md_submit_flush_data
None of the functions called between setting flush_pending to 1, and
atomic_dec_and_test can change flush_pending, or will anything
running in any other thread (as ->flush_bio is not NULL). So the
atomic_dec_and_test will always succeed.
So remove the atomic_sec and the atomic_dec_and_test.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 84c46a161927..83b6cb3e7025 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -404,8 +404,6 @@ static void md_submit_flush_data(struct work_struct *ws) mddev_t *mddev = container_of(ws, mddev_t, flush_work); struct bio *bio = mddev->flush_bio; - atomic_set(&mddev->flush_pending, 1); - if (bio->bi_size == 0) /* an empty barrier - all done */ bio_endio(bio, 0); @@ -414,10 +412,9 @@ static void md_submit_flush_data(struct work_struct *ws) if (mddev->pers->make_request(mddev, bio)) generic_make_request(bio); } - if (atomic_dec_and_test(&mddev->flush_pending)) { - mddev->flush_bio = NULL; - wake_up(&mddev->sb_wait); - } + + mddev->flush_bio = NULL; + wake_up(&mddev->sb_wait); } void md_flush_request(mddev_t *mddev, struct bio *bio) |