aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2022-01-27 16:24:32 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2022-01-27 16:32:22 +0000
commit2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc (patch)
treeaccf33bb25e008bbf905bc512dd23e1e1cf0d96c /sys/kern/vfs_subr.c
parent8a7404b2aeeb6345bd82c13c432e56d8cbfba869 (diff)
downloadsrc-2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc.tar.gz
src-2a7e4cf84311c9ec6cc5366d24fadfb188e6ccdc.zip
Revert b58ca5df0bb7 ("vfs: remove the now unused insmntque1")
I was somehow convinced that insmntque calls insmntque1 with a NULL destructor. Unfortunately this worked well enough to not immediately blow up in simple testing. Keep not using the destructor in previously patched filesystems though as it avoids unnecessary casts. Noted by: kib Reported by: pho
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index a29f64fddd34..3218a3f7b6a0 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1948,7 +1948,8 @@ insmntque_stddtr(struct vnode *vp, void *dtr_arg)
* Insert into list of vnodes for the new mount point, if available.
*/
int
-insmntque(struct vnode *vp, struct mount *mp)
+insmntque1(struct vnode *vp, struct mount *mp,
+ void (*dtr)(struct vnode *, void *), void *dtr_arg)
{
KASSERT(vp->v_mount == NULL,
@@ -1973,6 +1974,8 @@ insmntque(struct vnode *vp, struct mount *mp)
(vp->v_vflag & VV_FORCEINSMQ) == 0) {
VI_UNLOCK(vp);
MNT_IUNLOCK(mp);
+ if (dtr != NULL)
+ dtr(vp, dtr_arg);
return (EBUSY);
}
vp->v_mount = mp;
@@ -1986,6 +1989,13 @@ insmntque(struct vnode *vp, struct mount *mp)
return (0);
}
+int
+insmntque(struct vnode *vp, struct mount *mp)
+{
+
+ return (insmntque1(vp, mp, insmntque_stddtr, NULL));
+}
+
/*
* Flush out and invalidate all buffers associated with a bufobj
* Called with the underlying object locked.