git: kernel - Move primary lockf management into struct vnode

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Aug 31 21:26:44 PDT 2026


commit 30436b52c8f4e3d9d15ef2e31a9e95b0bfac72ff
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Aug 31 21:20:33 2026 -0700

    kernel - Move primary lockf management into struct vnode
    
    * Move lockf management out of per-filesystem in-memory inodes and
      into the general vnode structure.  This will make follow-on work
      easier and removes unnecessary code from various filesystem
      implementations.
    
    * Remove related implementations from fs code except for smbfs.
    
    * Add optimization to avoid allocating struct lockf for LK_GETLK.
      Allows filesystem lock scans to avoid allocating struct lockf
      unnecessarily.  Suggested by ryao.
    
    * Just enable for existing filesystems that previously implemented it
      in this commit.  There may be a follow-up to enable it in the
      default VOPS for all vnodes.

Summary of changes:
 sys/kern/kern_lockf.c               | 143 +++++++++++++++++++++++++-----------
 sys/kern/vfs_lock.c                 |   8 +-
 sys/sys/lockf.h                     |   6 +-
 sys/sys/vnode.h                     |   7 ++
 sys/vfs/dirfs/dirfs.h               |   1 -
 sys/vfs/dirfs/dirfs_vnops.c         |  13 +---
 sys/vfs/fuse/fuse.h                 |   1 -
 sys/vfs/fuse/fuse_vnops.c           |  14 +---
 sys/vfs/hammer/hammer.h             |   1 -
 sys/vfs/hammer/hammer_vnops.c       |  17 +----
 sys/vfs/hammer2/hammer2.h           |   1 -
 sys/vfs/hammer2/hammer2_vnops.c     |  16 +---
 sys/vfs/isofs/cd9660/cd9660_node.h  |   1 -
 sys/vfs/isofs/cd9660/cd9660_vnops.c |  13 +---
 sys/vfs/nfs/nfs_vnops.c             |  24 +-----
 sys/vfs/nfs/nfsnode.h               |   1 -
 sys/vfs/smbfs/smbfs_node.h          |   1 -
 sys/vfs/smbfs/smbfs_vnops.c         |   8 +-
 sys/vfs/tmpfs/tmpfs.h               |   1 -
 sys/vfs/tmpfs/tmpfs_subr.c          |   1 -
 sys/vfs/tmpfs/tmpfs_vnops.c         |  15 +---
 sys/vfs/ufs/inode.h                 |   2 +-
 sys/vfs/ufs/ufs_vnops.c             |  18 +----
 23 files changed, 132 insertions(+), 181 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/30436b52c8f4e3d9d15ef2e31a9e95b0bfac72ff


-- 
DragonFly BSD source repository


More information about the Commits mailing list