From f7e588347b3192f4351b4e27c498cc085021b6e4 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 25 Sep 2002 02:32:42 +0000 Subject: - Use vrefcnt() where it is safe to do so instead of doing direct and unlocked accesses to v_usecount. - Lock access to the buf lists in the various sync routines. interlock locking could be avoided almost entirely in leaf filesystems if the fsync function had a generic helper. --- sys/fs/nullfs/null_subr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/fs/nullfs') diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index fd8d9be..1fdd210 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -321,7 +321,7 @@ null_checkvp(vp, fil, lno) while (null_checkvp_barrier) /*WAIT*/ ; panic("null_checkvp"); } - if (a->null_lowervp->v_usecount < 1) { + if (vrefcnt(a->null_lowervp) < 1) { int i; u_long *p; printf("vp = %p, unref'ed lowervp\n", (void *)vp); for (p = (u_long *) a, i = 0; i < 8; i++) @@ -333,8 +333,8 @@ null_checkvp(vp, fil, lno) }; #ifdef notyet printf("null %x/%d -> %x/%d [%s, %d]\n", - NULLTOV(a), NULLTOV(a)->v_usecount, - a->null_lowervp, a->null_lowervp->v_usecount, + NULLTOV(a), vrefcnt(NULLTOV(a)), + a->null_lowervp, vrefcnt(a->null_lowervp), fil, lno); #endif return a->null_lowervp; -- cgit v1.1