Re: [PATCH v3 25/47] filelock: convert __locks_insert_block, conflict and deadlock checks to use file_lock_core

2024-02-18 Thread Jeff Layton
On Wed, 2024-01-31 at 18:02 -0500, Jeff Layton wrote: > Have both __locks_insert_block and the deadlock and conflict checking > functions take a struct file_lock_core pointer instead of a struct > file_lock one. Also, change posix_locks_deadlock to return bool. > > Signed-off-

Re: [PATCH v3 04/47] filelock: add some new helper functions

2024-02-05 Thread Jeff Layton
On Mon, 2024-02-05 at 12:57 +0100, Christian Brauner wrote: > On Mon, Feb 05, 2024 at 06:55:44AM -0500, Jeff Layton wrote: > > On Mon, 2024-02-05 at 12:36 +0100, Christian Brauner wrote: > > > > diff --git a/include/linux/filelock.h b/include/linux/filelock.h >

Re: [PATCH v3 04/47] filelock: add some new helper functions

2024-02-05 Thread Jeff Layton
ruct file *, unsigned int, struct flock64 *); > +int fcntl_setlk64(unsigned int, struct file *, unsigned int, > + struct flock64 *); > +#endif > + > +int fcntl_setlease(unsigned int fd, struct file *filp, int arg); > +int fcntl_getlease(struct file *filp); > + >  /* fs/locks.c */ >  void locks_free_lock_context(struct inode *inode); >  void locks_free_lock(struct file_lock *fl); > -- Jeff Layton

[PATCH v3 46/47] filelock: remove temporary compatibility macros

2024-01-31 Thread Jeff Layton
Everything has been converted to access fl_core fields directly, so we can now drop these. Signed-off-by: Jeff Layton --- include/linux/filelock.h | 16 1 file changed, 16 deletions(-) diff --git a/include/linux/filelock.h b/include/linux/filelock.h index fdec838a3ca7

[PATCH v3 38/47] gfs2: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/gfs2/file.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/gfs2/file.c b/fs

[PATCH v3 16/47] filelock: drop the IS_* macros

2024-01-31 Thread Jeff Layton
These don't add a lot of value over just open-coding the flag check. Suggested-by: NeilBrown Signed-off-by: Jeff Layton --- fs/locks.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 149070fd3b66..d685c3fdbea5

[PATCH v3 17/47] filelock: split common fields into struct file_lock_core

2024-01-31 Thread Jeff Layton
the conversion is in progress. Signed-off-by: Jeff Layton --- fs/9p/vfs_file.c | 1 + fs/afs/internal.h | 1 + fs/ceph/locks.c | 1 + fs/dlm/plock.c| 1 + fs/fuse/file.c| 1 + fs/gfs2/file.c| 1 + fs/lockd/clntproc.c | 1 + fs

[PATCH v3 47/47] filelock: split leases out of struct file_lock

2024-01-31 Thread Jeff Layton
leases, so split the lease-related operations off into a new lease_manager_operations struct. Signed-off-by: Jeff Layton --- fs/libfs.c | 2 +- fs/locks.c | 123 ++-- fs/nfs/nfs4_fs.h| 2 +- fs/nfs

[PATCH v3 43/47] ocfs2: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/ocfs2/locks.c | 9 - fs/ocfs2/stack_user.c | 1 - 2 files changed, 4 insertions(+), 6 deletions

[PATCH v3 45/47] smb/server: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/smb/server/smb2pdu.c | 39 +++ fs/smb/server/vfs.c | 9 - 2

[PATCH v3 44/47] smb/client: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/smb/client/cifsglob.h | 1 - fs/smb/client/cifssmb.c | 9 +++ fs/smb/client/file.c | 67

[PATCH v3 15/47] smb/server: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton --- fs/smb/server/smb2pdu.c | 6 +++--- fs/smb/server/vfs.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index ba7a72a6a4f4

[PATCH v3 42/47] nfsd: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/nfsd/filecache.c| 4 +-- fs/nfsd/netns.h| 1 - fs/nfsd/nfs4callback.c | 2 +- fs/nfsd

[PATCH v3 41/47] nfs: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/nfs/delegation.c | 2 +- fs/nfs/file.c | 19 +-- fs/nfs/nfs3proc.c | 2 +- fs/nfs

[PATCH v3 40/47] lockd: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/lockd/clnt4xdr.c | 14 +- fs/lockd/clntlock.c | 2 +- fs/lockd/clntproc.c | 62

[PATCH v3 39/47] fuse: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/fuse/file.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/fuse/file.c b

[PATCH v3 37/47] dlm: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/dlm/plock.c | 45 ++--- 1 file changed, 22 insertions(+), 23 deletions

[PATCH v3 36/47] ceph: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/ceph/locks.c | 51 ++- 1 file changed, 26 insertions(+), 25

[PATCH v3 35/47] afs: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/afs/flock.c | 38 +++--- fs/afs/internal.h | 1 - include

[PATCH v3 34/47] 9p: adapt to breakup of struct file_lock

2024-01-31 Thread Jeff Layton
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 --- fs/9p/vfs_file.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions

[PATCH v3 33/47] filelock: convert seqfile handling to use file_lock_core

2024-01-31 Thread Jeff Layton
Reduce some pointer manipulation by just using file_lock_core where we can and only translate to a file_lock when needed. Signed-off-by: Jeff Layton --- fs/locks.c | 72 +++--- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git

[PATCH v3 32/47] filelock: convert locks_translate_pid to take file_lock_core

2024-01-31 Thread Jeff Layton
locks_translate_pid is used on both locks and leases, so have that take struct file_lock_core. Signed-off-by: Jeff Layton --- fs/locks.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 50d02a53ca75..97f6e9163130 100644

[PATCH v3 31/47] filelock: convert locks_insert_lock_ctx and locks_delete_lock_ctx

2024-01-31 Thread Jeff Layton
Have these functions take a file_lock_core pointer instead of a file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 9f3670ba0880..50d02a53ca75 100644

[PATCH v3 30/47] filelock: convert locks_wake_up_blocks to take a file_lock_core pointer

2024-01-31 Thread Jeff Layton
Have locks_wake_up_blocks take a file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 6892511ed89b..9f3670ba0880 100644 --- a/fs

[PATCH v3 29/47] filelock: make assign_type helper take a file_lock_core pointer

2024-01-31 Thread Jeff Layton
Have assign_type take struct file_lock_core instead of file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 10 +- 1 file 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

[PATCH v3 28/47] filelock: reorganize locks_delete_block and __locks_insert_block

2024-01-31 Thread Jeff Layton
file_lock_core, and fix up its callers. Signed-off-by: Jeff Layton --- fs/locks.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index a2be1e0b5a94..c8fd2964dd98 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -659,7 +659,7

[PATCH v3 27/47] filelock: clean up locks_delete_block internals

2024-01-31 Thread Jeff Layton
Rework the internals of locks_delete_block to use struct file_lock_core (mostly just for clarity's sake). The prototype is not changed. Signed-off-by: Jeff Layton --- fs/locks.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index

[PATCH v3 26/47] filelock: convert fl_blocker to file_lock_core

2024-01-31 Thread Jeff Layton
Both locks and leases deal with fl_blocker. Switch the fl_blocker pointer in struct file_lock_core to point to the file_lock_core of the blocker instead of a file_lock structure. Signed-off-by: Jeff Layton --- fs/locks.c | 16 include/linux/filelock.h

[PATCH v3 25/47] filelock: convert __locks_insert_block, conflict and deadlock checks to use file_lock_core

2024-01-31 Thread Jeff Layton
Have both __locks_insert_block and the deadlock and conflict checking functions take a struct file_lock_core pointer instead of a struct file_lock one. Also, change posix_locks_deadlock to return bool. Signed-off-by: Jeff Layton --- fs/locks.c | 132

[PATCH v3 24/47] filelock: make __locks_delete_block and __locks_wake_up_blocks take file_lock_core

2024-01-31 Thread Jeff Layton
Convert __locks_delete_block and __locks_wake_up_blocks to take a struct file_lock_core pointer. While we could do this in another way, we're going to need to add a file_lock() helper function later anyway, so introduce and use it now. Signed-off-by: Jeff Layton --- fs/locks.c | 45

[PATCH v3 23/47] filelock: convert locks_{insert,delete}_global_blocked

2024-01-31 Thread Jeff Layton
Have locks_insert_global_blocked and locks_delete_global_blocked take a struct file_lock_core pointer. Signed-off-by: Jeff Layton --- fs/locks.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index fa9b2beed0d7..ef67a5a7bae8 100644

[PATCH v3 22/47] filelock: make locks_{insert,delete}_global_locks take file_lock_core arg

2024-01-31 Thread Jeff Layton
Convert these functions to take a file_lock_core instead of a file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 1cfd02562e9f..fa9b2beed0d7 100644 --- a/fs/locks.c +++ b/fs

[PATCH v3 21/47] filelock: convert posix_owner_key to take file_lock_core arg

2024-01-31 Thread Jeff Layton
Convert posix_owner_key to take struct file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 9ff331b55b7a..1cfd02562e9f 100644 --- a/fs

[PATCH v3 20/47] filelock: make posix_same_owner take file_lock_core pointers

2024-01-31 Thread Jeff Layton
Change posix_same_owner to take struct file_lock_core pointers, and convert the callers to pass those in. Signed-off-by: Jeff Layton --- fs/locks.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 5d25a3f53c9d..9ff331b55b7a

[PATCH v3 19/47] filelock: convert more internal functions to use file_lock_core

2024-01-31 Thread Jeff Layton
Convert more internal fs/locks.c functions to take and deal with struct file_lock_core instead of struct file_lock: - locks_dump_ctx_list - locks_check_ctx_file_list - locks_release_private - locks_owner_has_blockers Signed-off-by: Jeff Layton --- fs/locks.c | 51

[PATCH v3 18/47] filelock: have fs/locks.c deal with file_lock_core directly

2024-01-31 Thread Jeff Layton
Convert fs/locks.c to access fl_core fields direcly rather than using the backward-compatibility macros. Most of this was done with coccinelle, with a few by-hand fixups. Signed-off-by: Jeff Layton --- fs/locks.c | 467 include/trace

[PATCH v3 14/47] smb/client: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton --- fs/smb/client/file.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index b75282c204da..27f9ef4e69a8 100644 --- a/fs/smb/client

[PATCH v3 11/47] nfs: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Also, in later patches we're going to introduce some temporary macros with names that clash with the variable name in nfs4_proc_unlck. Rename it. Signed-off-by: Jeff Layton --- fs/nfs/delegation.c | 2 +- fs/nfs/file.c | 4 ++-- fs

[PATCH v3 13/47] ocfs2: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton --- fs/ocfs2/locks.c | 4 ++-- fs/ocfs2/stack_user.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/locks.c b/fs/ocfs2/locks.c index f37174e79fad..ef4fd91b586e 100644

[PATCH v3 12/47] nfsd: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Also, in later patches we're going to introduce some macros with names that clash with the variable names in nfsd4_lock. Rename them. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 32 1 file changed

[PATCH v3 10/47] lockd: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Also in later patches we're going to introduce some macros with names that clash with the variable names in nlmclnt_lock. Rename them. Signed-off-by: Jeff Layton --- fs/lockd/clntproc.c | 20 ++-- fs/lockd/svcsubs.c | 6

[PATCH v3 09/47] gfs2: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton --- fs/gfs2/file.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 992ca4effb50..6c25aea30f1b 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c

[PATCH v3 08/47] dlm: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Also, in later patches we're going to introduce some temporary macros with names that clash with the variable name in dlm_posix_unlock. Rename it. Signed-off-by: Jeff Layton --- fs/dlm/plock.c | 10 +- 1 file changed, 5 insertions

[PATCH v3 06/47] afs: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Also, in later patches we're going to introduce macros that conflict with the variable name in afs_next_locker. Rename it. Signed-off-by: Jeff Layton --- fs/afs/flock.c | 26 +- 1 file changed, 13 insertions(+), 13

[PATCH v3 07/47] ceph: convert to using new filelock helpers

2024-01-31 Thread Jeff Layton
Convert to using the new file locking helper functions. Signed-off-by: Jeff Layton --- fs/ceph/locks.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index e07ad29ff8b9..80ebe1d6c67d 100644 --- a/fs/ceph/locks.c

[PATCH v3 05/47] 9p: rename fl_type variable in v9fs_file_do_lock

2024-01-31 Thread Jeff Layton
In later patches, we're going to introduce some macros that conflict with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/9p/vfs_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index bae330c2f0cf

[PATCH v3 04/47] filelock: add some new helper functions

2024-01-31 Thread Jeff Layton
In later patches we're going to embed some common fields into a new structure inside struct file_lock. Smooth the transition by adding some new helper functions, and converting the core file locking code to use them. Signed-off-by: Jeff Layton --- fs/locks.c | 18

[PATCH v3 03/47] filelock: rename fl_pid variable in lock_get_status

2024-01-31 Thread Jeff Layton
In later patches we're going to introduce some macros that will clash with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/locks.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index cc7c117ee192..1eceaa56e47f 100644

[PATCH v3 02/47] filelock: rename some fields in tracepoints

2024-01-31 Thread Jeff Layton
In later patches we're going to introduce some macros with names that clash with fields here. To prevent problems building, just rename the fields in the trace entry structures. Signed-off-by: Jeff Layton --- include/trace/events/filelock.h | 76 - 1 file

[PATCH v3 01/47] filelock: fl_pid field should be signed int

2024-01-31 Thread Jeff Layton
This field has been unsigned for a very long time, but most users of the struct file_lock and the file locking internals themselves treat it as a signed value. Change it to be pid_t (which is a signed int). Signed-off-by: Jeff Layton --- include/linux/filelock.h | 2 +- 1 file changed, 1

[PATCH v3 00/47] filelock: split file leases out of struct file_lock

2024-01-31 Thread Jeff Layton
soon and we can see about merging it for v6.9, unless anyone has major objections. Thanks! Signed-off-by: Jeff Layton --- Changes in v3: - Rename "flc_core" fields in file_lock and file_lease to "c" - new helpers: locks_wake_up, for_each_file_lock, and lock_is_{unlock,read,write

Re: [PATCH v2 00/41] filelock: split struct file_lock into file_lock and file_lease structs

2024-01-25 Thread Jeff Layton
On Fri, 2024-01-26 at 09:34 +1100, NeilBrown wrote: > On Fri, 26 Jan 2024, Chuck Lever wrote: > > On Thu, Jan 25, 2024 at 05:42:41AM -0500, Jeff Layton wrote: > > > Long ago, file locks used to hang off of a singly-linked list in struct > > > inode. Because of t

Re: [PATCH v2 00/41] filelock: split struct file_lock into file_lock and file_lease structs

2024-01-25 Thread Jeff Layton
On Thu, 2024-01-25 at 09:57 -0500, Chuck Lever wrote: > On Thu, Jan 25, 2024 at 05:42:41AM -0500, Jeff Layton wrote: > > Long ago, file locks used to hang off of a singly-linked list in struct > > inode. Because of this, when leases were added, they were added to the > > same

[PATCH v2 29/41] 9p: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/9p/vfs_file.c | 39 +++ 1 file changed, 19 insertions(+), 20 deletions

[PATCH v2 28/41] filelock: convert seqfile handling to use file_lock_core

2024-01-25 Thread Jeff Layton
Reduce some pointer manipulation by just using file_lock_core where we can and only translate to a file_lock when needed. Signed-off-by: Jeff Layton --- fs/locks.c | 71 +++--- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git

[PATCH v2 22/41] filelock: clean up locks_delete_block internals

2024-01-25 Thread Jeff Layton
Rework the internals of locks_delete_block to use struct file_lock_core (mostly just for clarity's sake). The prototype is not changed. Signed-off-by: Jeff Layton --- fs/locks.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index

[PATCH v2 17/41] filelock: make locks_{insert,delete}_global_locks take file_lock_core arg

2024-01-25 Thread Jeff Layton
Convert these functions to take a file_lock_core instead of a file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index effe84f954f9..ad4bb9cd4c9d 100644 --- a/fs/locks.c +++ b/fs

[PATCH v2 21/41] filelock: convert fl_blocker to file_lock_core

2024-01-25 Thread Jeff Layton
Both locks and leases deal with fl_blocker. Switch the fl_blocker pointer in struct file_lock_core to point to the file_lock_core of the blocker instead of a file_lock structure. Signed-off-by: Jeff Layton --- fs/locks.c | 16 include/linux/filelock.h

[PATCH v2 10/41] filelock: split common fields into struct file_lock_core

2024-01-25 Thread Jeff Layton
the conversion is in progress. Signed-off-by: Jeff Layton --- fs/9p/vfs_file.c | 1 + fs/afs/internal.h | 1 + fs/ceph/locks.c | 1 + fs/dlm/plock.c| 1 + fs/gfs2/file.c| 1 + fs/lockd/clntproc.c | 1 + fs/locks.c| 1 + fs/nfs

[PATCH v2 27/41] filelock: convert locks_translate_pid to take file_lock_core

2024-01-25 Thread Jeff Layton
Signed-off-by: Jeff Layton --- fs/locks.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 0491d621417d..e8afdd084245 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2169,17 +2169,17 @@ EXPORT_SYMBOL_GPL(vfs_test_lock

[PATCH v2 41/41] filelock: split leases out of struct file_lock

2024-01-25 Thread Jeff Layton
leases, so split the lease-related operations off into a new lease_manager_operations struct. Signed-off-by: Jeff Layton --- fs/libfs.c | 2 +- fs/locks.c | 119 ++-- fs/nfs/nfs4_fs.h| 2 +- fs/nfs

[PATCH v2 40/41] filelock: remove temporary compatability macros

2024-01-25 Thread Jeff Layton
Everything has been converted to access fl_core fields directly, so we can now drop these. Signed-off-by: Jeff Layton --- include/linux/filelock.h | 16 1 file changed, 16 deletions(-) diff --git a/include/linux/filelock.h b/include/linux/filelock.h index 9ddf27faba94

[PATCH v2 39/41] smb/server: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/smb/server/smb2pdu.c | 45 ++--- fs/smb/server/vfs.c | 15

[PATCH v2 38/41] smb/client: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/smb/client/cifsglob.h | 1 - fs/smb/client/cifssmb.c | 9 +++--- fs/smb/client/file.c | 75

[PATCH v2 37/41] ocfs2: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/ocfs2/locks.c | 13 ++--- fs/ocfs2/stack_user.c | 3 +-- 2 files changed, 7 insertions(+), 9

[PATCH v2 36/41] nfsd: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/nfsd/filecache.c| 4 +-- fs/nfsd/netns.h| 1 - fs/nfsd/nfs4callback.c | 2 +- fs/nfsd

[PATCH v2 35/41] nfs: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/nfs/delegation.c | 4 ++-- fs/nfs/file.c | 23 +++ fs/nfs/nfs3proc.c | 2 +- fs

[PATCH v2 34/41] lockd: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/lockd/clnt4xdr.c | 14 +- fs/lockd/clntlock.c | 2 +- fs/lockd/clntproc.c | 62

[PATCH v2 33/41] gfs2: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/gfs2/file.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/file.c

[PATCH v2 32/41] dlm: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/dlm/plock.c | 45 ++--- 1 file changed, 22 insertions(+), 23 deletions

[PATCH v2 31/41] ceph: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/ceph/locks.c | 75 + 1 file changed, 38 insertions

[PATCH v2 30/41] afs: adapt to breakup of struct file_lock

2024-01-25 Thread Jeff Layton
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 --- fs/afs/flock.c | 55 +++--- fs/afs/internal.h | 1

[PATCH v2 20/41] filelock: convert __locks_insert_block, conflict and deadlock checks to use file_lock_core

2024-01-25 Thread Jeff Layton
Have both __locks_insert_block and the deadlock and conflict checking functions take a struct file_lock_core pointer instead of a struct file_lock one. Also, change posix_locks_deadlock to return bool. Signed-off-by: Jeff Layton --- fs/locks.c | 134

[PATCH v2 26/41] filelock: convert locks_insert_lock_ctx and locks_delete_lock_ctx

2024-01-25 Thread Jeff Layton
Have these functions take a file_lock_core pointer instead of a file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 03985cfb7eff..0491d621417d 100644

[PATCH v2 25/41] filelock: convert locks_wake_up_blocks to take a file_lock_core pointer

2024-01-25 Thread Jeff Layton
Have locks_wake_up_blocks take a file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 6182f5c5e7b4..03985cfb7eff 100644 --- a/fs

[PATCH v2 24/41] filelock: make assign_type helper take a file_lock_core pointer

2024-01-25 Thread Jeff Layton
Have assign_type take struct file_lock_core instead of file_lock. Signed-off-by: Jeff Layton --- fs/locks.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 647a778d2c85..6182f5c5e7b4 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -439,13

[PATCH v2 23/41] filelock: reorganize locks_delete_block and __locks_insert_block

2024-01-25 Thread Jeff Layton
file_lock_core, and fix up its callers. Signed-off-by: Jeff Layton --- fs/locks.c | 42 ++ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 739af36d98df..647a778d2c85 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -659,7 +659,7

[PATCH v2 19/41] filelock: make __locks_delete_block and __locks_wake_up_blocks take file_lock_core

2024-01-25 Thread Jeff Layton
Convert __locks_delete_block and __locks_wake_up_blocks to take a struct file_lock_core pointer. While we could do this in another way, we're going to need to add a file_lock() helper function later anyway, so introduce and use it now. Signed-off-by: Jeff Layton --- fs/locks.c | 45

[PATCH v2 18/41] filelock: convert locks_{insert,delete}_global_blocked

2024-01-25 Thread Jeff Layton
Have locks_insert_global_blocked and locks_delete_global_blocked take a struct file_lock_core pointer. Signed-off-by: Jeff Layton --- fs/locks.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index ad4bb9cd4c9d..d6d47612527c 100644

[PATCH v2 16/41] filelock: convert posix_owner_key to take file_lock_core arg

2024-01-25 Thread Jeff Layton
Convert posix_owner_key to take struct file_lock_core pointer, and fix up the callers to pass one in. Signed-off-by: Jeff Layton --- fs/locks.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index bd0cfee230ae..effe84f954f9 100644 --- a/fs

[PATCH v2 15/41] filelock: make posix_same_owner take file_lock_core pointers

2024-01-25 Thread Jeff Layton
Change posix_same_owner to take struct file_lock_core pointers, and convert the callers to pass those in. Signed-off-by: Jeff Layton --- fs/locks.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index a0d6fc0e043a..bd0cfee230ae

[PATCH v2 14/41] filelock: convert more internal functions to use file_lock_core

2024-01-25 Thread Jeff Layton
Convert more internal fs/locks.c functions to take and deal with struct file_lock_core instead of struct file_lock: - locks_dump_ctx_list - locks_check_ctx_file_list - locks_release_private - locks_owner_has_blockers Signed-off-by: Jeff Layton --- fs/locks.c | 51

[PATCH v2 13/41] filelock: convert some internal functions to use file_lock_core instead

2024-01-25 Thread Jeff Layton
Convert some internal fs/locks.c function to take and deal with struct file_lock_core instead of struct file_lock: - locks_init_lock_heads - locks_alloc_lock - locks_init_lock Signed-off-by: Jeff Layton --- fs/locks.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[PATCH v2 12/41] filelock: have fs/locks.c deal with file_lock_core directly

2024-01-25 Thread Jeff Layton
Convert fs/locks.c to access fl_core fields direcly rather than using the backward-compatability macros. Most of this was done with coccinelle, with a few by-hand fixups. Signed-off-by: Jeff Layton --- fs/locks.c | 479 include/trace

[PATCH v2 11/41] filelock: add coccinelle scripts to move fields to struct file_lock_core

2024-01-25 Thread Jeff Layton
This patch creates two ".cocci" semantic patches in a top level cocci/ directory. These patches were used to help generate several of the following patches. We can drop this patch or move the files to a more appropriate location before merging. Signed-off-by: Jeff Layton

[PATCH v2 05/41] nfsd: rename fl_type and fl_flags variables in nfsd4_lock

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some macros with names that clash with the variable names here. Rename them. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd

[PATCH v2 09/41] filelock: drop the IS_* macros

2024-01-25 Thread Jeff Layton
These don't add a lot of value over just open-coding the flag check. Suggested-by: NeilBrown Signed-off-by: Jeff Layton --- fs/locks.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index 1eceaa56e47f..87212f86eca9

[PATCH v2 08/41] afs: rename fl_type variable in afs_next_locker

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce macros that conflict with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/afs/flock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/afs/flock.c b/fs/afs/flock.c index 9c6dea3139f5..e7feaf66bddf 100644

[PATCH v2 07/41] 9p: rename fl_type variable in v9fs_file_do_lock

2024-01-25 Thread Jeff Layton
In later patches, we're going to introduce some macros that conflict with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/9p/vfs_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index bae330c2f0cf

[PATCH v2 06/41] lockd: rename fl_flags and fl_type variables in nlmclnt_lock

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some macros with names that clash with the variable names here. Rename them. Signed-off-by: Jeff Layton --- fs/lockd/clntproc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/lockd/clntproc.c b/fs/lockd

[PATCH v2 04/41] nfs: rename fl_flags variable in nfs4_proc_unlck

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some temporary macros with names that clash with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/nfs/nfs4proc.c | 10 +- fs/nfs/nfs4state.c | 16 2 files changed, 13 insertions(+), 13 deletions(-) diff

[PATCH v2 03/41] dlm: rename fl_flags variable in dlm_posix_unlock

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some temporary macros with names that clash with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/dlm/plock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c index d814c5121367

[PATCH v2 02/41] filelock: rename fl_pid variable in lock_get_status

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some macros that will clash with the variable name here. Rename it. Signed-off-by: Jeff Layton --- fs/locks.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/locks.c b/fs/locks.c index cc7c117ee192..1eceaa56e47f 100644

[PATCH v2 01/41] filelock: rename some fields in tracepoints

2024-01-25 Thread Jeff Layton
In later patches we're going to introduce some macros with names that clash with fields here. To prevent problems building, just rename the fields in the trace entry structures. Signed-off-by: Jeff Layton --- include/trace/events/filelock.h | 76 - 1 file

[PATCH v2 00/41] filelock: split struct file_lock into file_lock and file_lease structs

2024-01-25 Thread Jeff Layton
appropriate location or we can just drop that commit if it's not needed. Signed-off-by: Jeff Layton --- Changes in v2: - renamed file_lock_core fields to have "flc_" prefix - used macros to more easily do the change piecemeal - broke up patches into per-subsystem ones - Link to

Re: [PATCH 00/20] filelock: split struct file_lock into file_lock and file_lease structs

2024-01-17 Thread Jeff Layton
On Wed, 2024-01-17 at 10:12 -0500, Chuck Lever wrote: > On Tue, Jan 16, 2024 at 02:45:56PM -0500, Jeff Layton wrote: > > Long ago, file locks used to hang off of a singly-linked list in struct > > inode. Because of this, when leases were added, they were added to the > > same

Re: [PATCH 02/20] filelock: add coccinelle scripts to move fields to struct file_lock_core

2024-01-17 Thread Jeff Layton
d as well, but I'm not sure whether and how we should retain them for posterity. -- Jeff Layton

Re: [PATCH 00/20] filelock: split struct file_lock into file_lock and file_lease structs

2024-01-17 Thread Jeff Layton
l be happy to. Great! I probably have at least another version or two to send before it's ready for linux-next, but hopefully we can get it there soon after the merge window closes. Thanks, -- Jeff Layton

Re: [PATCH 01/20] filelock: split common fields into struct file_lock_core

2024-01-17 Thread Jeff Layton
On Wed, 2024-01-17 at 09:07 +1100, NeilBrown wrote: > On Wed, 17 Jan 2024, Jeff Layton wrote: > > 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

Re: [PATCH 20/20] filelock: split leases out of struct file_lock

2024-01-17 Thread Jeff Layton
On Wed, 2024-01-17 at 09:44 +1100, NeilBrown wrote: > On Wed, 17 Jan 2024, Jeff Layton wrote: > > Add a new struct file_lease and move the lease-specific fields from > > struct file_lock to it. Convert the appropriate API calls to take > > struct file_lease instead, and conve

  1   2   3   4   5   6   7   8   9   10   >