Skip to content

Commit 9a7eec4

Browse files
jtlaytonbrauner
authored andcommitted
fuse: adapt to breakup of struct file_lock
Most of the existing APIs have remained the same, but subsystems that access file_lock fields directly need to reach into struct file_lock_core now. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20240131-flsplit-v3-39-c6129007ee8d@kernel.org Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent a6bf23e commit 9a7eec4

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

fs/fuse/file.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <linux/falloc.h>
1919
#include <linux/uio.h>
2020
#include <linux/fs.h>
21-
#define _NEED_FILE_LOCK_FIELD_MACROS
2221
#include <linux/filelock.h>
2322
#include <linux/splice.h>
2423

@@ -2510,14 +2509,14 @@ static int convert_fuse_file_lock(struct fuse_conn *fc,
25102509
* translate it into the caller's pid namespace.
25112510
*/
25122511
rcu_read_lock();
2513-
fl->fl_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns);
2512+
fl->c.flc_pid = pid_nr_ns(find_pid_ns(ffl->pid, fc->pid_ns), &init_pid_ns);
25142513
rcu_read_unlock();
25152514
break;
25162515

25172516
default:
25182517
return -EIO;
25192518
}
2520-
fl->fl_type = ffl->type;
2519+
fl->c.flc_type = ffl->type;
25212520
return 0;
25222521
}
25232522

@@ -2531,10 +2530,10 @@ static void fuse_lk_fill(struct fuse_args *args, struct file *file,
25312530

25322531
memset(inarg, 0, sizeof(*inarg));
25332532
inarg->fh = ff->fh;
2534-
inarg->owner = fuse_lock_owner_id(fc, fl->fl_owner);
2533+
inarg->owner = fuse_lock_owner_id(fc, fl->c.flc_owner);
25352534
inarg->lk.start = fl->fl_start;
25362535
inarg->lk.end = fl->fl_end;
2537-
inarg->lk.type = fl->fl_type;
2536+
inarg->lk.type = fl->c.flc_type;
25382537
inarg->lk.pid = pid;
25392538
if (flock)
25402539
inarg->lk_flags |= FUSE_LK_FLOCK;
@@ -2571,8 +2570,8 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
25712570
struct fuse_mount *fm = get_fuse_mount(inode);
25722571
FUSE_ARGS(args);
25732572
struct fuse_lk_in inarg;
2574-
int opcode = (fl->fl_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK;
2575-
struct pid *pid = fl->fl_type != F_UNLCK ? task_tgid(current) : NULL;
2573+
int opcode = (fl->c.flc_flags & FL_SLEEP) ? FUSE_SETLKW : FUSE_SETLK;
2574+
struct pid *pid = fl->c.flc_type != F_UNLCK ? task_tgid(current) : NULL;
25762575
pid_t pid_nr = pid_nr_ns(pid, fm->fc->pid_ns);
25772576
int err;
25782577

@@ -2582,7 +2581,7 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock)
25822581
}
25832582

25842583
/* Unlock on close is handled by the flush method */
2585-
if ((fl->fl_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX)
2584+
if ((fl->c.flc_flags & FL_CLOSE_POSIX) == FL_CLOSE_POSIX)
25862585
return 0;
25872586

25882587
fuse_lk_fill(&args, file, fl, opcode, pid_nr, flock, &inarg);

0 commit comments

Comments
 (0)