diff options
author | Jeff Layton <jlayton@kernel.org> | 2024-01-31 18:01:58 -0500 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-02-05 13:11:38 +0100 |
commit | a69ce85ec9af6bdc0b3511959a7dc1a324e5e16a (patch) | |
tree | 4df18a2921afb3ad3a002210fad2f84a32fa2425 /fs | |
parent | 3d40f78169a0a954ff06e2b0f8e21463f7edb433 (diff) |
filelock: split common fields into struct file_lock_core
In a future patch, we're going to split file leases into their own
structure. Since a lot of the underlying machinery uses the same fields
move those into a new file_lock_core, and embed that inside struct
file_lock.
For now, add some macros to ensure that we can continue to build while
the conversion is in progress.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20240131-flsplit-v3-17-c6129007ee8d@kernel.org
Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/9p/vfs_file.c | 1 | ||||
-rw-r--r-- | fs/afs/internal.h | 1 | ||||
-rw-r--r-- | fs/ceph/locks.c | 1 | ||||
-rw-r--r-- | fs/dlm/plock.c | 1 | ||||
-rw-r--r-- | fs/fuse/file.c | 1 | ||||
-rw-r--r-- | fs/gfs2/file.c | 1 | ||||
-rw-r--r-- | fs/lockd/clntproc.c | 1 | ||||
-rw-r--r-- | fs/locks.c | 1 | ||||
-rw-r--r-- | fs/nfs/file.c | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 1 | ||||
-rw-r--r-- | fs/nfs/write.c | 1 | ||||
-rw-r--r-- | fs/nfsd/netns.h | 1 | ||||
-rw-r--r-- | fs/ocfs2/locks.c | 1 | ||||
-rw-r--r-- | fs/ocfs2/stack_user.c | 1 | ||||
-rw-r--r-- | fs/open.c | 2 | ||||
-rw-r--r-- | fs/posix_acl.c | 4 | ||||
-rw-r--r-- | fs/smb/client/cifsglob.h | 1 | ||||
-rw-r--r-- | fs/smb/client/cifssmb.c | 1 | ||||
-rw-r--r-- | fs/smb/client/file.c | 3 | ||||
-rw-r--r-- | fs/smb/client/smb2file.c | 1 | ||||
-rw-r--r-- | fs/smb/server/smb2pdu.c | 1 | ||||
-rw-r--r-- | fs/smb/server/vfs.c | 1 |
22 files changed, 24 insertions, 4 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 3df8aa1b5996..a1dabcf73380 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <linux/errno.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/sched.h> #include <linux/file.h> diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 9c03fcf7ffaa..f5dd428e40f4 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -9,6 +9,7 @@ #include <linux/kernel.h> #include <linux/ktime.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/pagemap.h> #include <linux/rxrpc.h> diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 80ebe1d6c67d..ce773e9c0b79 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c @@ -7,6 +7,7 @@ #include "super.h" #include "mds_client.h" +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/ceph/pagelist.h> diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index 42c596b900d4..fdcddbb96d40 100644 --- a/fs/dlm/plock.c +++ b/fs/dlm/plock.c @@ -4,6 +4,7 @@ */ #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/miscdevice.h> #include <linux/poll.h> diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 148a71b8b4d0..2757870ee6ac 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -18,6 +18,7 @@ #include <linux/falloc.h> #include <linux/uio.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/splice.h> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 6c25aea30f1b..d06488de1b3b 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -15,6 +15,7 @@ #include <linux/mm.h> #include <linux/mount.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/gfs2_ondisk.h> #include <linux/falloc.h> diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index cc596748e359..1f71260603b7 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c @@ -12,6 +12,7 @@ #include <linux/types.h> #include <linux/errno.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/nfs_fs.h> #include <linux/utsname.h> diff --git a/fs/locks.c b/fs/locks.c index d685c3fdbea5..097254ab35d3 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -48,6 +48,7 @@ * children. * */ +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/capability.h> #include <linux/file.h> diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 1a7a76d6055b..0b6691e64d27 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -31,6 +31,7 @@ #include <linux/swap.h> #include <linux/uaccess.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include "delegation.h" diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 581698f1b7b2..752224a48f1c 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -23,6 +23,7 @@ #define NFS4_MAX_LOOP_ON_RECOVER (10) #include <linux/seqlock.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> struct idmap; diff --git a/fs/nfs/write.c b/fs/nfs/write.c index d16f2b9d1765..13f2e10167ac 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -25,6 +25,7 @@ #include <linux/freezer.h> #include <linux/wait.h> #include <linux/iversion.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/uaccess.h> diff --git a/fs/nfsd/netns.h b/fs/nfsd/netns.h index 74b4360779a1..fd91125208be 100644 --- a/fs/nfsd/netns.h +++ b/fs/nfsd/netns.h @@ -10,6 +10,7 @@ #include <net/net_namespace.h> #include <net/netns/generic.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/percpu_counter.h> #include <linux/siphash.h> diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c index ef4fd91b586e..84ad403b5998 100644 --- a/fs/ocfs2/locks.c +++ b/fs/ocfs2/locks.c @@ -8,6 +8,7 @@ */ #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/fcntl.h> diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index c11406cd87a8..39b7e47a8618 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/miscdevice.h> #include <linux/mutex.h> diff --git a/fs/open.c b/fs/open.c index a84d21e55c39..0a73afe04d34 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1364,7 +1364,7 @@ struct file *filp_open(const char *filename, int flags, umode_t mode) { struct filename *name = getname_kernel(filename); struct file *file = ERR_CAST(name); - + if (!IS_ERR(name)) { file = file_open_name(name, flags, mode); putname(name); diff --git a/fs/posix_acl.c b/fs/posix_acl.c index e1af20893ebe..6bf587d1a9b8 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -786,12 +786,12 @@ struct posix_acl *posix_acl_from_xattr(struct user_namespace *userns, return ERR_PTR(count); if (count == 0) return NULL; - + acl = posix_acl_alloc(count, GFP_NOFS); if (!acl) return ERR_PTR(-ENOMEM); acl_e = acl->a_entries; - + for (end = entry + count; entry != end; acl_e++, entry++) { acl_e->e_tag = le16_to_cpu(entry->e_tag); acl_e->e_perm = le16_to_cpu(entry->e_perm); diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h index 20036fb16cec..fcda4c77c649 100644 --- a/fs/smb/client/cifsglob.h +++ b/fs/smb/client/cifsglob.h @@ -26,6 +26,7 @@ #include <uapi/linux/cifs/cifs_mount.h> #include "../common/smb2pdu.h" #include "smb2pdu.h" +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #define SMB_PATH_MAX 260 diff --git a/fs/smb/client/cifssmb.c b/fs/smb/client/cifssmb.c index 01e89070df5a..e19ecf692c20 100644 --- a/fs/smb/client/cifssmb.c +++ b/fs/smb/client/cifssmb.c @@ -15,6 +15,7 @@ /* want to reuse a stale file handle and only the caller knows the file info */ #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/kernel.h> #include <linux/vfs.h> diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index c26f8ed14065..d3f5969c3a86 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -9,6 +9,7 @@ * */ #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/backing-dev.h> #include <linux/stat.h> @@ -2951,7 +2952,7 @@ skip_write: continue; } - folio_batch_release(&fbatch); + folio_batch_release(&fbatch); cond_resched(); } while (wbc->nr_to_write > 0); diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index e0ee96d69d49..cd225d15a7c5 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -7,6 +7,7 @@ * */ #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/stat.h> #include <linux/slab.h> diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index e170b96d5ac0..11cc28719582 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -12,6 +12,7 @@ #include <linux/ethtool.h> #include <linux/falloc.h> #include <linux/mount.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include "glob.h" diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index 449cfa9ed31c..5dc87649400b 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -6,6 +6,7 @@ #include <linux/kernel.h> #include <linux/fs.h> +#define _NEED_FILE_LOCK_FIELD_MACROS #include <linux/filelock.h> #include <linux/uaccess.h> #include <linux/backing-dev.h> |