cvs commit: src/sys/ufs/ufs inode.h ufs_lookup.c
jhb at FreeBSD.org
Tue Sep 16 19:07:05 UTC 2008
jhb 2008-09-16 19:06:44 UTC
FreeBSD src repository
sys/ufs/ufs inode.h ufs_lookup.c
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
More information about the cvs-src