summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-14 08:30:31 +0000
committerjeff <jeff@FreeBSD.org>2005-03-14 08:30:31 +0000
commit2a81e8df21b1d63b9464460805910362704b6076 (patch)
tree798938c84ee866f3a8a1275bb099c20c3f9452d9 /sys/kern/vfs_subr.c
parentdffc7fe63f1548c4020403c09673174369621036 (diff)
downloadFreeBSD-src-2a81e8df21b1d63b9464460805910362704b6076.zip
FreeBSD-src-2a81e8df21b1d63b9464460805910362704b6076.tar.gz
- We do not have to check the object's ref_count in VSHOULDFREE or
vtryrecycle(). All obj refs also ref the vnode. - Consistently use v_incr_usecount() to increment the usecount. This will be more important later. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index fa0a62e..97a52e4 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -92,6 +92,7 @@ static void vbusy(struct vnode *vp);
static void vdropl(struct vnode *vp);
static void vholdl(struct vnode *);
static void vinactive(struct vnode *, struct thread *);
+static void v_incr_usecount(struct vnode *, int);
/*
* Enable Giant pushdown based on whether or not the vm is mpsafe in this
@@ -683,8 +684,7 @@ vtryrecycle(struct vnode *vp)
object = vp->v_object;
if (object != NULL) {
VM_OBJECT_LOCK(object);
- if (object->resident_page_count ||
- object->ref_count) {
+ if (object->resident_page_count) {
VM_OBJECT_UNLOCK(object);
error = EBUSY;
goto done;
@@ -893,7 +893,7 @@ getnewvnode(tag, mp, vops, vpp)
vp->v_tag = tag;
vp->v_op = vops;
*vpp = vp;
- vp->v_usecount = 1;
+ v_incr_usecount(vp, 1);
vp->v_data = 0;
if (pollinfo != NULL) {
knlist_destroy(&pollinfo->vpi_selinfo.si_note);
OpenPOWER on IntegriCloud