From 200cb75d45321d81136117fc3aa10ecd56ab37d2 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Sun, 5 Jul 1992 21:38:42 -0800 Subject: [PATCH] delete USES_VOP_whatever (Kirk); use lfs_seglock/unlock instead of vfs_busy/unbusy SCCS-vsn: sys/ufs/lfs/lfs_segment.c 7.21 --- usr/src/sys/ufs/lfs/lfs_segment.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/usr/src/sys/ufs/lfs/lfs_segment.c b/usr/src/sys/ufs/lfs/lfs_segment.c index 10b3c8a3f3..2b366e07d8 100644 --- a/usr/src/sys/ufs/lfs/lfs_segment.c +++ b/usr/src/sys/ufs/lfs/lfs_segment.c @@ -4,7 +4,7 @@ * * %sccs.include.redist.c% * - * @(#)lfs_segment.c 7.20 (Berkeley) %G% + * @(#)lfs_segment.c 7.21 (Berkeley) %G% */ #include @@ -91,23 +91,14 @@ lfs_vflush(vp) { struct inode *ip; struct lfs *fs; - struct mount *mp; struct segment *sp; int error, s; #ifdef VERBOSE printf("lfs_vflush\n"); #endif - mp = vp->v_mount; - fs = VFSTOUFS(mp)->um_lfs; - - /* - * XXX - * check flags? - * mp->mnt_flag & (MNT_MLOCK|MNT_RDONLY|MNT_MPBUSY) || - */ - if (vfs_busy(mp)) - return (0); + fs = VFSTOUFS(vp->v_mount)->um_lfs; + lfs_seglock(fs); /* * Allocate a segment structure and enough space to hold pointers to @@ -136,7 +127,7 @@ lfs_vflush(vp) (void) lfs_writeinode(fs, sp, ip); ip->i_flags &= ~(IMOD | IACC | IUPD | ICHG); - (void) lfs_writeseg(fs, sp); + (void)lfs_writeseg(fs, sp); /* * If the I/O count is non-zero, sleep until it reaches zero. At the @@ -150,7 +141,7 @@ lfs_vflush(vp) return (error); } splx(s); - vfs_unbusy(mp); + lfs_segunlock(fs); /* * XXX @@ -214,7 +205,6 @@ lfs_segwrite(mp, do_ckp) struct mount *mp; int do_ckp; /* Do a checkpoint. */ { - USES_VOP_ISLOCKED; struct inode *ip; struct lfs *fs; struct segment *sp; @@ -225,6 +215,7 @@ lfs_segwrite(mp, do_ckp) printf("lfs_segwrite\n"); #endif fs = VFSTOUFS(mp)->um_lfs; + lfs_seglock(fs); /* * Allocate a segment structure and enough space to hold pointers to @@ -308,6 +299,8 @@ redo: } else splx(s); + lfs_segunlock(fs); + free(sp->bpp, M_SEGMENT); free(sp, M_SEGMENT); @@ -548,7 +541,6 @@ lfs_updatemeta(fs, sp, vp, lbp, bpp, nblocks) struct buf **bpp; int nblocks; { - USES_VOP_BWRITE; SEGUSE *sup; struct buf *bp; INDIR a[NIADDR], *ap; @@ -732,7 +724,6 @@ lfs_writeseg(fs, sp) struct lfs *fs; struct segment *sp; { - USES_VOP_STRATEGY; struct buf **bpp, *bp, *cbp; SEGUSE *sup; SEGSUM *ssp; @@ -741,6 +732,7 @@ lfs_writeseg(fs, sp) u_long *datap, *dp; int ch_per_blk, do_again, i, nblocks, num, s; int (*strategy)__P((struct vop_strategy_args *)); + struct vop_strategy_args vop_strategy_a; char *p; #ifdef VERBOSE @@ -839,10 +831,10 @@ lfs_writesuper(fs, sp) struct lfs *fs; struct segment *sp; { - USES_VOP_STRATEGY; struct buf *bp; dev_t i_dev; int (*strategy) __P((struct vop_strategy_args *)); + struct vop_strategy_args vop_strategy_a; #ifdef VERBOSE printf("lfs_writesuper\n"); -- 2.20.1