diff options
author | NeilBrown <neilb@suse.com> | 2017-10-19 12:49:15 +1100 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2017-11-01 21:32:20 -0700 |
commit | b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f (patch) | |
tree | 4991194aa067e459500bf1c6515b6d716145165c /drivers/md/raid5-cache.c | |
parent | 35bfc52187f6df8779d0f1cebdb52b7f797baf4e (diff) | |
download | linux-stable-b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f.tar.gz linux-stable-b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f.tar.bz2 linux-stable-b03e0ccb5ab9df3efbe51c87843a1ffbecbafa1f.zip |
md: remove special meaning of ->quiesce(.., 2)
The '2' argument means "wake up anything that is waiting".
This is an inelegant part of the design and was added
to help support management of suspend_lo/suspend_hi setting.
Now that suspend_lo/hi is managed in mddev_suspend/resume,
that need is gone.
These is still a couple of places where we call 'quiesce'
with an argument of '2', but they can safely be changed to
call ->quiesce(.., 1); ->quiesce(.., 0) which
achieve the same result at the small cost of pausing IO
briefly.
This removes a small "optimization" from suspend_{hi,lo}_store,
but it isn't clear that optimization served a useful purpose.
The code now is a lot clearer.
Suggested-by: Shaohua Li <shli@kernel.org>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5-cache.c')
-rw-r--r-- | drivers/md/raid5-cache.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/raid5-cache.c b/drivers/md/raid5-cache.c index 59af7cf35092..037ed274807f 100644 --- a/drivers/md/raid5-cache.c +++ b/drivers/md/raid5-cache.c @@ -1589,21 +1589,21 @@ void r5l_wake_reclaim(struct r5l_log *log, sector_t space) md_wakeup_thread(log->reclaim_thread); } -void r5l_quiesce(struct r5l_log *log, int state) +void r5l_quiesce(struct r5l_log *log, int quiesce) { struct mddev *mddev; - if (!log || state == 2) + if (!log) return; - if (state == 0) - kthread_unpark(log->reclaim_thread->tsk); - else if (state == 1) { + + if (quiesce) { /* make sure r5l_write_super_and_discard_space exits */ mddev = log->rdev->mddev; wake_up(&mddev->sb_wait); kthread_park(log->reclaim_thread->tsk); r5l_wake_reclaim(log, MaxSector); r5l_do_reclaim(log); - } + } else + kthread_unpark(log->reclaim_thread->tsk); } bool r5l_log_disk_error(struct r5conf *conf) |