xref: /netbsd-src/sys/miscfs/genfs/layer_vfsops.c (revision 85cb97f0d7166bb7256b3276508248f7e0318134)
1*85cb97f0Shannken /*	$NetBSD: layer_vfsops.c,v 1.56 2022/12/09 10:33:18 hannken Exp $	*/
29866514dSwrstuden 
39866514dSwrstuden /*
49866514dSwrstuden  * Copyright (c) 1999 National Aeronautics & Space Administration
59866514dSwrstuden  * All rights reserved.
69866514dSwrstuden  *
79866514dSwrstuden  * This software was written by William Studenmund of the
8fa87a209Swiz  * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
99866514dSwrstuden  *
109866514dSwrstuden  * Redistribution and use in source and binary forms, with or without
119866514dSwrstuden  * modification, are permitted provided that the following conditions
129866514dSwrstuden  * are met:
139866514dSwrstuden  * 1. Redistributions of source code must retain the above copyright
149866514dSwrstuden  *    notice, this list of conditions and the following disclaimer.
159866514dSwrstuden  * 2. Redistributions in binary form must reproduce the above copyright
169866514dSwrstuden  *    notice, this list of conditions and the following disclaimer in the
179866514dSwrstuden  *    documentation and/or other materials provided with the distribution.
1895054da1Ssoren  * 3. Neither the name of the National Aeronautics & Space Administration
199866514dSwrstuden  *    nor the names of its contributors may be used to endorse or promote
209866514dSwrstuden  *    products derived from this software without specific prior written
219866514dSwrstuden  *    permission.
229866514dSwrstuden  *
239866514dSwrstuden  * THIS SOFTWARE IS PROVIDED BY THE NATIONAL AERONAUTICS & SPACE ADMINISTRATION
249866514dSwrstuden  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
259866514dSwrstuden  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
269866514dSwrstuden  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ADMINISTRATION OR CONTRIB-
279866514dSwrstuden  * UTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
289866514dSwrstuden  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
299866514dSwrstuden  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
309866514dSwrstuden  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
319866514dSwrstuden  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
329866514dSwrstuden  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
339866514dSwrstuden  * POSSIBILITY OF SUCH DAMAGE.
349866514dSwrstuden  */
3597272194Srmind 
369866514dSwrstuden /*
379866514dSwrstuden  * Copyright (c) 1992, 1993, 1995
389866514dSwrstuden  *	The Regents of the University of California.  All rights reserved.
399866514dSwrstuden  *
409866514dSwrstuden  * This code is derived from software donated to Berkeley by
419866514dSwrstuden  * Jan-Simon Pendry.
429866514dSwrstuden  *
439866514dSwrstuden  * Redistribution and use in source and binary forms, with or without
449866514dSwrstuden  * modification, are permitted provided that the following conditions
459866514dSwrstuden  * are met:
469866514dSwrstuden  * 1. Redistributions of source code must retain the above copyright
479866514dSwrstuden  *    notice, this list of conditions and the following disclaimer.
489866514dSwrstuden  * 2. Redistributions in binary form must reproduce the above copyright
499866514dSwrstuden  *    notice, this list of conditions and the following disclaimer in the
509866514dSwrstuden  *    documentation and/or other materials provided with the distribution.
51aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
529866514dSwrstuden  *    may be used to endorse or promote products derived from this software
539866514dSwrstuden  *    without specific prior written permission.
549866514dSwrstuden  *
559866514dSwrstuden  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
569866514dSwrstuden  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
579866514dSwrstuden  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
589866514dSwrstuden  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
599866514dSwrstuden  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
609866514dSwrstuden  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
619866514dSwrstuden  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
629866514dSwrstuden  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
639866514dSwrstuden  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
649866514dSwrstuden  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
659866514dSwrstuden  * SUCH DAMAGE.
669866514dSwrstuden  *
679866514dSwrstuden  *	from: Id: lofs_vfsops.c,v 1.9 1992/05/30 10:26:24 jsp Exp
689866514dSwrstuden  *	from: @(#)lofs_vfsops.c	1.2 (Berkeley) 6/18/92
699866514dSwrstuden  *	@(#)null_vfsops.c	8.7 (Berkeley) 5/14/95
709866514dSwrstuden  */
719866514dSwrstuden 
729866514dSwrstuden /*
7397272194Srmind  * Generic layer VFS operations.
749866514dSwrstuden  */
759866514dSwrstuden 
76e4b00f43Slukem #include <sys/cdefs.h>
77*85cb97f0Shannken __KERNEL_RCSID(0, "$NetBSD: layer_vfsops.c,v 1.56 2022/12/09 10:33:18 hannken Exp $");
78e4b00f43Slukem 
799866514dSwrstuden #include <sys/param.h>
8013f8d2ceSatatat #include <sys/sysctl.h>
819866514dSwrstuden #include <sys/systm.h>
829866514dSwrstuden #include <sys/vnode.h>
839866514dSwrstuden #include <sys/mount.h>
849866514dSwrstuden #include <sys/namei.h>
85fc9422c9Selad #include <sys/kauth.h>
8649e50a21Sad #include <sys/module.h>
87fc9422c9Selad 
8855de4c18Shannken #include <miscfs/specfs/specdev.h>
89326db3aaShannken #include <miscfs/genfs/genfs.h>
909866514dSwrstuden #include <miscfs/genfs/layer.h>
919866514dSwrstuden #include <miscfs/genfs/layer_extern.h>
929866514dSwrstuden 
9377814c5eSpgoyette SYSCTL_SETUP_PROTO(sysctl_vfs_layerfs_setup);
9477814c5eSpgoyette 
9549e50a21Sad MODULE(MODULE_CLASS_MISC, layerfs, NULL);
9649e50a21Sad 
9749e50a21Sad static int
layerfs_modcmd(modcmd_t cmd,void * arg)9849e50a21Sad layerfs_modcmd(modcmd_t cmd, void *arg)
9949e50a21Sad {
10049e50a21Sad 
10149e50a21Sad 	switch (cmd) {
10249e50a21Sad 	case MODULE_CMD_INIT:
10349e50a21Sad 		return 0;
10449e50a21Sad 	case MODULE_CMD_FINI:
10549e50a21Sad 		return 0;
10649e50a21Sad 	default:
10749e50a21Sad 		return ENOTTY;
10849e50a21Sad 	}
10949e50a21Sad 	return 0;
11049e50a21Sad }
11149e50a21Sad 
1129866514dSwrstuden /*
11397272194Srmind  * VFS start.  Nothing needed here - the start routine on the underlying
11497272194Srmind  * filesystem will have been called when that filesystem was mounted.
1159866514dSwrstuden  */
1169866514dSwrstuden int
layerfs_start(struct mount * mp,int flags)11761e8303eSpooka layerfs_start(struct mount *mp, int flags)
1189866514dSwrstuden {
1199866514dSwrstuden 
1204d595fd7Schristos #ifdef notyet
121228d72edShannken 	return VFS_START(mp->mnt_lower, flags);
1224d595fd7Schristos #else
1234d595fd7Schristos 	return 0;
1244d595fd7Schristos #endif
1259866514dSwrstuden }
1269866514dSwrstuden 
1279866514dSwrstuden int
layerfs_root(struct mount * mp,int lktype,struct vnode ** vpp)128c2e9cb94Sad layerfs_root(struct mount *mp, int lktype, struct vnode **vpp)
1299866514dSwrstuden {
1309866514dSwrstuden 	struct vnode *vp;
1319866514dSwrstuden 
1329866514dSwrstuden 	vp = MOUNTTOLAYERMOUNT(mp)->layerm_rootvp;
1339866514dSwrstuden 	if (vp == NULL) {
1349866514dSwrstuden 		*vpp = NULL;
13597272194Srmind 		return EINVAL;
1369866514dSwrstuden 	}
13797272194Srmind 	/*
13897272194Srmind 	 * Return root vnode with locked and with a reference held.
13997272194Srmind 	 */
140c3183f32Spooka 	vref(vp);
141c2e9cb94Sad 	vn_lock(vp, lktype | LK_RETRY);
1429866514dSwrstuden 	*vpp = vp;
1439866514dSwrstuden 	return 0;
1449866514dSwrstuden }
1459866514dSwrstuden 
1469866514dSwrstuden int
layerfs_quotactl(struct mount * mp,struct quotactl_args * args)14759b296daSdholland layerfs_quotactl(struct mount *mp, struct quotactl_args *args)
1489866514dSwrstuden {
149*85cb97f0Shannken 	int error;
1509866514dSwrstuden 
151*85cb97f0Shannken 	error = vfs_busy(mp);
152*85cb97f0Shannken 	if (error == 0) {
153*85cb97f0Shannken 		error = VFS_QUOTACTL(mp->mnt_lower, args);
154*85cb97f0Shannken 		vfs_unbusy(mp);
155*85cb97f0Shannken 	}
156*85cb97f0Shannken 
157*85cb97f0Shannken 	return error;
1589866514dSwrstuden }
1599866514dSwrstuden 
1609866514dSwrstuden int
layerfs_statvfs(struct mount * mp,struct statvfs * sbp)161454af1c0Sdsl layerfs_statvfs(struct mount *mp, struct statvfs *sbp)
1629866514dSwrstuden {
1630444cfe5Sad 	struct statvfs *sbuf;
16497272194Srmind 	int error;
1650444cfe5Sad 
16697272194Srmind 	sbuf = kmem_zalloc(sizeof(*sbuf), KM_SLEEP);
167*85cb97f0Shannken 	error = vfs_busy(mp);
168*85cb97f0Shannken 	if (error == 0) {
169228d72edShannken 		error = VFS_STATVFS(mp->mnt_lower, sbuf);
170*85cb97f0Shannken 		vfs_unbusy(mp);
171*85cb97f0Shannken 	}
17297272194Srmind 	if (error) {
17342a255ddSchristos 		goto done;
17497272194Srmind 	}
17597272194Srmind 	/* Copy across the relevant data and fake the rest. */
17642a255ddSchristos 	sbp->f_flag = sbuf->f_flag;
17742a255ddSchristos 	sbp->f_bsize = sbuf->f_bsize;
17842a255ddSchristos 	sbp->f_frsize = sbuf->f_frsize;
17942a255ddSchristos 	sbp->f_iosize = sbuf->f_iosize;
18042a255ddSchristos 	sbp->f_blocks = sbuf->f_blocks;
18142a255ddSchristos 	sbp->f_bfree = sbuf->f_bfree;
18242a255ddSchristos 	sbp->f_bavail = sbuf->f_bavail;
18342a255ddSchristos 	sbp->f_bresvd = sbuf->f_bresvd;
18442a255ddSchristos 	sbp->f_files = sbuf->f_files;
18542a255ddSchristos 	sbp->f_ffree = sbuf->f_ffree;
18642a255ddSchristos 	sbp->f_favail = sbuf->f_favail;
18742a255ddSchristos 	sbp->f_fresvd = sbuf->f_fresvd;
18842a255ddSchristos 	sbp->f_namemax = sbuf->f_namemax;
1896bd1d6d4Schristos 	copy_statvfs_info(sbp, mp);
19042a255ddSchristos done:
1910444cfe5Sad 	kmem_free(sbuf, sizeof(*sbuf));
19242a255ddSchristos 	return error;
1939866514dSwrstuden }
1949866514dSwrstuden 
1959866514dSwrstuden int
layerfs_sync(struct mount * mp,int waitfor,kauth_cred_t cred)196168cd830Schristos layerfs_sync(struct mount *mp, int waitfor,
19761e8303eSpooka     kauth_cred_t cred)
1989866514dSwrstuden {
1999866514dSwrstuden 
2009866514dSwrstuden 	/*
2019866514dSwrstuden 	 * XXX - Assumes no data cached at layer.
2029866514dSwrstuden 	 */
20397272194Srmind 	return 0;
2049866514dSwrstuden }
2059866514dSwrstuden 
2069866514dSwrstuden int
layerfs_loadvnode(struct mount * mp,struct vnode * vp,const void * key,size_t key_len,const void ** new_key)20755de4c18Shannken layerfs_loadvnode(struct mount *mp, struct vnode *vp,
20855de4c18Shannken     const void *key, size_t key_len, const void **new_key)
20955de4c18Shannken {
21055de4c18Shannken 	struct layer_mount *lmp = MOUNTTOLAYERMOUNT(mp);
21155de4c18Shannken 	struct vnode *lowervp;
21255de4c18Shannken 	struct layer_node *xp;
21355de4c18Shannken 
21455de4c18Shannken 	KASSERT(key_len == sizeof(struct vnode *));
21555de4c18Shannken 	memcpy(&lowervp, key, key_len);
21655de4c18Shannken 
21755de4c18Shannken 	xp = kmem_alloc(lmp->layerm_size, KM_SLEEP);
21855de4c18Shannken 
21975d451f3Sthorpej 	/* Share the interlock, vmobjlock, and klist with the lower node. */
220d2a0ebb6Sad 	vshareilock(vp, lowervp);
221d2a0ebb6Sad 	rw_obj_hold(lowervp->v_uobj.vmobjlock);
222d2a0ebb6Sad 	uvm_obj_setlock(&vp->v_uobj, lowervp->v_uobj.vmobjlock);
22375d451f3Sthorpej 	vshareklist(vp, lowervp);
22455de4c18Shannken 
22555de4c18Shannken 	vp->v_tag = lmp->layerm_tag;
22655de4c18Shannken 	vp->v_type = lowervp->v_type;
22755de4c18Shannken 	vp->v_op = lmp->layerm_vnodeop_p;
22855de4c18Shannken 	if (vp->v_type == VBLK || vp->v_type == VCHR)
22955de4c18Shannken 		spec_node_init(vp, lowervp->v_rdev);
23055de4c18Shannken 	vp->v_data = xp;
23155de4c18Shannken 	xp->layer_vnode = vp;
23255de4c18Shannken 	xp->layer_lowervp = lowervp;
23355de4c18Shannken 	xp->layer_flags = 0;
23455de4c18Shannken 	uvm_vnp_setsize(vp, 0);
23555de4c18Shannken 
23655de4c18Shannken 	/*  Add a reference to the lower node. */
23755de4c18Shannken 	vref(lowervp);
23855de4c18Shannken 	*new_key = &xp->layer_lowervp;
23955de4c18Shannken 	return 0;
24055de4c18Shannken }
24155de4c18Shannken 
24255de4c18Shannken int
layerfs_vget(struct mount * mp,ino_t ino,int lktype,struct vnode ** vpp)243c2e9cb94Sad layerfs_vget(struct mount *mp, ino_t ino, int lktype, struct vnode **vpp)
2449866514dSwrstuden {
2459866514dSwrstuden 	struct vnode *vp;
24697272194Srmind 	int error;
2479866514dSwrstuden 
248*85cb97f0Shannken 	error = vfs_busy(mp);
249*85cb97f0Shannken 	if (error == 0) {
250c2e9cb94Sad 		error = VFS_VGET(mp->mnt_lower, ino, lktype, &vp);
251*85cb97f0Shannken 		vfs_unbusy(mp);
252*85cb97f0Shannken 	}
25397272194Srmind 	if (error) {
2549866514dSwrstuden 		*vpp = NULL;
25597272194Srmind 		return error;
2569866514dSwrstuden 	}
25786536158Shannken 	VOP_UNLOCK(vp);
25897272194Srmind 	error = layer_node_create(mp, vp, vpp);
25997272194Srmind 	if (error) {
26086536158Shannken 		vrele(vp);
26186536158Shannken 		*vpp = NULL;
26286536158Shannken 		return error;
26386536158Shannken 	}
264c2e9cb94Sad 	error = vn_lock(*vpp, lktype);
26586536158Shannken 	if (error) {
26686536158Shannken 		vrele(*vpp);
2679866514dSwrstuden 		*vpp = NULL;
26897272194Srmind 		return error;
2699866514dSwrstuden 	}
27097272194Srmind 	return 0;
2719866514dSwrstuden }
2729866514dSwrstuden 
2739866514dSwrstuden int
layerfs_fhtovp(struct mount * mp,struct fid * fidp,int lktype,struct vnode ** vpp)274c2e9cb94Sad layerfs_fhtovp(struct mount *mp, struct fid *fidp, int lktype,
275c2e9cb94Sad     struct vnode **vpp)
2769866514dSwrstuden {
2779866514dSwrstuden 	struct vnode *vp;
27897272194Srmind 	int error;
2799866514dSwrstuden 
280*85cb97f0Shannken 	error = vfs_busy(mp);
281*85cb97f0Shannken 	if (error == 0) {
282c2e9cb94Sad 		error = VFS_FHTOVP(mp->mnt_lower, fidp, lktype, &vp);
283*85cb97f0Shannken 		vfs_unbusy(mp);
284*85cb97f0Shannken 	}
28597272194Srmind 	if (error) {
28686536158Shannken 		*vpp = NULL;
28797272194Srmind 		return error;
28897272194Srmind 	}
28986536158Shannken 	VOP_UNLOCK(vp);
29097272194Srmind 	error = layer_node_create(mp, vp, vpp);
29197272194Srmind 	if (error) {
2929866514dSwrstuden 		vput(vp);
2939866514dSwrstuden 		*vpp = NULL;
2949866514dSwrstuden 		return (error);
2959866514dSwrstuden 	}
296c2e9cb94Sad 	error = vn_lock(*vpp, lktype);
29786536158Shannken 	if (error) {
29886536158Shannken 		vrele(*vpp);
29986536158Shannken 		*vpp = NULL;
30086536158Shannken 		return error;
30186536158Shannken 	}
30297272194Srmind 	return 0;
3039866514dSwrstuden }
3049866514dSwrstuden 
3059866514dSwrstuden int
layerfs_vptofh(struct vnode * vp,struct fid * fhp,size_t * fh_size)306454af1c0Sdsl layerfs_vptofh(struct vnode *vp, struct fid *fhp, size_t *fh_size)
3079866514dSwrstuden {
3089866514dSwrstuden 
30997272194Srmind 	return VFS_VPTOFH(LAYERVPTOLOWERVP(vp), fhp, fh_size);
3109866514dSwrstuden }
3119866514dSwrstuden 
31267a15e9aSwrstuden /*
31367a15e9aSwrstuden  * layerfs_snapshot - handle a snapshot through a layered file system
31467a15e9aSwrstuden  *
31567a15e9aSwrstuden  * At present, we do NOT support snapshotting through a layered file
31667a15e9aSwrstuden  * system as the ffs implementation changes v_vnlock of the snapshot
31767a15e9aSwrstuden  * vnodes to point to one common lock. As there is no way for us to
31867a15e9aSwrstuden  * absolutely pass this change up the stack, a layered file system
31967a15e9aSwrstuden  * would end up referencing the wrong lock.
32067a15e9aSwrstuden  *
32167a15e9aSwrstuden  * This routine serves as a central resource for this behavior; all
32267a15e9aSwrstuden  * layered file systems don't need to worry about the above. Also, if
32367a15e9aSwrstuden  * things get fixed, all layers get the benefit.
32467a15e9aSwrstuden  */
32567a15e9aSwrstuden int
layerfs_snapshot(struct mount * mp,struct vnode * vp,struct timespec * ts)326168cd830Schristos layerfs_snapshot(struct mount *mp, struct vnode *vp,
327168cd830Schristos     struct timespec *ts)
32867a15e9aSwrstuden {
32997272194Srmind 
33097272194Srmind 	return EOPNOTSUPP;
33167a15e9aSwrstuden }
33267a15e9aSwrstuden 
333326db3aaShannken /*
334326db3aaShannken  * layerfs_suspendctl - suspend a layered file system
335326db3aaShannken  *
336326db3aaShannken  * Here we should suspend the lower file system(s) too.  At present
337326db3aaShannken  * this will deadlock as we don't know which to suspend first.
338326db3aaShannken  *
339326db3aaShannken  * This routine serves as a central resource for this behavior; all
340326db3aaShannken  * layered file systems don't need to worry about the above. Also, if
341326db3aaShannken  * things get fixed, all layers get the benefit.
342326db3aaShannken  */
343326db3aaShannken int
layerfs_suspendctl(struct mount * mp,int cmd)344326db3aaShannken layerfs_suspendctl(struct mount *mp, int cmd)
345326db3aaShannken {
346326db3aaShannken 
347326db3aaShannken 	return genfs_suspendctl(mp, cmd);
348326db3aaShannken }
349326db3aaShannken 
350d0a69862Satatat SYSCTL_SETUP(sysctl_vfs_layerfs_setup, "sysctl vfs.layerfs subtree setup")
3519866514dSwrstuden {
352fbd6fe6cSerh 	const struct sysctlnode *layerfs_node = NULL;
35313f8d2ceSatatat 
354fbd6fe6cSerh 	sysctl_createv(clog, 0, NULL, &layerfs_node,
3555f373d75Spgoyette #ifdef _MODULE
3565f373d75Spgoyette 		       0,
3575f373d75Spgoyette #else
35819af35fdSatatat 		       CTLFLAG_PERMANENT,
3595f373d75Spgoyette #endif
36053c62565Satatat 		       CTLTYPE_NODE, "layerfs",
36153c62565Satatat 		       SYSCTL_DESCR("Generic layered file system"),
36213f8d2ceSatatat 		       NULL, 0, NULL, 0,
3634f6fb3bfSpooka 		       CTL_VFS, CTL_CREATE, CTL_EOL);
364fbd6fe6cSerh 
365fbd6fe6cSerh #ifdef LAYERFS_DIAGNOSTIC
366fbd6fe6cSerh 	sysctl_createv(clog, 0, &layerfs_node, NULL,
3675f373d75Spgoyette #ifndef _MODULE
3685f373d75Spgoyette 	               CTLFLAG_PERMANENT |
3695f373d75Spgoyette #endif
3705f373d75Spgoyette 		       CTLFLAG_READWRITE,
371fbd6fe6cSerh 	               CTLTYPE_INT,
372fbd6fe6cSerh 	               "debug",
373fbd6fe6cSerh 	               SYSCTL_DESCR("Verbose debugging messages"),
374fbd6fe6cSerh 	               NULL, 0, &layerfs_debug, 0,
375fbd6fe6cSerh 	               CTL_CREATE, CTL_EOL);
376fbd6fe6cSerh #endif
377fbd6fe6cSerh 
37813f8d2ceSatatat 	/*
37913f8d2ceSatatat 	 * other subtrees should really be aliases to this, but since
38013f8d2ceSatatat 	 * they can't tell if layerfs has been instantiated yet, they
38113f8d2ceSatatat 	 * can't do that...not easily.  not yet.  :-)
38213f8d2ceSatatat 	 */
3839866514dSwrstuden }
384717e1785Sdholland 
385717e1785Sdholland int
layerfs_renamelock_enter(struct mount * mp)386717e1785Sdholland layerfs_renamelock_enter(struct mount *mp)
387717e1785Sdholland {
38897272194Srmind 
389228d72edShannken 	return VFS_RENAMELOCK_ENTER(mp->mnt_lower);
390717e1785Sdholland }
391717e1785Sdholland 
392717e1785Sdholland void
layerfs_renamelock_exit(struct mount * mp)393717e1785Sdholland layerfs_renamelock_exit(struct mount *mp)
394717e1785Sdholland {
39597272194Srmind 
396228d72edShannken 	VFS_RENAMELOCK_EXIT(mp->mnt_lower);
397717e1785Sdholland }
398