On 27 May 1999, Ville-Pertti Keinonen wrote: > zzh...@cs.binghamton.edu (Zhihui Zhang) writes: > > > Suppose you want to mv a directory file (with subdirectories) to another > > name (it is like grafting a subtree to another point), the namecache > > associated with the source directory file will be purged by calling > > cache_purge() (done in ufs_rename()?). However, the routine cache_purge() > > does not purge cache entries recursively down the subtree. Will this > > result in a lot of stale entries in the namecache? FreeBSD 3.1 no longer > > The name cache only caches component names, not paths, so the entries > are still valid. >
Thanks for your reply. I understand now that the namecache only acts on individual component names, not on the entire pathname. The following is based on my understanding: Suppose, you have a directory hierarchy a -> b -> c. In each of a, b, and c, we have the following files: a: ., .., a1, a2, a3, b (a1, a2, a3 are not directory files) b: ., .., b1, b2, b3, c (b1, b2, b3 are not directory files) If I do a "mv a a_new", then cache entries for a, a1, a2, a3, b will be purged from the cache. Although b is purged from the namecache, we can still find it by other means (e.g. ufs_ihashget() called by ffs_vget()). So the entries for b1, b2, b3, c are still useful. So the namei cache will not contain any stale entries. Am I right? -Zhihui To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message