aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2005-03-13 11:44:02 +0000
committerJeff Roberson <jeff@FreeBSD.org>2005-03-13 11:44:02 +0000
commit5e7475a329a1ffc7c36cc67cdc788b4e199b3815 (patch)
tree48499373a3ecb93c54eeaffe7f3e18421445a0c6
parent4e6746965e14c0c0d60066ceaa0f056a8e4acf92 (diff)
downloadsrc-5e7475a329a1ffc7c36cc67cdc788b4e199b3815.tar.gz
src-5e7475a329a1ffc7c36cc67cdc788b4e199b3815.zip
- Get rid of VXLOCK, VXWANT, and vx_*. The vnode lock now protects us
against recycling. - Modify VSHOULDFREE, VCANRECYCLE, etc. now that certain flags are no longer important. Remove VMIGHTFREE as it is only used in one place. Sponsored by: Isilon Systems, Inc.
Notes
Notes: svn path=/head/; revision=143493
-rw-r--r--sys/sys/vnode.h31
1 files changed, 10 insertions, 21 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 927983888790..72744cdebeb0 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -96,7 +96,7 @@ struct vpollinfo {
* 2) Lock interlock so that the vnode does not go away.
* 3) Unlock the list to avoid lock order reversals.
* 4) vget with LK_INTERLOCK and check for ENOENT, or
- * 5) Check for XLOCK if the vnode lock is not required.
+ * 5) Check for DOOMED if the vnode lock is not required.
* 6) Perform your operation, then vput().
*
* XXX Not all fields are locked yet and some fields that are marked are not
@@ -161,7 +161,7 @@ struct vnode {
#endif
int v_holdcnt; /* i page & buffer references */
int v_usecount; /* i ref count of users */
- struct thread *v_vxthread; /* i thread owning VXLOCK */
+ struct thread *v_vxthread; /* i thread running vgone. */
u_long v_iflag; /* i vnode flags (see below) */
u_long v_vflag; /* v vnode flags */
int v_writecount; /* v ref count of writers */
@@ -232,8 +232,6 @@ struct xvnode {
* VI flags are protected by interlock and live in v_iflag
* VV flags are protected by the vnode lock and live in v_vflag
*/
-#define VI_XLOCK 0x0001 /* vnode is locked to change vtype */
-#define VI_XWANT 0x0002 /* thread is waiting for vnode */
#define VI_OLOCK 0x0008 /* vnode is locked waiting for an object */
#define VI_OWANT 0x0010 /* a thread is waiting for VOLOCK */
#define VI_MOUNT 0x0020 /* Mount in progress */
@@ -390,26 +388,20 @@ 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) && \
+#define VCANRECYCLE(vp) \
+ (((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 && \
- (!(vp)->v_object || \
+#define VSHOULDFREE(vp) \
+ (!((vp)->v_iflag & VI_FREE) && \
+ !(vp)->v_holdcnt && !(vp)->v_usecount && \
+ (!(vp)->v_object || \
!((vp)->v_object->ref_count || (vp)->v_object->resident_page_count)))
/* Requires interlock. */
-#define VMIGHTFREE(vp) \
- (!((vp)->v_iflag & (VI_FREE|VI_DOOMED|VI_XLOCK|VI_DOINGINACT)) && \
- LIST_EMPTY(&(vp)->v_cache_src) && !(vp)->v_usecount)
-
-/* Requires interlock. */
-#define VSHOULDBUSY(vp) \
- (((vp)->v_iflag & VI_FREE) && \
+#define VSHOULDBUSY(vp) \
+ (((vp)->v_iflag & VI_FREE) && \
((vp)->v_holdcnt || (vp)->v_usecount))
#define VI_LOCK(vp) mtx_lock(&(vp)->v_interlock)
@@ -699,9 +691,6 @@ void vref(struct vnode *vp);
int vrefcnt(struct vnode *vp);
void v_addpollinfo(struct vnode *vp);
-int vx_wait(struct vnode *vp);
-int vx_waitl(struct vnode *vp);
-
int vnode_create_vobject(struct vnode *vp, size_t size, struct thread *td);
void vnode_destroy_vobject(struct vnode *vp);