aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/pseudofs/pseudofs_vncache.c
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2001-12-19 23:58:09 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2001-12-19 23:58:09 +0000
commit08f3c74981d5a9ffa922891659bf33645cb7cbac (patch)
tree8f5cdcce47814a8ae5ad5c7a7b5a8466c7b755be /sys/fs/pseudofs/pseudofs_vncache.c
parent02f2c8a235b464475c6b475617637b185c203280 (diff)
downloadsrc-08f3c74981d5a9ffa922891659bf33645cb7cbac.tar.gz
src-08f3c74981d5a9ffa922891659bf33645cb7cbac.zip
Notes
Diffstat (limited to 'sys/fs/pseudofs/pseudofs_vncache.c')
-rw-r--r--sys/fs/pseudofs/pseudofs_vncache.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c
index 71f6159f825f..333e32506fb4 100644
--- a/sys/fs/pseudofs/pseudofs_vncache.c
+++ b/sys/fs/pseudofs/pseudofs_vncache.c
@@ -105,9 +105,11 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp,
{
struct pfs_vdata *pvd;
int error;
-
- /* see if the vnode is in the cache */
- /* XXX linear search... not very efficient */
+
+ /*
+ * See if the vnode is in the cache.
+ * XXX linear search is not very efficient.
+ */
mtx_lock(&pfs_vncache_mutex);
for (pvd = pfs_vncache; pvd; pvd = pvd->pvd_next) {
if (pvd->pvd_pn == pn && pvd->pvd_pid == pid) {
@@ -115,6 +117,8 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp,
++pfs_vncache_hits;
*vpp = pvd->pvd_vnode;
mtx_unlock(&pfs_vncache_mutex);
+ /* XXX see comment at top of pfs_lookup() */
+ cache_purge(*vpp);
return (0);
}
/* XXX if this can happen, we're in trouble */
@@ -176,6 +180,8 @@ int
pfs_vncache_free(struct vnode *vp)
{
struct pfs_vdata *pvd;
+
+ cache_purge(vp);
mtx_lock(&pfs_vncache_mutex);
pvd = (struct pfs_vdata *)vp->v_data;