@@ -710,6 +710,15 @@ static void __locks_delete_block(struct file_lock *waiter)
waiter->fl_blocker = NULL;
}
+static void __locks_wake_one(struct file_lock *waiter)
+{
+ __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_wake_up_blocks(struct file_lock *blocker)
{
while (!list_empty(&blocker->fl_blocked)) {
@@ -717,11 +726,7 @@ static void __locks_wake_up_blocks(struct file_lock *blocker)
waiter = list_first_entry(&blocker->fl_blocked,
struct file_lock, fl_block);
- __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_one(waiter);
}
}
This functionality will be useful in the next patch, so split it out from __locks_wake_up_blocks(). Signed-off-by: NeilBrown <neilb@suse.com> --- fs/locks.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)