diff options
author | jeff <jeff@FreeBSD.org> | 2005-03-14 09:25:19 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-03-14 09:25:19 +0000 |
commit | 3fcb9112fb1915c98e275295e779c38aa7a0b32a (patch) | |
tree | 041dcebf7b2395ea0b4fe4cc8d7d94cafcae0642 /sys/sys/vnode.h | |
parent | 41fb0028e9c567d939d26775ff018fa6d249aaff (diff) | |
download | FreeBSD-src-3fcb9112fb1915c98e275295e779c38aa7a0b32a.zip FreeBSD-src-3fcb9112fb1915c98e275295e779c38aa7a0b32a.tar.gz |
- Increment the holdcnt once for each usecount reference. This allows us
to use only the holdcnt to determine whether a vnode may be recycled,
simplifying the V* macros as well as vtryrecycle(), etc.
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/sys/vnode.h')
-rw-r--r-- | sys/sys/vnode.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 19bf36c..b99a766 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -159,7 +159,7 @@ struct vnode { const char *filename; /* Source file doing locking */ int line; /* Line number doing locking */ #endif - int v_holdcnt; /* i page & buffer references */ + int v_holdcnt; /* i prevents recycling. */ int v_usecount; /* i ref count of users */ struct thread *v_vxthread; /* i thread running vgone. */ u_long v_iflag; /* i vnode flags (see below) */ @@ -387,20 +387,16 @@ extern void (*lease_updatetime)(int deltat); /* Requires interlock. */ #define VCANRECYCLE(vp) \ - (((vp)->v_iflag & VI_FREE) && \ - !(vp)->v_holdcnt && !(vp)->v_usecount) + (((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt) /* Requires interlock. */ #define VSHOULDFREE(vp) \ - (!((vp)->v_iflag & VI_FREE) && \ - !(vp)->v_holdcnt && !(vp)->v_usecount && \ - (!(vp)->v_object || \ - !(vp)->v_object->resident_page_count)) + (!((vp)->v_iflag & VI_FREE) && !(vp)->v_holdcnt && \ + (!(vp)->v_object || !(vp)->v_object->resident_page_count)) /* Requires interlock. */ #define VSHOULDBUSY(vp) \ - (((vp)->v_iflag & VI_FREE) && \ - ((vp)->v_holdcnt || (vp)->v_usecount)) + (((vp)->v_iflag & VI_FREE) && (vp)->v_holdcnt) #define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock) #define VI_TRYLOCK(vp) mtx_trylock(&(vp)->v_interlock) |