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>
This commit is contained in:
Jeff Layton
2024-02-05 13:11:38 +01:00
committed by Christian Brauner
parent 3d40f78169
commit a69ce85ec9
24 changed files with 65 additions and 23 deletions
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -48,6 +48,7 @@
* children.
*
*/
#define _NEED_FILE_LOCK_FIELD_MACROS
#include <linux/capability.h>
#include <linux/file.h>
+1
View File
@@ -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"
+1
View File
@@ -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;
+1
View File
@@ -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>
+1
View File
@@ -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>
+1
View File
@@ -8,6 +8,7 @@
*/
#include <linux/fs.h>
#define _NEED_FILE_LOCK_FIELD_MACROS
#include <linux/filelock.h>
#include <linux/fcntl.h>
+1
View File
@@ -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>
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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);
+1
View File
@@ -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
+1
View File
@@ -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>
+2 -1
View File
@@ -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);
+1
View File
@@ -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>

Some files were not shown because too many files have changed in this diff Show More