summaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2024-01-31 18:02:10 -0500
committerChristian Brauner <brauner@kernel.org>2024-02-05 13:11:40 +0100
commitd9077f7bad141df143cc4fa000a68a868bcea7c0 (patch)
tree8b1630675fe4220a62ac6139c97744eeda42b2a3 /fs/locks.c
parent269a6194dcbaa5d8e61f32000486fc0f2acf08d0 (diff)
downloadlinux-d9077f7bad141df143cc4fa000a68a868bcea7c0.tar.gz
linux-d9077f7bad141df143cc4fa000a68a868bcea7c0.tar.bz2
linux-d9077f7bad141df143cc4fa000a68a868bcea7c0.zip
filelock: make assign_type helper take a file_lock_core pointer
Have assign_type take struct file_lock_core instead of file_lock. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-29-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/locks.c b/fs/locks.c
index c8fd2964dd98..6892511ed89b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -439,13 +439,13 @@ static void flock_make_lock(struct file *filp, struct file_lock *fl, int type)
fl->fl_end = OFFSET_MAX;
}
-static int assign_type(struct file_lock *fl, int type)
+static int assign_type(struct file_lock_core *flc, int type)
{
switch (type) {
case F_RDLCK:
case F_WRLCK:
case F_UNLCK:
- fl->c.flc_type = type;
+ flc->flc_type = type;
break;
default:
return -EINVAL;
@@ -497,7 +497,7 @@ static int flock64_to_posix_lock(struct file *filp, struct file_lock *fl,
fl->fl_ops = NULL;
fl->fl_lmops = NULL;
- return assign_type(fl, l->l_type);
+ return assign_type(&fl->c, l->l_type);
}
/* Verify a "struct flock" and copy it to a "struct file_lock" as a POSIX
@@ -552,7 +552,7 @@ static const struct lock_manager_operations lease_manager_ops = {
*/
static int lease_init(struct file *filp, int type, struct file_lock *fl)
{
- if (assign_type(fl, type) != 0)
+ if (assign_type(&fl->c, type) != 0)
return -EINVAL;
fl->c.flc_owner = filp;
@@ -1409,7 +1409,7 @@ static void lease_clear_pending(struct file_lock *fl, int arg)
/* We already had a lease on this file; just change its type */
int lease_modify(struct file_lock *fl, int arg, struct list_head *dispose)
{
- int error = assign_type(fl, arg);
+ int error = assign_type(&fl->c, arg);
if (error)
return error;