diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-11-16 04:07:53 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:34:59 -0500 |
commit | 127b317844e7cc0458743b604998bece95eab030 (patch) | |
tree | 305a594fc498e9a2702fcf2a8a660b44ab241ab2 /drivers/block | |
parent | aeda1cd6a58009ef21b6d9c09b1a3ded726c2d10 (diff) |
drbd: use test_and_set_bit() to decide if bm_io_work should be queued
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index f49505cf8d0f..843b90966920 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -3772,6 +3772,7 @@ static int w_bitmap_io(struct drbd_conf *mdev, struct drbd_work *w, int unused) | |||
3772 | drbd_bm_unlock(mdev); | 3772 | drbd_bm_unlock(mdev); |
3773 | 3773 | ||
3774 | clear_bit(BITMAP_IO, &mdev->flags); | 3774 | clear_bit(BITMAP_IO, &mdev->flags); |
3775 | smp_mb__after_clear_bit(); | ||
3775 | wake_up(&mdev->misc_wait); | 3776 | wake_up(&mdev->misc_wait); |
3776 | 3777 | ||
3777 | if (work->done) | 3778 | if (work->done) |
@@ -3850,11 +3851,8 @@ void drbd_queue_bitmap_io(struct drbd_conf *mdev, | |||
3850 | 3851 | ||
3851 | set_bit(BITMAP_IO, &mdev->flags); | 3852 | set_bit(BITMAP_IO, &mdev->flags); |
3852 | if (atomic_read(&mdev->ap_bio_cnt) == 0) { | 3853 | if (atomic_read(&mdev->ap_bio_cnt) == 0) { |
3853 | if (list_empty(&mdev->bm_io_work.w.list)) { | 3854 | if (!test_and_set_bit(BITMAP_IO_QUEUED, &mdev->flags)) |
3854 | set_bit(BITMAP_IO_QUEUED, &mdev->flags); | ||
3855 | drbd_queue_work(&mdev->data.work, &mdev->bm_io_work.w); | 3855 | drbd_queue_work(&mdev->data.work, &mdev->bm_io_work.w); |
3856 | } else | ||
3857 | dev_err(DEV, "FIXME avoided double queuing bm_io_work\n"); | ||
3858 | } | 3856 | } |
3859 | } | 3857 | } |
3860 | 3858 | ||