git: kernel - Change ncp->nc_generation operation

Matthew Dillon dillon at crater.dragonflybsd.org
Sun Jul 3 22:28:40 PDT 2022


commit cb96f7b76c40052222d3e48e63eb995d864a09d3
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Sun Jul 3 17:10:51 2022 -0700

    kernel - Change ncp->nc_generation operation
    
    * Change nc_generation operation.  Bit 0 is reserved.  The field is
      incremented by 2 whenever major changes are being made to the ncp
      (linking, unlinking, destruction, resolve, unresolve, vnode adjustment),
      and then incremented by 2 again when the operation is complete.
    
      The caller can test for a major gen change using:
    
      curr_gen = ncp->nc_generation & ~3;
      if ((orig_gen - curr_gen) & ~1)
          (retry needed)
    
    * Allows unlocked/relocked code to determine whether the ncp has possibly
      changed or not (will be used in upcoming commits).
    
    * Adjust the kern_rename() code to use the generation numbers.
    
    * Bit 0 will be used to check for a combination of major changes and
      lock cycling inthe future.

Summary of changes:
 sys/kern/vfs_cache.c    | 157 +++++++++++++++++++++++++++++++++++-------------
 sys/kern/vfs_syscalls.c |  11 ++--
 sys/sys/namecache.h     |  19 ++++--
 3 files changed, 137 insertions(+), 50 deletions(-)

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


-- 
DragonFly BSD source repository


More information about the Commits mailing list