summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorarr <arr@FreeBSD.org>2003-02-15 23:25:12 +0000
committerarr <arr@FreeBSD.org>2003-02-15 23:25:12 +0000
commit8e7322af296932055fbcd4c246cc115c209b5c82 (patch)
tree2dc62e93ae3a1fdc3c70b3c14eea83eb2cc71438 /sys
parent3fc8f673803b1b035b934f38bc81a45b9e1e691f (diff)
downloadFreeBSD-src-8e7322af296932055fbcd4c246cc115c209b5c82.zip
FreeBSD-src-8e7322af296932055fbcd4c246cc115c209b5c82.tar.gz
- Update a couple of comments to make sense with what today's code is
doing (stale comments make arr something something ;)).
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_cache.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 6faebdb..33fc4f0 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -370,8 +370,10 @@ cache_lookup(dvp, vpp, cnp)
numneghits++;
/*
- * We found a "negative" match, ENOENT notifies client of this match.
- * The nc_vpid field records whether this is a whiteout.
+ * We found a "negative" match, so we shift it to the end of
+ * the "negative" cache entries queue to satisfy LRU. Also,
+ * check to see if the entry is a whiteout; indicate this to
+ * the componentname, if so.
*/
TAILQ_REMOVE(&ncneg, ncp, nc_dst);
TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst);
@@ -427,10 +429,9 @@ cache_enter(dvp, vp, cnp)
}
/*
- * Fill in cache info, if vp is NULL this is a "negative" cache entry.
- * For negative entries, we have to record whether it is a whiteout.
- * the whiteout flag is stored in the nc_vpid field which is
- * otherwise unused.
+ * Set the rest of the namecache entry elements, calculate it's
+ * hash key and insert it into the appropriate chain within
+ * the cache entries table.
*/
ncp->nc_vp = vp;
ncp->nc_dvp = dvp;
@@ -445,6 +446,11 @@ cache_enter(dvp, vp, cnp)
numcachehv++;
}
LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src);
+ /*
+ * If the entry is "negative", we place it into the
+ * "negative" cache queue, otherwise, we place it into the
+ * destination vnode's cache entries queue.
+ */
if (vp) {
TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst);
} else {
OpenPOWER on IntegriCloud