Add KTR_VFS traces to track modifications to a vnode's writecount.
This commit is contained in:
parent
44ad547522
commit
b47f624183
@ -952,6 +952,8 @@ unionfs_vn_create_on_upper(struct vnode **vpp, struct vnode *udvp,
|
||||
goto unionfs_vn_create_on_upper_free_out1;
|
||||
}
|
||||
vp->v_writecount++;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp,
|
||||
vp->v_writecount);
|
||||
*vpp = vp;
|
||||
|
||||
unionfs_vn_create_on_upper_free_out1:
|
||||
@ -1087,6 +1089,8 @@ unionfs_copyfile(struct unionfs_node *unp, int docopy, struct ucred *cred,
|
||||
}
|
||||
VOP_CLOSE(uvp, FWRITE, cred, td);
|
||||
uvp->v_writecount--;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, uvp,
|
||||
uvp->v_writecount);
|
||||
|
||||
vn_finished_write(mp);
|
||||
|
||||
|
@ -4591,16 +4591,22 @@ sys_fhopen(td, uap)
|
||||
if (error)
|
||||
goto bad;
|
||||
|
||||
if (fmode & FWRITE)
|
||||
if (fmode & FWRITE) {
|
||||
vp->v_writecount++;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
|
||||
/*
|
||||
* end of vn_open code
|
||||
*/
|
||||
|
||||
if ((error = falloc(td, &nfp, &indx, fmode)) != 0) {
|
||||
if (fmode & FWRITE)
|
||||
if (fmode & FWRITE) {
|
||||
vp->v_writecount--;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
goto bad;
|
||||
}
|
||||
/* An extra reference on `nfp' has been held for us by falloc(). */
|
||||
|
@ -245,8 +245,11 @@ restart:
|
||||
if ((error = VOP_OPEN(vp, fmode, cred, td, fp)) != 0)
|
||||
goto bad;
|
||||
|
||||
if (fmode & FWRITE)
|
||||
if (fmode & FWRITE) {
|
||||
vp->v_writecount++;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
*flagp = fmode;
|
||||
ASSERT_VOP_LOCKED(vp, "vn_open_cred");
|
||||
if (!mpsafe)
|
||||
@ -309,6 +312,8 @@ vn_close(vp, flags, file_cred, td)
|
||||
VNASSERT(vp->v_writecount > 0, vp,
|
||||
("vn_close: negative writecount"));
|
||||
vp->v_writecount--;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
error = VOP_CLOSE(vp, flags, file_cred, td);
|
||||
vput(vp);
|
||||
|
@ -335,6 +335,8 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp,
|
||||
}
|
||||
|
||||
vp->v_writecount++;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp,
|
||||
vp->v_writecount);
|
||||
|
||||
vref(vp);
|
||||
|
||||
|
@ -272,6 +272,8 @@ vnode_pager_dealloc(object)
|
||||
if (object->un_pager.vnp.writemappings > 0) {
|
||||
object->un_pager.vnp.writemappings = 0;
|
||||
vp->v_writecount--;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
vp->v_object = NULL;
|
||||
vp->v_vflag &= ~VV_TEXT;
|
||||
@ -1241,9 +1243,13 @@ vnode_pager_update_writecount(vm_object_t object, vm_offset_t start,
|
||||
if (old_wm == 0 && object->un_pager.vnp.writemappings != 0) {
|
||||
ASSERT_VOP_ELOCKED(vp, "v_writecount inc");
|
||||
vp->v_writecount++;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
} else if (old_wm != 0 && object->un_pager.vnp.writemappings == 0) {
|
||||
ASSERT_VOP_ELOCKED(vp, "v_writecount dec");
|
||||
vp->v_writecount--;
|
||||
CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d",
|
||||
__func__, vp, vp->v_writecount);
|
||||
}
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user