Deleted Added
sdiff udiff text old ( 97072 ) new ( 98175 )
full compact
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * John Heidemann of the UCLA Ficus project.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

35 *
36 * @(#)null_vnops.c 8.6 (Berkeley) 5/27/95
37 *
38 * Ancestors:
39 * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92
40 * ...and...
41 * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project
42 *
43 * $FreeBSD: head/sys/fs/nullfs/null_vnops.c 97072 2002-05-21 18:07:33Z semenu $
44 */
45
46/*
47 * Null Layer
48 *
49 * (See mount_nullfs(8) for more information.)
50 *
51 * The null layer duplicates a portion of the filesystem

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

710static int
711null_inactive(ap)
712 struct vop_inactive_args /* {
713 struct vnode *a_vp;
714 struct thread *a_td;
715 } */ *ap;
716{
717 struct vnode *vp = ap->a_vp;
718
719 /*
720 * If this is the last reference, then free up the vnode
721 * so as not to tie up the lower vnodes.
722 */
723 if (vp->v_usecount == 0)
724 vrecycle(vp, NULL, ap->a_td);
725 return (0);
726}
727
728/*
729 * We can free memory in null_inactive, but we do this
730 * here. (Possible to guard vp->v_data to point somewhere)
731 */
732static int

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

741 struct null_node *xp = VTONULL(vp);
742 struct vnode *lowervp = xp->null_lowervp;
743 void *vdata;
744
745 lockmgr(&null_hashlock, LK_EXCLUSIVE, NULL, td);
746 LIST_REMOVE(xp, null_hash);
747 lockmgr(&null_hashlock, LK_RELEASE, NULL, td);
748
749 xp->null_lowervp = NULLVP;
750 if (vp->v_vnlock != NULL) {
751 vp->v_vnlock = &vp->v_lock; /* we no longer share the lock */
752 } else
753 VOP_UNLOCK(vp, LK_THISLAYER, td);
754
755 /*
756 * Now it is safe to drop references to the lower vnode.
757 * VOP_INACTIVE() will be called by vrele() if necessary.
758 */
759 vput(lowervp);
760 vrele (lowervp);
761
762 vdata = vp->v_data;
763 vp->v_data = NULL;
764 FREE(vdata, M_NULLFSNODE);
765
766 return (0);
767}
768

--- 95 unchanged lines hidden ---