Deleted Added
full compact
vfs_cache.c (144319) vfs_cache.c (145006)
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>
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 144319 2005-03-30 03:01:36Z das $");
36__FBSDID("$FreeBSD: head/sys/kern/vfs_cache.c 145006 2005-04-13 10:59:09Z jeff $");
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>

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

339int
340cache_lookup(dvp, vpp, cnp)
341 struct vnode *dvp;
342 struct vnode **vpp;
343 struct componentname *cnp;
344{
345 struct namecache *ncp;
346 u_int32_t hash;
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>

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

339int
340cache_lookup(dvp, vpp, cnp)
341 struct vnode *dvp;
342 struct vnode **vpp;
343 struct componentname *cnp;
344{
345 struct namecache *ncp;
346 u_int32_t hash;
347 int error;
347
348 if (!doingcache) {
349 cnp->cn_flags &= ~MAKEENTRY;
350 return (0);
351 }
352retry:
353 CACHE_LOCK();
354 numcalls++;

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

442 VREF(*vpp);
443 CACHE_UNLOCK();
444 return (-1);
445 }
446 if (cnp->cn_flags & ISDOTDOT)
447 VOP_UNLOCK(dvp, 0, cnp->cn_thread);
448 VI_LOCK(*vpp);
449 CACHE_UNLOCK();
348
349 if (!doingcache) {
350 cnp->cn_flags &= ~MAKEENTRY;
351 return (0);
352 }
353retry:
354 CACHE_LOCK();
355 numcalls++;

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

443 VREF(*vpp);
444 CACHE_UNLOCK();
445 return (-1);
446 }
447 if (cnp->cn_flags & ISDOTDOT)
448 VOP_UNLOCK(dvp, 0, cnp->cn_thread);
449 VI_LOCK(*vpp);
450 CACHE_UNLOCK();
450 if (vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread)) {
451 if (cnp->cn_flags & ISDOTDOT)
452 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_thread);
451 error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread);
452 if (cnp->cn_flags & ISDOTDOT)
453 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, cnp->cn_thread);
454 if (error) {
453 *vpp = NULL;
454 goto retry;
455 }
456 return (-1);
457}
458
459/*
460 * Add an entry to the cache.

--- 401 unchanged lines hidden ---
455 *vpp = NULL;
456 goto retry;
457 }
458 return (-1);
459}
460
461/*
462 * Add an entry to the cache.

--- 401 unchanged lines hidden ---