Deleted Added
full compact
null_vfsops.c (231269) null_vfsops.c (232059)
1/*-
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
33 *
34 * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
1/*-
2 * Copyright (c) 1992, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @(#)null_vfsops.c 8.2 (Berkeley) 1/21/94
33 *
34 * @(#)lofs_vfsops.c 1.2 (Berkeley) 6/18/92
35 * $FreeBSD: head/sys/fs/nullfs/null_vfsops.c 231269 2012-02-09 10:39:01Z mm $
35 * $FreeBSD: head/sys/fs/nullfs/null_vfsops.c 232059 2012-02-23 18:51:24Z mm $
36 */
37
38/*
39 * Null Layer
40 * (See null_vnops.c for a description of what this does.)
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/fcntl.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/malloc.h>
49#include <sys/mount.h>
50#include <sys/namei.h>
51#include <sys/proc.h>
52#include <sys/vnode.h>
36 */
37
38/*
39 * Null Layer
40 * (See null_vnops.c for a description of what this does.)
41 */
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/fcntl.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/malloc.h>
49#include <sys/mount.h>
50#include <sys/namei.h>
51#include <sys/proc.h>
52#include <sys/vnode.h>
53#include <sys/jail.h>
53
54#include <fs/nullfs/null.h>
55
56static MALLOC_DEFINE(M_NULLFSMNT, "nullfs_mount", "NULLFS mount structure");
57
58static vfs_fhtovp_t nullfs_fhtovp;
59static vfs_mount_t nullfs_mount;
60static vfs_quotactl_t nullfs_quotactl;

--- 9 unchanged lines hidden (view full) ---

70 */
71static int
72nullfs_mount(struct mount *mp)
73{
74 int error = 0;
75 struct vnode *lowerrootvp, *vp;
76 struct vnode *nullm_rootvp;
77 struct null_mount *xmp;
54
55#include <fs/nullfs/null.h>
56
57static MALLOC_DEFINE(M_NULLFSMNT, "nullfs_mount", "NULLFS mount structure");
58
59static vfs_fhtovp_t nullfs_fhtovp;
60static vfs_mount_t nullfs_mount;
61static vfs_quotactl_t nullfs_quotactl;

--- 9 unchanged lines hidden (view full) ---

71 */
72static int
73nullfs_mount(struct mount *mp)
74{
75 int error = 0;
76 struct vnode *lowerrootvp, *vp;
77 struct vnode *nullm_rootvp;
78 struct null_mount *xmp;
79 struct thread *td = curthread;
78 char *target;
79 int isvnunlocked = 0, len;
80 struct nameidata nd, *ndp = &nd;
81
82 NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp);
83
80 char *target;
81 int isvnunlocked = 0, len;
82 struct nameidata nd, *ndp = &nd;
83
84 NULLFSDEBUG("nullfs_mount(mp = %p)\n", (void *)mp);
85
86 if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_NULLFS))
87 return (EPERM);
88
84 if (mp->mnt_flag & MNT_ROOTFS)
85 return (EOPNOTSUPP);
86 /*
87 * Update is a no-op
88 */
89 if (mp->mnt_flag & MNT_UPDATE) {
90 /*
91 * Only support update mounts for NFS export.

--- 269 unchanged lines hidden ---
89 if (mp->mnt_flag & MNT_ROOTFS)
90 return (EOPNOTSUPP);
91 /*
92 * Update is a no-op
93 */
94 if (mp->mnt_flag & MNT_UPDATE) {
95 /*
96 * Only support update mounts for NFS export.

--- 269 unchanged lines hidden ---