Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144644188
D44172.1775995247.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44172.1775995247.diff
View Options
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -3332,6 +3332,8 @@
vget_finish_ref(struct vnode *vp, enum vgetstate vs)
{
int old;
+ struct mount *mp;
+ uint64_t *fsvninusep;
VNPASS(vs == VGET_HOLDCNT || vs == VGET_USECOUNT, vp);
VNPASS(vp->v_holdcnt > 0, vp);
@@ -3354,6 +3356,13 @@
#else
refcount_release(&vp->v_holdcnt);
#endif
+ } else {
+ mp = vp->v_mount;
+ if (NULL != mp) {
+ fsvninusep = mp->mnt_fsvninusep;
+ if (NULL != fsvninusep)
+ atomic_add_rel_64(fsvninusep, 1);
+ }
}
}
@@ -3515,10 +3524,23 @@
{
int error;
bool want_unlock;
+ struct mount *mp;
+ uint64_t *fsvninusep;
CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
VNPASS(vp->v_holdcnt > 0, vp);
+ mp = vp->v_mount;
+ /*
+ * The filesystem-local in-use vnode count is not incremented if
+ * insmntque() fails. vp->v_data is set to NULL in such the case.
+ */
+ if ((NULL != mp) && (NULL != vp->v_data)) {
+ fsvninusep = mp->mnt_fsvninusep;
+ if (NULL != fsvninusep)
+ atomic_subtract_rel_64(fsvninusep, 1);
+ }
+
VI_LOCK(vp);
/*
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -239,6 +239,7 @@
int mnt_secondary_writes; /* (i) # of secondary writes */
int mnt_secondary_accwrites;/* (i) secondary wr. starts */
struct thread *mnt_susp_owner; /* (i) thread owning suspension */
+ uint64_t *mnt_fsvninusep; /* per-filesystem count of vnodes in use */
#define mnt_endzero mnt_gjprovider
char *mnt_gjprovider; /* gjournal provider name */
struct mtx mnt_listmtx;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 12:00 PM (12 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28331004
Default Alt Text
D44172.1775995247.diff (1 KB)
Attached To
Mode
D44172: kern/vfs: Add the per-filesystem vnode counter to struct mount. (stable/13)
Attached
Detach File
Event Timeline
Log In to Comment