Commit ad6bbd8b authored by NeilBrown's avatar NeilBrown Committed by Jeff Layton

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: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
parent ada5c1da
...@@ -672,6 +672,21 @@ static void __locks_delete_block(struct file_lock *waiter) ...@@ -672,6 +672,21 @@ static void __locks_delete_block(struct file_lock *waiter)
waiter->fl_blocker = NULL; 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) static void locks_delete_block(struct file_lock *waiter)
{ {
spin_lock(&blocked_lock_lock); spin_lock(&blocked_lock_lock);
...@@ -727,17 +742,7 @@ static void locks_wake_up_blocks(struct file_lock *blocker) ...@@ -727,17 +742,7 @@ static void locks_wake_up_blocks(struct file_lock *blocker)
return; return;
spin_lock(&blocked_lock_lock); spin_lock(&blocked_lock_lock);
while (!list_empty(&blocker->fl_blocked_requests)) { __locks_wake_up_blocks(blocker);
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);
}
spin_unlock(&blocked_lock_lock); spin_unlock(&blocked_lock_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment