Deleted Added
sdiff udiff text old ( 181793 ) new ( 182061 )
full compact
1/*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Poul-Henning Kamp of the FreeBSD Project.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 19 unchanged lines hidden (view full) ---

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)vfs_cache.c 8.5 (Berkeley) 3/22/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/kern/vfs_cache.c 181793 2008-08-16 21:48:10Z alfred $");
37
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/kernel.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/sysctl.h>
44#include <sys/mount.h>

--- 450 unchanged lines hidden (view full) ---

495 dvp->v_dd = vp;
496 CACHE_UNLOCK();
497 return;
498 }
499 }
500
501 hold = 0;
502 zap = 0;
503 ncp = cache_alloc(cnp->cn_namelen);
504 CACHE_LOCK();
505 numcache++;
506 if (!vp) {
507 numneg++;
508 ncp->nc_flag = cnp->cn_flags & ISWHITEOUT ? NCF_WHITE : 0;
509 } else if (vp->v_type == VDIR) {
510 vp->v_dd = dvp;
511 } else {
512 vp->v_dd = NULL;
513 }
514
515 /*
516 * Set the rest of the namecache entry elements, calculate it's
517 * hash key and insert it into the appropriate chain within
518 * the cache entries table.
519 */
520 ncp->nc_vp = vp;
521 ncp->nc_dvp = dvp;
522 len = ncp->nc_nlen = cnp->cn_namelen;
523 hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT);
524 bcopy(cnp->cn_nameptr, ncp->nc_name, len);
525 hash = fnv_32_buf(&dvp, sizeof(dvp), hash);
526 ncpp = NCHHASH(hash);
527 LIST_INSERT_HEAD(ncpp, ncp, nc_hash);
528 if (LIST_EMPTY(&dvp->v_cache_src)) {
529 hold = 1;
530 numcachehv++;
531 }
532 LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src);
533 /*

--- 358 unchanged lines hidden ---