diff options
author | NeilBrown <neilb@suse.com> | 2018-11-30 10:04:08 +1100 |
---|---|---|
committer | Jeff Layton <jlayton@kernel.org> | 2018-11-30 11:26:12 -0500 |
commit | ad6bbd8b18dad182a7e91d7826e27e9a64d935f9 (patch) | |
tree | dd243c664f70c1293013824b8557595aa91409ed /fs/locks.c | |
parent | ada5c1da8660ecae24b3e75c18ee77d79e099fee (diff) | |
download | linux-ad6bbd8b18dad182a7e91d7826e27e9a64d935f9.tar.gz linux-ad6bbd8b18dad182a7e91d7826e27e9a64d935f9.tar.bz2 linux-ad6bbd8b18dad182a7e91d7826e27e9a64d935f9.zip |
fs/locks: split out __locks_wake_up_blocks().
This functionality will be useful in future patches, so
split it out from locks_wake_up_blocks().
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'fs/locks.c')
-rw-r--r-- | fs/locks.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/fs/locks.c b/fs/locks.c index c6df0c8b3d13..6adb22a21a92 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -672,6 +672,21 @@ static void __locks_delete_block(struct file_lock *waiter) waiter->fl_blocker = NULL; } +static void __locks_wake_up_blocks(struct file_lock *blocker) +{ + while (!list_empty(&blocker->fl_blocked_requests)) { + struct file_lock *waiter; + + waiter = list_first_entry(&blocker->fl_blocked_requests, + struct file_lock, fl_blocked_member); + __locks_delete_block(waiter); + if (waiter->fl_lmops && waiter->fl_lmops->lm_notify) + waiter->fl_lmops->lm_notify(waiter); + else + wake_up(&waiter->fl_wait); + } +} + static void locks_delete_block(struct file_lock *waiter) { spin_lock(&blocked_lock_lock); @@ -727,17 +742,7 @@ static void locks_wake_up_blocks(struct file_lock *blocker) return; spin_lock(&blocked_lock_lock); - while (!list_empty(&blocker->fl_blocked_requests)) { - struct file_lock *waiter; - - waiter = list_first_entry(&blocker->fl_blocked_requests, - struct file_lock, fl_blocked_member); - __locks_delete_block(waiter); - if (waiter->fl_lmops && waiter->fl_lmops->lm_notify) - waiter->fl_lmops->lm_notify(waiter); - else - wake_up(&waiter->fl_wait); - } + __locks_wake_up_blocks(blocker); spin_unlock(&blocked_lock_lock); } |