summaryrefslogtreecommitdiff
path: root/fs/locks.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2024-01-31 18:02:08 -0500
committerChristian Brauner <brauner@kernel.org>2024-02-05 13:11:40 +0100
commite8a166cf3d72373d71af45438b8cbb05dc5e3cf6 (patch)
treecf0da07f9aef70e68a782c142141b5022704ea16 /fs/locks.c
parentb6aaba5b76e9596cb4d62d081cca41e114becacc (diff)
filelock: clean up locks_delete_block internals
Rework the internals of locks_delete_block to use struct file_lock_core (mostly just for clarity's sake). The prototype is not changed. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-27-c6129007ee8d@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 0aa1c94671cd..a2be1e0b5a94 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -697,9 +697,10 @@ static void __locks_wake_up_blocks(struct file_lock_core *blocker)
*
* lockd/nfsd need to disconnect the lock while working on it.
*/
-int locks_delete_block(struct file_lock *waiter)
+int locks_delete_block(struct file_lock *waiter_fl)
{
int status = -ENOENT;
+ struct file_lock_core *waiter = &waiter_fl->c;
/*
* If fl_blocker is NULL, it won't be set again as this thread "owns"
@@ -722,21 +723,21 @@ int locks_delete_block(struct file_lock *waiter)
* no new locks can be inserted into its fl_blocked_requests list, and
* can avoid doing anything further if the list is empty.
*/
- if (!smp_load_acquire(&waiter->c.flc_blocker) &&
- list_empty(&waiter->c.flc_blocked_requests))
+ if (!smp_load_acquire(&waiter->flc_blocker) &&
+ list_empty(&waiter->flc_blocked_requests))
return status;
spin_lock(&blocked_lock_lock);
- if (waiter->c.flc_blocker)
+ if (waiter->flc_blocker)
status = 0;
- __locks_wake_up_blocks(&waiter->c);
- __locks_delete_block(&waiter->c);
+ __locks_wake_up_blocks(waiter);
+ __locks_delete_block(waiter);
/*
* The setting of fl_blocker to NULL marks the "done" point in deleting
* a block. Paired with acquire at the top of this function.
*/
- smp_store_release(&waiter->c.flc_blocker, NULL);
+ smp_store_release(&waiter->flc_blocker, NULL);
spin_unlock(&blocked_lock_lock);
return status;
}