aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorAndrew R. Reiter <arr@FreeBSD.org>2003-02-15 23:25:12 +0000
committerAndrew R. Reiter <arr@FreeBSD.org>2003-02-15 23:25:12 +0000
commit1f5a94d5f63f14677ef2a6efb0541438b22085a5 (patch)
tree2dc62e93ae3a1fdc3c70b3c14eea83eb2cc71438 /sys/kern/vfs_cache.c
parentd477c0ca569aa314b1b991673949be03cd20595b (diff)
downloadsrc-1f5a94d5f63f14677ef2a6efb0541438b22085a5.tar.gz
src-1f5a94d5f63f14677ef2a6efb0541438b22085a5.zip
- Update a couple of comments to make sense with what today's code is
doing (stale comments make arr something something ;)).
Notes
Notes: svn path=/head/; revision=110967
Diffstat (limited to 'sys/kern/vfs_cache.c')
-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 6faebdb9279e..33fc4f0ef059 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 {