summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-01-24 10:34:58 +0000
committerjeff <jeff@FreeBSD.org>2005-01-24 10:34:58 +0000
commitc4b1649eba5ac789bffb29c1d165cf44811ad8b8 (patch)
treeb2eb05fb0cb2f148bb4589db7f3f8fbabc22133f
parente5940f4bef093ba765110a2d40d0bfc1281dedb5 (diff)
downloadFreeBSD-src-c4b1649eba5ac789bffb29c1d165cf44811ad8b8.zip
FreeBSD-src-c4b1649eba5ac789bffb29c1d165cf44811ad8b8.tar.gz
- Add a VCANRECYCLE() which performs all the checks required to ensure
that we are free to release a vnode.
-rw-r--r--sys/sys/vnode.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 0c17253..dc9f67c 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -369,6 +369,12 @@ extern struct vattr va_null; /* predefined null vattr structure */
extern void (*lease_updatetime)(int deltat);
/* Requires interlock. */
+#define VCANRECYCLE(vp) \
+ (!((vp)->v_iflag & (VI_DOOMED|VI_DOINGINACT|VI_XLOCK)) && \
+ ((vp)->v_iflag & VI_FREE) && \
+ !(vp)->v_holdcnt && !(vp)->v_usecount)
+
+/* Requires interlock. */
#define VSHOULDFREE(vp) \
(!((vp)->v_iflag & (VI_FREE|VI_DOOMED|VI_DOINGINACT)) && \
!(vp)->v_holdcnt && !(vp)->v_usecount && \
OpenPOWER on IntegriCloud