diff mbox series

[v2,13/41] filelock: convert some internal functions to use file_lock_core instead

Message ID 20240125-flsplit-v2-13-7485322b62c7@kernel.org (mailing list archive)
State New, archived
Headers show
Series filelock: split struct file_lock into file_lock and file_lease structs | expand

Commit Message

Jeffrey Layton Jan. 25, 2024, 10:42 a.m. UTC
Convert some internal fs/locks.c function to take and deal with struct
file_lock_core instead of struct file_lock:

- locks_init_lock_heads
- locks_alloc_lock
- locks_init_lock

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/locks.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/fs/locks.c b/fs/locks.c
index b06fa4dea298..3a91515dbccd 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -251,13 +251,13 @@  locks_free_lock_context(struct inode *inode)
 	}
 }
 
-static void locks_init_lock_heads(struct file_lock *fl)
+static void locks_init_lock_heads(struct file_lock_core *flc)
 {
-	INIT_HLIST_NODE(&fl->fl_core.flc_link);
-	INIT_LIST_HEAD(&fl->fl_core.flc_list);
-	INIT_LIST_HEAD(&fl->fl_core.flc_blocked_requests);
-	INIT_LIST_HEAD(&fl->fl_core.flc_blocked_member);
-	init_waitqueue_head(&fl->fl_core.flc_wait);
+	INIT_HLIST_NODE(&flc->flc_link);
+	INIT_LIST_HEAD(&flc->flc_list);
+	INIT_LIST_HEAD(&flc->flc_blocked_requests);
+	INIT_LIST_HEAD(&flc->flc_blocked_member);
+	init_waitqueue_head(&flc->flc_wait);
 }
 
 /* Allocate an empty lock structure. */
@@ -266,7 +266,7 @@  struct file_lock *locks_alloc_lock(void)
 	struct file_lock *fl = kmem_cache_zalloc(filelock_cache, GFP_KERNEL);
 
 	if (fl)
-		locks_init_lock_heads(fl);
+		locks_init_lock_heads(&fl->fl_core);
 
 	return fl;
 }
@@ -347,7 +347,7 @@  locks_dispose_list(struct list_head *dispose)
 void locks_init_lock(struct file_lock *fl)
 {
 	memset(fl, 0, sizeof(struct file_lock));
-	locks_init_lock_heads(fl);
+	locks_init_lock_heads(&fl->fl_core);
 }
 EXPORT_SYMBOL(locks_init_lock);