Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2008 19:06:44 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/ufs/ufs inode.h ufs_lookup.c
Message-ID:  <200809161907.m8GJ75En006125@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2008-09-16 19:06:44 UTC

  FreeBSD src repository

  Modified files:
    sys/ufs/ufs          inode.h ufs_lookup.c 
  Log:
  SVN rev 183093 on 2008-09-16 19:06:44Z by jhb
  
  Retire the 'i_reclen' field from the in-memory i-node.  Previously,
  during a DELETE lookup operation, lookup would cache the length of the
  directory entry to be deleted in 'i_reclen'.  Later, the actual VOP to
  remove the directory entry (ufs_remove, ufs_rename, etc.) would call
  ufs_dirremove() which extended the length of the previous directory
  entry to "remove" the deleted entry.
  
  However, we always read the entire block containing the directory
  entry when doing the removal, so we always have the directory entry to
  be deleted in-memory when doing the update to the directory block.
  Also, we already have to figure out where the directory entry that is
  being removed is in the block so that we can pass the component name
  to the dirhash code to update the dirhash.  So, instead of passing
  'i_reclen' from ufs_lookup() to the ufs_dirremove() routine, just read
  the 'd_reclen' field directly out of the entry being removed when
  updating the length of the previous entry in the block.
  
  This avoids a cosmetic issue of writing to 'i_reclen' while holding a
  shared vnode lock.  It also slightly reduces the amount of side-band
  data passed from ufs_lookup() to operations updating a directory via
  the directory's i-node.
  
  Reviewed by:    jeff
  
  Revision  Changes    Path
  1.54      +0 -1      src/sys/ufs/ufs/inode.h
  1.92      +9 -6      src/sys/ufs/ufs/ufs_lookup.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809161907.m8GJ75En006125>