Deleted Added
sdiff udiff text old ( 42315 ) new ( 42408 )
full compact
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
39 * $Id: vfs_subr.c,v 1.180 1999/01/05 18:49:53 eivind Exp $
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45#include "opt_ddb.h"
46
47#include <sys/param.h>

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

461 cache_purge(vp);
462 vp->v_lease = NULL;
463 if (vp->v_type != VBAD) {
464 vgonel(vp, p);
465 } else {
466 simple_unlock(&vp->v_interlock);
467 }
468
469#ifdef INVARIANTS
470 {
471 int s;
472
473 if (vp->v_data)
474 panic("cleaned vnode isn't");
475 s = splbio();
476 if (vp->v_numoutput)
477 panic("Clean vnode has pending I/O's");

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

791 */
792void
793bgetvp(vp, bp)
794 register struct vnode *vp;
795 register struct buf *bp;
796{
797 int s;
798
799 KASSERT(bp->b_vp == NULL, ("bgetvp: not free"));
800 vhold(vp);
801 bp->b_vp = vp;
802 if (vp->v_type == VBLK || vp->v_type == VCHR)
803 bp->b_dev = vp->v_rdev;
804 else
805 bp->b_dev = NODEV;
806 /*
807 * Insert onto list for new vnode.

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

819void
820brelvp(bp)
821 register struct buf *bp;
822{
823 struct vnode *vp;
824 struct buflists *listheadp;
825 int s;
826
827 KASSERT(bp->b_vp != NULL, ("brelvp: NULL"));
828
829 /*
830 * Delete from old vnode list, if on one.
831 */
832 vp = bp->b_vp;
833 s = splbio();
834 if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
835 if (bp->b_xflags & B_VNDIRTY)

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

985/*
986 * Associate a p-buffer with a vnode.
987 */
988void
989pbgetvp(vp, bp)
990 register struct vnode *vp;
991 register struct buf *bp;
992{
993 KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
994
995 bp->b_vp = vp;
996 if (vp->v_type == VBLK || vp->v_type == VCHR)
997 bp->b_dev = vp->v_rdev;
998 else
999 bp->b_dev = NODEV;
1000}
1001
1002/*
1003 * Disassociate a p-buffer from a vnode.
1004 */
1005void
1006pbrelvp(bp)
1007 register struct buf *bp;
1008{
1009
1010 KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL"));
1011
1012 bp->b_vp = (struct vnode *) 0;
1013}
1014
1015/*
1016 * Reassign a buffer from one vnode to another.
1017 * Used to assign file specific control information
1018 * (indirect blocks) to the vnode to which they belong.

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

1297 * If count drops to zero, call inactive routine and return to freelist.
1298 */
1299void
1300vrele(vp)
1301 struct vnode *vp;
1302{
1303 struct proc *p = curproc; /* XXX */
1304
1305 KASSERT(vp, ("vrele: null vp"));
1306
1307 simple_lock(&vp->v_interlock);
1308
1309 if (vp->v_usecount > 1) {
1310
1311 vp->v_usecount--;
1312 simple_unlock(&vp->v_interlock);
1313
1314 return;

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

1338}
1339
1340void
1341vput(vp)
1342 struct vnode *vp;
1343{
1344 struct proc *p = curproc; /* XXX */
1345
1346 KASSERT(vp != NULL, ("vput: null vp"));
1347
1348 simple_lock(&vp->v_interlock);
1349
1350 if (vp->v_usecount > 1) {
1351
1352 vp->v_usecount--;
1353 VOP_UNLOCK(vp, LK_INTERLOCK, p);
1354 return;

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

1625 struct vop_revoke_args /* {
1626 struct vnode *a_vp;
1627 int a_flags;
1628 } */ *ap;
1629{
1630 struct vnode *vp, *vq;
1631 struct proc *p = curproc; /* XXX */
1632
1633 KASSERT((ap->a_flags & REVOKEALL) != 0, ("vop_revoke"));
1634
1635 vp = ap->a_vp;
1636 simple_lock(&vp->v_interlock);
1637
1638 if (vp->v_flag & VALIASED) {
1639 /*
1640 * If a vgone (or vclean) is already in progress,
1641 * wait until it is done and return.

--- 1185 unchanged lines hidden ---