Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ocfs2: 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-43-c6129007ee8d@kernel.org
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jeff Layton and committed by
Christian Brauner
c8df2cc9 05580bbf

+4 -6
+4 -5
fs/ocfs2/locks.c
··· 8 8 */ 9 9 10 10 #include <linux/fs.h> 11 - #define _NEED_FILE_LOCK_FIELD_MACROS 12 11 #include <linux/filelock.h> 13 12 #include <linux/fcntl.h> 14 13 ··· 53 54 */ 54 55 55 56 locks_init_lock(&request); 56 - request.fl_type = F_UNLCK; 57 - request.fl_flags = FL_FLOCK; 57 + request.c.flc_type = F_UNLCK; 58 + request.c.flc_flags = FL_FLOCK; 58 59 locks_lock_file_wait(file, &request); 59 60 60 61 ocfs2_file_unlock(file); ··· 100 101 struct inode *inode = file->f_mapping->host; 101 102 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 102 103 103 - if (!(fl->fl_flags & FL_FLOCK)) 104 + if (!(fl->c.flc_flags & FL_FLOCK)) 104 105 return -ENOLCK; 105 106 106 107 if ((osb->s_mount_opt & OCFS2_MOUNT_LOCALFLOCKS) || ··· 118 119 struct inode *inode = file->f_mapping->host; 119 120 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 120 121 121 - if (!(fl->fl_flags & FL_POSIX)) 122 + if (!(fl->c.flc_flags & FL_POSIX)) 122 123 return -ENOLCK; 123 124 124 125 return ocfs2_plock(osb->cconn, OCFS2_I(inode)->ip_blkno, file, cmd, fl);
-1
fs/ocfs2/stack_user.c
··· 9 9 10 10 #include <linux/module.h> 11 11 #include <linux/fs.h> 12 - #define _NEED_FILE_LOCK_FIELD_MACROS 13 12 #include <linux/filelock.h> 14 13 #include <linux/miscdevice.h> 15 14 #include <linux/mutex.h>