git: kernel - Normalize the vx_*() vnode interface

Matthew Dillon dillon at crater.dragonflybsd.org
Tue Mar 3 19:39:35 PST 2020


commit fc36a10bce8c5678d103e0498db849506d9dac68
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Tue Mar 3 13:26:48 2020 -0800

    kernel - Normalize the vx_*() vnode interface
    
    * The vx_*() vnode interface is used for initial allocations, reclaims,
      and terminations.
    
      Normalize all use cases to prevent the mixing together of the vx_*()
      API and the vn_*() API.  For example, vx_lock() should not be paired
      with vn_unlock(), and so forth.
    
    * Integrate an update-counter mechanism into the vx_*() API, assert
      reasonability.
    
    * Change vfs_cache.c to use an int update counter instead of a long.
      The vfs_cache code can't quite use the spin-lock update counter API
      yet.
    
      Use proper atomics for load and store.
    
    * Implement VOP_GETATTR_QUICK, meant to be a 'quick' version of
      VOP_GETATTR() that only retrieves information related to permissions
      and ownership.  This will be fast-pathed in a later commit.
    
    * Implement vx_downgrade() to convert an exclusive vx_lock into an
      exclusive vn_lock (for vnodes).  Adjust all use cases in the
      getnewvnode() path.
    
    * Remove unnecessary locks in tmpfs_getattr() and don't use
      any in tmpfs_getattr_quick().
    
    * Remove unnecessary locks in hammer2_vop_getattr() and don't use
      any in hammer2_vop_getattr_quick()

Summary of changes:
 sys/gnu/vfs/ext2fs/ext2_vfsops.c     |  2 +
 sys/kern/vfs_cache.c                 | 31 +++++++++-----
 sys/kern/vfs_default.c               | 12 ++++++
 sys/kern/vfs_lock.c                  | 23 ++++++++++-
 sys/kern/vfs_mount.c                 |  4 +-
 sys/kern/vfs_nlookup.c               | 10 ++++-
 sys/kern/vfs_subr.c                  |  5 ++-
 sys/kern/vfs_vnops.c                 | 14 +++++++
 sys/kern/vfs_vopops.c                | 33 +++++++++++++++
 sys/sys/spinlock2.h                  | 22 +++++++++-
 sys/sys/systm.h                      | 15 +++++--
 sys/sys/vfsops.h                     |  6 +++
 sys/sys/vnode.h                      |  4 +-
 sys/vfs/autofs/autofs_vnops.c        |  1 +
 sys/vfs/devfs/devfs_core.c           |  1 +
 sys/vfs/dirfs/dirfs_subr.c           |  2 +
 sys/vfs/fuse/fuse_node.c             |  1 +
 sys/vfs/hammer/hammer_inode.c        |  3 +-
 sys/vfs/hammer/hammer_vnops.c        |  4 +-
 sys/vfs/hammer2/hammer2_inode.c      |  1 +
 sys/vfs/hammer2/hammer2_vnops.c      | 78 +++++++++++++++++++++++++++++++++---
 sys/vfs/hpfs/hpfs_vfsops.c           |  1 +
 sys/vfs/isofs/cd9660/cd9660_vfsops.c |  1 +
 sys/vfs/msdosfs/msdosfs_denode.c     |  1 +
 sys/vfs/nfs/nfs_node.c               |  2 +
 sys/vfs/ntfs/ntfs_vfsops.c           |  3 +-
 sys/vfs/procfs/procfs_subr.c         |  1 +
 sys/vfs/smbfs/smbfs_node.c           |  1 +
 sys/vfs/tmpfs/tmpfs_subr.c           |  1 +
 sys/vfs/tmpfs/tmpfs_vnops.c          | 38 +++++++++++++++++-
 sys/vfs/tmpfs/tmpfs_vnops.h          |  1 +
 sys/vfs/udf/udf_vnops.c              |  2 +-
 sys/vfs/ufs/ffs_vfsops.c             |  2 +
 33 files changed, 293 insertions(+), 33 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fc36a10bce8c5678d103e0498db849506d9dac68


-- 
DragonFly BSD source repository


More information about the Commits mailing list