125981136fb13bcacf5f475f3e0ec750341e1e671Christopher Ferris/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#ifndef _LINUX_NFS_MOUNT_H
3224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define _LINUX_NFS_MOUNT_H
4224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
5224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng/*
6224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng *  linux/include/linux/nfs_mount.h
7224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng *
8224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng *  Copyright (C) 1992  Rick Sladkey
9224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng *
10224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng *  structure passed from user-space to kernel-space during an nfs mount
11224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng */
12224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#include <linux/in.h>
13224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#include <linux/nfs.h>
14224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#include <linux/nfs2.h>
15224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#include <linux/nfs3.h>
16224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
17224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng/*
18224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng * WARNING!  Do not delete or change the order of these fields.  If
19224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng * a new field is required then add it to the end.  The version field
20224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng * tracks which fields are present.  This will ensure some measure of
21224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng * mount-to-kernel version compatibility.  Some of these aren't used yet
22224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng * but here they are anyway.
23224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng */
24224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_VERSION	6
25224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MAX_CONTEXT_LEN	256
26224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
27224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Chengstruct nfs_mount_data {
28224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		version;		/* 1 */
29224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		fd;			/* 1 */
30224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	struct nfs2_fh	old_root;		/* 1 */
31224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		flags;			/* 1 */
32224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		rsize;			/* 1 */
33224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		wsize;			/* 1 */
34224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		timeo;			/* 1 */
35224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		retrans;		/* 1 */
36224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		acregmin;		/* 1 */
37224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		acregmax;		/* 1 */
38224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		acdirmin;		/* 1 */
39224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		acdirmax;		/* 1 */
40224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	struct sockaddr_in addr;		/* 1 */
41224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	char		hostname[NFS_MAXNAMLEN + 1];		/* 1 */
42224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		namlen;			/* 2 */
43224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	unsigned int	bsize;			/* 3 */
44224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	struct nfs3_fh	root;			/* 4 */
45224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	int		pseudoflavor;		/* 5 */
46224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng	char		context[NFS_MAX_CONTEXT_LEN + 1];	/* 6 */
47224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng};
48224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
49224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng/* bits in the flags field visible to user space */
50224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
51224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_SOFT		0x0001	/* 1 */
52224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_INTR		0x0002	/* 1 */ /* now unused, but ABI */
53224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_SECURE	0x0004	/* 1 */
54224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_POSIX		0x0008	/* 1 */
55224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NOCTO		0x0010	/* 1 */
56224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NOAC		0x0020	/* 1 */
57224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_TCP		0x0040	/* 2 */
58224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_VER3		0x0080	/* 3 */
59224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_KERBEROS	0x0100	/* 3 */
60224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NONLM		0x0200	/* 3 */
61224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_BROKEN_SUID	0x0400	/* 4 */
62224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NOACL		0x0800	/* 4 */
63224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_STRICTLOCK	0x1000	/* reserved for NFSv4 */
64e084501669a4e4931c9d648351ecd7d595b81b79Christopher Ferris#define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 non-text parsed mount data only */
65224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NORDIRPLUS	0x4000	/* 5 */
66224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_UNSHARED	0x8000	/* 5 */
67224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_FLAGMASK	0xFFFF
68224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
69224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng/* The following are for internal use only */
70224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_LOOKUP_CACHE_NONEG	0x10000
71224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_LOOKUP_CACHE_NONE	0x20000
72224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_NORESVPORT		0x40000
73224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_LEGACY_INTERFACE	0x80000
74224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
75224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_LOCAL_FLOCK	0x100000
76224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#define NFS_MOUNT_LOCAL_FCNTL	0x200000
77224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng
78224b54f69543a5c0ec18f99bd717d2b724582eb6Ben Cheng#endif
79