]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Merge series 'filelock: split file leases out of struct file_lock' of https://lore...
authorChristian Brauner <brauner@kernel.org>
Fri, 2 Feb 2024 11:09:26 +0000 (12:09 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 5 Feb 2024 12:11:45 +0000 (13:11 +0100)
Pull file locking series from Jeff Layton:

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 list and so they had to be tracked using the same sort of
structure.

Several years ago, we added struct file_lock_context, which allowed us
to use separate lists to track different types of file locks. Given
that, leases no longer need to be tracked using struct file_lock.

That said, a lot of the underlying infrastructure _is_ the same between
file leases and locks, so we can't completely separate everything.

This patchset first splits a group of fields used by both file locks and
leases into a new struct file_lock_core, that is then embedded in struct
file_lock. Coccinelle was then used to convert a lot of the callers to
deal with the move, with the remaining 25% or so converted by hand.

It then converts several internal functions in fs/locks.c to work with
struct file_lock_core. Lastly, struct file_lock is split into struct
file_lock and file_lease, and the lease-related APIs converted to take
struct file_lease.

I also added a few small helpers and converted several users over to
them. That reduces the size of the per-fs conversion patches later in
the series. I played with some others too, but they were too awkward
or not frequently used enough to make it worthwhile.

* series 'filelock: split file leases out of struct file_lock' of https://lore.kernel.org/r/20240131-flsplit-v3-0-c6129007ee8d@kernel.org: (47 commits)

  filelock: split leases out of struct file_lock
  filelock: remove temporary compatibility macros
  smb/server: adapt to breakup of struct file_lock
  smb/client: adapt to breakup of struct file_lock
  ocfs2: adapt to breakup of struct file_lock
  nfsd: adapt to breakup of struct file_lock
  nfs: adapt to breakup of struct file_lock
  lockd: adapt to breakup of struct file_lock
  fuse: adapt to breakup of struct file_lock
  gfs2: adapt to breakup of struct file_lock
  dlm: adapt to breakup of struct file_lock
  ceph: adapt to breakup of struct file_lock
  afs: adapt to breakup of struct file_lock
  9p: adapt to breakup of struct file_lock
  filelock: convert seqfile handling to use file_lock_core
  filelock: convert locks_translate_pid to take file_lock_core
  filelock: convert locks_insert_lock_ctx and locks_delete_lock_ctx
  filelock: convert locks_wake_up_blocks to take a file_lock_core pointer
  filelock: make assign_type helper take a file_lock_core pointer
  filelock: reorganize locks_delete_block and __locks_insert_block
  ...

Signed-off-by: Christian Brauner <brauner@kernel.org>

Trivial merge