Thread (57 messages) 57 messages, 3 authors, 2024-02-18
STALE835d LANDED

[PATCH v3 21/47] filelock: convert posix_owner_key to take file_lock_core arg

From: Jeff Layton <jlayton@kernel.org>
Date: 2024-01-31 23:03:39
Also in: ceph-devel, gfs2, linux-cifs, linux-fsdevel, linux-nfs, lkml, ocfs2-devel, v9fs
Subsystem: file locking (flock() and fcntl()/lockf()), filesystems (vfs and infrastructure), the rest · Maintainers: Jeff Layton, Chuck Lever, Alexander Viro, Christian Brauner, Linus Torvalds

Convert posix_owner_key to take struct file_lock_core pointer, and fix
up the callers to pass one in.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/locks.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/locks.c b/fs/locks.c
index 9ff331b55b7a..1cfd02562e9f 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -630,9 +630,9 @@ static void locks_delete_global_locks(struct file_lock *fl)
 }
 
 static unsigned long
-posix_owner_key(struct file_lock *fl)
+posix_owner_key(struct file_lock_core *flc)
 {
-	return (unsigned long) fl->c.flc_owner;
+	return (unsigned long) flc->flc_owner;
 }
 
 static void locks_insert_global_blocked(struct file_lock *waiter)
@@ -640,7 +640,7 @@ static void locks_insert_global_blocked(struct file_lock *waiter)
 	lockdep_assert_held(&blocked_lock_lock);
 
 	hash_add(blocked_hash, &waiter->c.flc_link,
-		 posix_owner_key(waiter));
+		 posix_owner_key(&waiter->c));
 }
 
 static void locks_delete_global_blocked(struct file_lock *waiter)
@@ -977,7 +977,7 @@ static struct file_lock *what_owner_is_waiting_for(struct file_lock *block_fl)
 {
 	struct file_lock *fl;
 
-	hash_for_each_possible(blocked_hash, fl, c.flc_link, posix_owner_key(block_fl)) {
+	hash_for_each_possible(blocked_hash, fl, c.flc_link, posix_owner_key(&block_fl->c)) {
 		if (posix_same_owner(&fl->c, &block_fl->c)) {
 			while (fl->c.flc_blocker)
 				fl = fl->c.flc_blocker;
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help