summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1997-08-25 20:31:00 +0000
committerphk <phk@FreeBSD.org>1997-08-25 20:31:00 +0000
commite8965428425a8be4dce4110f0524ecad89f27d13 (patch)
tree700ff9b91e07a8901f68a07cb4531bc792f0009f /sys
parent245dfccc2d7607422277b69ddda6d3ad85a83c52 (diff)
downloadFreeBSD-src-e8965428425a8be4dce4110f0524ecad89f27d13.zip
FreeBSD-src-e8965428425a8be4dce4110f0524ecad89f27d13.tar.gz
Copy&Paste considered harmful:
Remove all traces of the name_cache from devfs. It is hardly sensible to use the namecache for an all-RAM filesystem.
Diffstat (limited to 'sys')
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c68
1 files changed, 1 insertions, 67 deletions
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index e4962a6..f02df59 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -1,7 +1,7 @@
/*
* Written by Julian Elischer (julian@DIALix.oz.au)
*
- * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.35 1997/02/24 17:08:49 bde Exp $
+ * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v 1.36 1997/04/10 15:05:38 bde Exp $
*
* symlinks can wait 'til later.
*/
@@ -111,66 +111,8 @@ DBPRINT(("lookup\n"));
/*
* We now have a segment name to search for, and a directory to search.
*
- * Before tediously performing a linear scan of the directory,
- * check the name cache to see if the directory/name pair
- * we are looking for is known already.
*/
-#ifdef NOT_AT_THE_MOMENT
- if (error = cache_lookup(dir_vnode, result_vnode, cnp)) {
- int vpid; /* capability number of vnode */
-
- if (error == ENOENT)
- return (error); /* got an actual -ve hit */
-DBPRINT(("cached "));
- /*
- * Claim the next vnode in the path.
- * See comment below starting `Step through' for
- * an explaination of the locking protocol.
- */
-#ifdef MAYBE_NOT_NEEDED
- if(devfs_vntodn(*result_vnode,&new_node))
- {
- printf("vnode has changed!?\n");
- vprint("=",*result_vnode);
- return(EINVAL);
- }
-#endif
- vpid = (*result_vnode)->v_id;
- if (dir_vnode == *result_vnode) { /* is "." */
- VREF(*result_vnode); /* not a full vget() */
- error = 0;
- } else if (flags & ISDOTDOT) {/* do a locking dance */
- VOP_UNLOCK(dir_vnode, 0, p);
- error = vget(*result_vnode,1);
- if (!error && lockparent && (flags & ISLASTCN))
- vn_lock(dir_vnode, LK_EXCLUSIVE | LK_RETRY, p);
- } else {
- error = vget(*result_vnode,1);
- if (!lockparent || error || !(flags & ISLASTCN))
- VOP_UNLOCK(dir_vnode, 0, p);
- }
- /*
- * Check that the capability number did not change
- * while we were waiting for the lock.
- */
- if (!error) {
- if (vpid == (*result_vnode)->v_id)
- return (0); /* SUCCCESS, return! */
- vput((*result_vnode)); /* pretend we failed */
- if (lockparent
- && (dir_vnode != *result_vnode)
- && (flags & ISLASTCN))
- VOP_UNLOCK(dir_vnode, 0, p);
- } else { /* we have an error */
-
- }
- if (error = vn_lock(dir_vnode, LK_EXCLUSIVE | LK_RETRY, p))
- return error;
- *result_vnode = NULL; /* safe not sorry */
-DBPRINT(("errr, maybe not cached "));
- }
-#endif
/***********************************************************************\
* SEARCH FOR NAME *
* while making sure the component is null terminated for the strcmp *
@@ -197,7 +139,6 @@ DBPRINT(("errr, maybe not cached "));
* (as non-existent) if appropriate.
*/
if ((cnp->cn_flags & MAKEENTRY) && op != CREATE)
- cache_enter(dir_vnode, *result_vnode, cnp);
DBPRINT(("NOT\n"));
return ENOENT;
}
@@ -339,11 +280,6 @@ DBPRINT(("MKACCESS "));
VOP_UNLOCK(dir_vnode, 0, p);
}
- /*
- * Insert name into cache if appropriate.
- */
- if (cnp->cn_flags & MAKEENTRY)
- cache_enter(dir_vnode, *result_vnode, cnp);
DBPRINT(("GOT\n"));
return (0);
}
@@ -973,7 +909,6 @@ abortit:
error = ENOTEMPTY;
goto abortit;
}
- cache_purge(vp); /*XXX*/
dev_free_name(tnp);
tp = NULL;
vput(vp);
@@ -1264,7 +1199,6 @@ abortit:
error = ENOTEMPTY;
goto bad;
}
- cache_purge(tvp); /*XXX*/
dev_free_name(tnp);
tp = NULL;
}
OpenPOWER on IntegriCloud