Commit 347d49fd authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

filelock: convert locks_wake_up_blocks to take a file_lock_core pointer

Have locks_wake_up_blocks take a file_lock_core pointer, and fix up the
callers to pass one in.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20240131-flsplit-v3-30-c6129007ee8d@kernel.orgReviewed-by: default avatarNeilBrown <neilb@suse.de>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent d9077f7b
...@@ -806,7 +806,7 @@ static void locks_insert_block(struct file_lock_core *blocker, ...@@ -806,7 +806,7 @@ static void locks_insert_block(struct file_lock_core *blocker,
* *
* Must be called with the inode->flc_lock held! * Must be called with the inode->flc_lock held!
*/ */
static void locks_wake_up_blocks(struct file_lock *blocker) static void locks_wake_up_blocks(struct file_lock_core *blocker)
{ {
/* /*
* Avoid taking global lock if list is empty. This is safe since new * Avoid taking global lock if list is empty. This is safe since new
...@@ -815,11 +815,11 @@ static void locks_wake_up_blocks(struct file_lock *blocker) ...@@ -815,11 +815,11 @@ static void locks_wake_up_blocks(struct file_lock *blocker)
* fl_blocked_requests list does not require the flc_lock, so we must * fl_blocked_requests list does not require the flc_lock, so we must
* recheck list_empty() after acquiring the blocked_lock_lock. * recheck list_empty() after acquiring the blocked_lock_lock.
*/ */
if (list_empty(&blocker->c.flc_blocked_requests)) if (list_empty(&blocker->flc_blocked_requests))
return; return;
spin_lock(&blocked_lock_lock); spin_lock(&blocked_lock_lock);
__locks_wake_up_blocks(&blocker->c); __locks_wake_up_blocks(blocker);
spin_unlock(&blocked_lock_lock); spin_unlock(&blocked_lock_lock);
} }
...@@ -835,7 +835,7 @@ locks_unlink_lock_ctx(struct file_lock *fl) ...@@ -835,7 +835,7 @@ locks_unlink_lock_ctx(struct file_lock *fl)
{ {
locks_delete_global_locks(&fl->c); locks_delete_global_locks(&fl->c);
list_del_init(&fl->c.flc_list); list_del_init(&fl->c.flc_list);
locks_wake_up_blocks(fl); locks_wake_up_blocks(&fl->c);
} }
static void static void
...@@ -1328,11 +1328,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request, ...@@ -1328,11 +1328,11 @@ static int posix_lock_inode(struct inode *inode, struct file_lock *request,
locks_insert_lock_ctx(left, &fl->c.flc_list); locks_insert_lock_ctx(left, &fl->c.flc_list);
} }
right->fl_start = request->fl_end + 1; right->fl_start = request->fl_end + 1;
locks_wake_up_blocks(right); locks_wake_up_blocks(&right->c);
} }
if (left) { if (left) {
left->fl_end = request->fl_start - 1; left->fl_end = request->fl_start - 1;
locks_wake_up_blocks(left); locks_wake_up_blocks(&left->c);
} }
out: out:
spin_unlock(&ctx->flc_lock); spin_unlock(&ctx->flc_lock);
...@@ -1414,7 +1414,7 @@ int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose) ...@@ -1414,7 +1414,7 @@ int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose)
if (error) if (error)
return error; return error;
lease_clear_pending(fl, arg); lease_clear_pending(fl, arg);
locks_wake_up_blocks(fl); locks_wake_up_blocks(&fl->c);
if (arg == F_UNLCK) { if (arg == F_UNLCK) {
struct file *filp = fl->c.flc_file; struct file *filp = fl->c.flc_file;
......
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