Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161407377
D21371.id61430.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D21371.id61430.diff
View Options
Index: head/sys/fs/nullfs/null_vnops.c
===================================================================
--- head/sys/fs/nullfs/null_vnops.c
+++ head/sys/fs/nullfs/null_vnops.c
@@ -907,6 +907,7 @@
.vop_getattr = null_getattr,
.vop_getwritemount = null_getwritemount,
.vop_inactive = null_inactive,
+ .vop_need_inactive = vop_stdneed_inactive,
.vop_islocked = vop_stdislocked,
.vop_lock1 = null_lock,
.vop_lookup = null_lookup,
Index: head/sys/fs/unionfs/union_vnops.c
===================================================================
--- head/sys/fs/unionfs/union_vnops.c
+++ head/sys/fs/unionfs/union_vnops.c
@@ -2523,6 +2523,7 @@
.vop_getextattr = unionfs_getextattr,
.vop_getwritemount = unionfs_getwritemount,
.vop_inactive = unionfs_inactive,
+ .vop_need_inactive = vop_stdneed_inactive,
.vop_islocked = unionfs_islocked,
.vop_ioctl = unionfs_ioctl,
.vop_link = unionfs_link,
Index: head/sys/kern/vfs_default.c
===================================================================
--- head/sys/kern/vfs_default.c
+++ head/sys/kern/vfs_default.c
@@ -120,6 +120,7 @@
.vop_getpages_async = vop_stdgetpages_async,
.vop_getwritemount = vop_stdgetwritemount,
.vop_inactive = VOP_NULL,
+ .vop_need_inactive = vop_stdneed_inactive,
.vop_ioctl = vop_stdioctl,
.vop_kqfilter = vop_stdkqfilter,
.vop_islocked = vop_stdislocked,
@@ -1155,6 +1156,13 @@
}
VI_UNLOCK(vp);
return (error);
+}
+
+int
+vop_stdneed_inactive(struct vop_need_inactive_args *ap)
+{
+
+ return (1);
}
static int
Index: head/sys/kern/vfs_subr.c
===================================================================
--- head/sys/kern/vfs_subr.c
+++ head/sys/kern/vfs_subr.c
@@ -2891,6 +2891,21 @@
CTR2(KTR_VFS, "%s: return vnode %p to the freelist", __func__, vp);
/*
+ * Check if the fs wants to perform inactive processing. Note we
+ * may be only holding the interlock, in which case it is possible
+ * someone else called vgone on the vnode and ->v_data is now NULL.
+ * Since vgone performs inactive on its own there is nothing to do
+ * here but to drop our hold count.
+ */
+ if (__predict_false(vp->v_iflag & VI_DOOMED) ||
+ VOP_NEED_INACTIVE(vp) == 0) {
+ if (func == VPUTX_VPUT)
+ VOP_UNLOCK(vp, 0);
+ vdropl(vp);
+ return;
+ }
+
+ /*
* We must call VOP_INACTIVE with the node locked. Mark
* as VI_DOINGINACT to avoid recursion.
*/
@@ -4353,6 +4368,7 @@
.vop_close = sync_close, /* close */
.vop_fsync = sync_fsync, /* fsync */
.vop_inactive = sync_inactive, /* inactive */
+ .vop_need_inactive = vop_stdneed_inactive, /* need_inactive */
.vop_reclaim = sync_reclaim, /* reclaim */
.vop_lock1 = vop_stdlock, /* lock */
.vop_unlock = vop_stdunlock, /* unlock */
@@ -4514,6 +4530,20 @@
return (0);
}
+int
+vn_need_pageq_flush(struct vnode *vp)
+{
+ struct vm_object *obj;
+ int need;
+
+ MPASS(mtx_owned(VI_MTX(vp)));
+ need = 0;
+ if ((obj = vp->v_object) != NULL && (vp->v_vflag & VV_NOSYNC) == 0 &&
+ (obj->flags & OBJ_MIGHTBEDIRTY) != 0)
+ need = 1;
+ return (need);
+}
+
/*
* Check if vnode represents a disk device
*/
@@ -4893,6 +4923,22 @@
if (a->a_flags & LK_INTERLOCK)
ASSERT_VI_UNLOCKED(a->a_vp, "VOP_UNLOCK");
+}
+
+void
+vop_need_inactive_pre(void *ap)
+{
+ struct vop_need_inactive_args *a = ap;
+
+ ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE");
+}
+
+void
+vop_need_inactive_post(void *ap, int rc)
+{
+ struct vop_need_inactive_args *a = ap;
+
+ ASSERT_VI_LOCKED(a->a_vp, "VOP_NEED_INACTIVE");
}
#endif
Index: head/sys/kern/vnode_if.src
===================================================================
--- head/sys/kern/vnode_if.src
+++ head/sys/kern/vnode_if.src
@@ -358,6 +358,12 @@
IN struct thread *td;
};
+%! need_inactive pre vop_need_inactive_pre
+%! need_inactive post vop_need_inactive_post
+
+vop_need_inactive {
+ IN struct vnode *vp;
+};
%% reclaim vp E E E
%! reclaim post vop_reclaim_post
Index: head/sys/sys/vnode.h
===================================================================
--- head/sys/sys/vnode.h
+++ head/sys/sys/vnode.h
@@ -682,6 +682,7 @@
struct vnode *outvp, off_t *outoffp, size_t *lenp,
unsigned int flags, struct ucred *incred, struct ucred *outcred,
struct thread *fsize_td);
+int vn_need_pageq_flush(struct vnode *vp);
int vn_isdisk(struct vnode *vp, int *errp);
int _vn_lock(struct vnode *vp, int flags, char *file, int line);
#define vn_lock(vp, flags) _vn_lock(vp, flags, __FILE__, __LINE__)
@@ -753,6 +754,7 @@
int vop_stdgetwritemount(struct vop_getwritemount_args *);
int vop_stdgetpages(struct vop_getpages_args *);
int vop_stdinactive(struct vop_inactive_args *);
+int vop_stdneed_inactive(struct vop_need_inactive_args *);
int vop_stdislocked(struct vop_islocked_args *);
int vop_stdkqfilter(struct vop_kqfilter_args *);
int vop_stdlock(struct vop_lock1_args *);
@@ -813,12 +815,16 @@
void vop_lock_post(void *a, int rc);
void vop_unlock_pre(void *a);
void vop_unlock_post(void *a, int rc);
+void vop_need_inactive_pre(void *a);
+void vop_need_inactive_post(void *a, int rc);
#else
#define vop_strategy_pre(x) do { } while (0)
#define vop_lock_pre(x) do { } while (0)
#define vop_lock_post(x, y) do { } while (0)
#define vop_unlock_pre(x) do { } while (0)
#define vop_unlock_post(x, y) do { } while (0)
+#define vop_need_inactive_pre(x) do { } while (0)
+#define vop_need_inactive_post(x, y) do { } while (0)
#endif
void vop_rename_fail(struct vop_rename_args *ap);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 4, 12:18 PM (5 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34668628
Default Alt Text
D21371.id61430.diff (5 KB)
Attached To
Mode
D21371: vfs: add VOP_NEED_INACTIVE
Attached
Detach File
Event Timeline
Log In to Comment