xref: /titanic_41/usr/src/uts/common/nfs/mount.h (revision d2b5b2d357ee3172eacb6860be1891259902203d)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*
27  *	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
28  *		All Rights Reserved
29  */
30 
31 #ifndef	_NFS_MOUNT_H
32 #define	_NFS_MOUNT_H
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #include <sys/pathconf.h>			/* static pathconf kludge */
39 
40 
41 #define	NFS_ARGS_EXTA	1
42 #define	NFS_ARGS_EXTB	2
43 
44 /*
45  * extension data for nfs_args_ext == NFS_ARGS_EXTA.
46  */
47 struct nfs_args_extA {
48 	struct sec_data		*secdata;	/* security data */
49 };
50 
51 /*
52  * extension data for nfs_args_ext == NFS_ARGS_EXTB.
53  */
54 struct nfs_args_extB {
55 	struct sec_data		*secdata;	/* security data */
56 	struct nfs_args		*next;		/* link for failover */
57 };
58 
59 /*
60  * Union structure for future extension.
61  */
62 union nfs_ext {
63 	struct nfs_args_extA	nfs_extA;	/* nfs_args extension v1 */
64 	struct nfs_args_extB	nfs_extB;	/* nfs_args extension v2 */
65 };
66 
67 struct nfs_args {
68 	struct netbuf		*addr;		/* file server address */
69 	struct netbuf		*syncaddr;	/* secure NFS time sync addr */
70 	struct knetconfig	*knconf;	/* transport netconfig struct */
71 	char			*hostname;	/* server's hostname */
72 	char			*netname;	/* server's netname */
73 	caddr_t			fh;		/* File handle to be mounted */
74 	int			flags;		/* flags */
75 	int			wsize;		/* write size in bytes */
76 	int			rsize;		/* read size in bytes */
77 	int			timeo;		/* initial timeout in .1 secs */
78 	int			retrans;	/* times to retry send */
79 	int			acregmin;	/* attr cache file min secs */
80 	int			acregmax;	/* attr cache file max secs */
81 	int			acdirmin;	/* attr cache dir min secs */
82 	int			acdirmax;	/* attr cache dir max secs */
83 	struct pathcnf		*pathconf;	/* static pathconf kludge */
84 	int			nfs_args_ext;	/* the nfs_args extension id */
85 	union nfs_ext		nfs_ext_u;	/* extension union structure */
86 };
87 
88 #ifdef _SYSCALL32
89 struct nfs_args_extA32 {
90 	caddr32_t		secdata;	/* security data */
91 };
92 
93 struct nfs_args_extB32 {
94 	caddr32_t		secdata;	/* security data */
95 	caddr32_t		next;		/* link for failover */
96 };
97 
98 union nfs_ext32 {
99 	struct nfs_args_extA32	nfs_extA;	/* nfs_args extension v1 */
100 	struct nfs_args_extB32	nfs_extB;	/* nfs_args extension v2 */
101 };
102 
103 struct nfs_args32 {
104 	caddr32_t		addr;		/* file server address */
105 	caddr32_t		syncaddr;	/* secure NFS time sync addr */
106 	caddr32_t		knconf;		/* transport netconfig struct */
107 	caddr32_t		hostname;	/* server's hostname */
108 	caddr32_t		netname;	/* server's netname */
109 	caddr32_t		fh;		/* File handle to be mounted */
110 	int32_t			flags;		/* flags */
111 	int32_t			wsize;		/* write size in bytes */
112 	int32_t			rsize;		/* read size in bytes */
113 	int32_t			timeo;		/* initial timeout in .1 secs */
114 	int32_t			retrans;	/* times to retry send */
115 	int32_t			acregmin;	/* attr cache file min secs */
116 	int32_t			acregmax;	/* attr cache file max secs */
117 	int32_t			acdirmin;	/* attr cache dir min secs */
118 	int32_t			acdirmax;	/* attr cache dir max secs */
119 	caddr32_t		pathconf;	/* static pathconf kludge */
120 	int32_t			nfs_args_ext;	/* the nfs_args extension id */
121 	union nfs_ext32		nfs_ext_u;	/* extension union structure */
122 };
123 #endif /* _SYSCALL32 */
124 
125 /*
126  * NFS mount option flags
127  */
128 #define	NFSMNT_SOFT		0x001	/* soft mount (hard is default) */
129 #define	NFSMNT_WSIZE		0x002	/* set write size */
130 #define	NFSMNT_RSIZE		0x004	/* set read size */
131 #define	NFSMNT_TIMEO		0x008	/* set initial timeout */
132 #define	NFSMNT_RETRANS		0x010	/* set number of request retrys */
133 #define	NFSMNT_HOSTNAME		0x020	/* set hostname for error printf */
134 #define	NFSMNT_INT		0x040	/* allow interrupts on hard mount */
135 #define	NFSMNT_NOAC		0x080	/* don't cache attributes */
136 #define	NFSMNT_ACREGMIN		0x0100	/* set min secs for file attr cache */
137 #define	NFSMNT_ACREGMAX		0x0200	/* set max secs for file attr cache */
138 #define	NFSMNT_ACDIRMIN		0x0400	/* set min secs for dir attr cache */
139 #define	NFSMNT_ACDIRMAX		0x0800	/* set max secs for dir attr cache */
140 #define	NFSMNT_SECURE		0x1000	/* secure mount */
141 #define	NFSMNT_NOCTO		0x2000	/* no close-to-open consistency */
142 #define	NFSMNT_KNCONF		0x4000	/* transport's knetconfig structure */
143 #define	NFSMNT_GRPID		0x8000	/* System V-style gid inheritance */
144 #define	NFSMNT_RPCTIMESYNC	0x10000	/* use RPC to do secure NFS time sync */
145 #define	NFSMNT_KERBEROS		0x20000	/* use kerberos credentials */
146 #define	NFSMNT_POSIX		0x40000 /* static pathconf kludge info */
147 #define	NFSMNT_LLOCK		0x80000	/* Local locking (no lock manager) */
148 #define	NFSMNT_LOOPBACK		0x100000 /* Is a loopback mount */
149 #define	NFSMNT_SEMISOFT		0x200000 /* read soft, modify hard */
150 #define	NFSMNT_NOPRINT		0x400000 /* don't print messages */
151 #define	NFSMNT_NEWARGS		0x800000 /* using nfs_args extented structure */
152 #define	NFSMNT_DIRECTIO		0x1000000 /* do direct I/O */
153 #define	NFSMNT_PUBLIC		0x2000000 /* mount was done with url/public */
154 #define	NFSMNT_SECDEFAULT	0x4000000 /* mount using default sec flavor */
155 #define	NFSMNT_TRYRDMA		0x8000000 /* Try RDMA mount,no proto advised */
156 #define	NFSMNT_DORDMA		0x10000000 /* Do an RDMA mount, regardless */
157 #define	NFSMNT_MIRRORMOUNT	0x20000000 /* Is a mirrormount */
158 #define	NFSMNT_REFERRAL		0x40000000 /* Is a referral */
159 
160 #define	NFSMNT_EPHEMERAL	(NFSMNT_MIRRORMOUNT | NFSMNT_REFERRAL)
161 
162 #ifdef	__cplusplus
163 }
164 #endif
165 
166 #endif	/* _NFS_MOUNT_H */
167