| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _LINUX_NFS_XDR_H | 
 | 2 | #define _LINUX_NFS_XDR_H | 
 | 3 |  | 
| Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 4 | #include <linux/nfsacl.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 |  | 
| Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 6 | /* | 
 | 7 |  * To change the maximum rsize and wsize supported by the NFS client, adjust | 
 | 8 |  * NFS_MAX_FILE_IO_SIZE.  64KB is a typical maximum, but some servers can | 
 | 9 |  * support a megabyte or more.  The default is left at 4096 bytes, which is | 
 | 10 |  * reasonable for NFS over UDP. | 
 | 11 |  */ | 
 | 12 | #define NFS_MAX_FILE_IO_SIZE	(1048576U) | 
 | 13 | #define NFS_DEF_FILE_IO_SIZE	(4096U) | 
 | 14 | #define NFS_MIN_FILE_IO_SIZE	(1024U) | 
 | 15 |  | 
| Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 16 | struct nfs_fsid { | 
 | 17 | 	uint64_t		major; | 
 | 18 | 	uint64_t		minor; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | }; | 
 | 20 |  | 
| Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 21 | /* | 
 | 22 |  * Helper for checking equality between 2 fsids. | 
 | 23 |  */ | 
 | 24 | static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b) | 
 | 25 | { | 
 | 26 | 	return a->major == b->major && a->minor == b->minor; | 
 | 27 | } | 
 | 28 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | struct nfs_fattr { | 
 | 30 | 	unsigned short		valid;		/* which fields are valid */ | 
 | 31 | 	__u64			pre_size;	/* pre_op_attr.size	  */ | 
 | 32 | 	struct timespec		pre_mtime;	/* pre_op_attr.mtime	  */ | 
 | 33 | 	struct timespec		pre_ctime;	/* pre_op_attr.ctime	  */ | 
 | 34 | 	enum nfs_ftype		type;		/* always use NFSv2 types */ | 
 | 35 | 	__u32			mode; | 
 | 36 | 	__u32			nlink; | 
 | 37 | 	__u32			uid; | 
 | 38 | 	__u32			gid; | 
| Richard Kennedy | 9fa8d66 | 2008-08-26 16:23:20 +0100 | [diff] [blame] | 39 | 	dev_t			rdev; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | 	__u64			size; | 
 | 41 | 	union { | 
 | 42 | 		struct { | 
 | 43 | 			__u32	blocksize; | 
 | 44 | 			__u32	blocks; | 
 | 45 | 		} nfs2; | 
 | 46 | 		struct { | 
 | 47 | 			__u64	used; | 
 | 48 | 		} nfs3; | 
 | 49 | 	} du; | 
| Trond Myklebust | 8b4bdcf | 2006-06-09 09:34:19 -0400 | [diff] [blame] | 50 | 	struct nfs_fsid		fsid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | 	__u64			fileid; | 
 | 52 | 	struct timespec		atime; | 
 | 53 | 	struct timespec		mtime; | 
 | 54 | 	struct timespec		ctime; | 
 | 55 | 	__u32			bitmap[2];	/* NFSv4 returned attribute bitmap */ | 
 | 56 | 	__u64			change_attr;	/* NFSv4 change attribute */ | 
 | 57 | 	__u64			pre_change_attr;/* pre-op NFSv4 change attribute */ | 
| Trond Myklebust | 3380114 | 2005-10-27 22:12:39 -0400 | [diff] [blame] | 58 | 	unsigned long		time_start; | 
| Trond Myklebust | 4704f0e | 2008-10-14 19:16:07 -0400 | [diff] [blame] | 59 | 	unsigned long		gencount; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | }; | 
 | 61 |  | 
 | 62 | #define NFS_ATTR_WCC		0x0001		/* pre-op WCC data    */ | 
 | 63 | #define NFS_ATTR_FATTR		0x0002		/* post-op attributes */ | 
 | 64 | #define NFS_ATTR_FATTR_V3	0x0004		/* NFSv3 attributes */ | 
| Trond Myklebust | 73a3d07 | 2006-05-25 01:40:47 -0400 | [diff] [blame] | 65 | #define NFS_ATTR_FATTR_V4	0x0008		/* NFSv4 change attribute */ | 
| Trond Myklebust | 70ca885 | 2007-09-30 15:21:24 -0400 | [diff] [blame] | 66 | #define NFS_ATTR_WCC_V4		0x0010		/* pre-op change attribute */ | 
 | 67 | #define NFS_ATTR_FATTR_V4_REFERRAL	0x0020		/* NFSv4 referral */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 |  | 
 | 69 | /* | 
 | 70 |  * Info on the file system | 
 | 71 |  */ | 
 | 72 | struct nfs_fsinfo { | 
 | 73 | 	struct nfs_fattr	*fattr; /* Post-op attributes */ | 
 | 74 | 	__u32			rtmax;	/* max.  read transfer size */ | 
 | 75 | 	__u32			rtpref;	/* pref. read transfer size */ | 
 | 76 | 	__u32			rtmult;	/* reads should be multiple of this */ | 
 | 77 | 	__u32			wtmax;	/* max.  write transfer size */ | 
 | 78 | 	__u32			wtpref;	/* pref. write transfer size */ | 
 | 79 | 	__u32			wtmult;	/* writes should be multiple of this */ | 
 | 80 | 	__u32			dtpref;	/* pref. readdir transfer size */ | 
 | 81 | 	__u64			maxfilesize; | 
 | 82 | 	__u32			lease_time; /* in seconds */ | 
 | 83 | }; | 
 | 84 |  | 
 | 85 | struct nfs_fsstat { | 
 | 86 | 	struct nfs_fattr	*fattr; /* Post-op attributes */ | 
 | 87 | 	__u64			tbytes;	/* total size in bytes */ | 
 | 88 | 	__u64			fbytes;	/* # of free bytes */ | 
 | 89 | 	__u64			abytes;	/* # of bytes available to user */ | 
 | 90 | 	__u64			tfiles;	/* # of files */ | 
 | 91 | 	__u64			ffiles;	/* # of free files */ | 
 | 92 | 	__u64			afiles;	/* # of files available to user */ | 
 | 93 | }; | 
 | 94 |  | 
 | 95 | struct nfs2_fsstat { | 
 | 96 | 	__u32			tsize;  /* Server transfer size */ | 
 | 97 | 	__u32			bsize;  /* Filesystem block size */ | 
 | 98 | 	__u32			blocks; /* No. of "bsize" blocks on filesystem */ | 
 | 99 | 	__u32			bfree;  /* No. of free "bsize" blocks */ | 
 | 100 | 	__u32			bavail; /* No. of available "bsize" blocks */ | 
 | 101 | }; | 
 | 102 |  | 
 | 103 | struct nfs_pathconf { | 
 | 104 | 	struct nfs_fattr	*fattr; /* Post-op attributes */ | 
 | 105 | 	__u32			max_link; /* max # of hard links */ | 
 | 106 | 	__u32			max_namelen; /* max name length */ | 
 | 107 | }; | 
 | 108 |  | 
 | 109 | struct nfs4_change_info { | 
 | 110 | 	u32			atomic; | 
 | 111 | 	u64			before; | 
 | 112 | 	u64			after; | 
 | 113 | }; | 
 | 114 |  | 
| Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 115 | struct nfs_seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | /* | 
 | 117 |  * Arguments to the open call. | 
 | 118 |  */ | 
 | 119 | struct nfs_openargs { | 
 | 120 | 	const struct nfs_fh *	fh; | 
| Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 121 | 	struct nfs_seqid *	seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | 	int			open_flags; | 
| Trond Myklebust | dc0b027 | 2008-12-23 15:21:56 -0500 | [diff] [blame] | 123 | 	fmode_t			fmode; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 124 | 	__u64                   clientid; | 
| Trond Myklebust | 9f958ab | 2007-07-02 13:58:33 -0400 | [diff] [blame] | 125 | 	__u64                   id; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | 	union { | 
 | 127 | 		struct iattr *  attrs;    /* UNCHECKED, GUARDED */ | 
 | 128 | 		nfs4_verifier   verifier; /* EXCLUSIVE */ | 
 | 129 | 		nfs4_stateid	delegation;		/* CLAIM_DELEGATE_CUR */ | 
| Trond Myklebust | bd7bf9d | 2008-12-23 15:21:53 -0500 | [diff] [blame] | 130 | 		fmode_t		delegation_type;	/* CLAIM_PREVIOUS */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 131 | 	} u; | 
 | 132 | 	const struct qstr *	name; | 
 | 133 | 	const struct nfs_server *server;	 /* Needed for ID mapping */ | 
 | 134 | 	const u32 *		bitmask; | 
 | 135 | 	__u32			claim; | 
 | 136 | }; | 
 | 137 |  | 
 | 138 | struct nfs_openres { | 
 | 139 | 	nfs4_stateid            stateid; | 
 | 140 | 	struct nfs_fh           fh; | 
 | 141 | 	struct nfs4_change_info	cinfo; | 
 | 142 | 	__u32                   rflags; | 
 | 143 | 	struct nfs_fattr *      f_attr; | 
| Trond Myklebust | 56ae19f | 2005-10-27 22:12:40 -0400 | [diff] [blame] | 144 | 	struct nfs_fattr *      dir_attr; | 
| Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 145 | 	struct nfs_seqid *	seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | 	const struct nfs_server *server; | 
| Trond Myklebust | bd7bf9d | 2008-12-23 15:21:53 -0500 | [diff] [blame] | 147 | 	fmode_t			delegation_type; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 148 | 	nfs4_stateid		delegation; | 
 | 149 | 	__u32			do_recall; | 
 | 150 | 	__u64			maxsize; | 
| Jeff Layton | aa53ed5 | 2007-06-05 14:49:03 -0400 | [diff] [blame] | 151 | 	__u32			attrset[NFS4_BITMAP_SIZE]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | }; | 
 | 153 |  | 
 | 154 | /* | 
 | 155 |  * Arguments to the open_confirm call. | 
 | 156 |  */ | 
 | 157 | struct nfs_open_confirmargs { | 
 | 158 | 	const struct nfs_fh *	fh; | 
| Trond Myklebust | cdd4e68 | 2006-01-03 09:55:12 +0100 | [diff] [blame] | 159 | 	nfs4_stateid *		stateid; | 
| Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 160 | 	struct nfs_seqid *	seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 161 | }; | 
 | 162 |  | 
 | 163 | struct nfs_open_confirmres { | 
 | 164 | 	nfs4_stateid            stateid; | 
| Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 165 | 	struct nfs_seqid *	seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | }; | 
 | 167 |  | 
 | 168 | /* | 
 | 169 |  * Arguments to the close call. | 
 | 170 |  */ | 
 | 171 | struct nfs_closeargs { | 
 | 172 | 	struct nfs_fh *         fh; | 
| Trond Myklebust | 9512135 | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 173 | 	nfs4_stateid *		stateid; | 
| Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 174 | 	struct nfs_seqid *	seqid; | 
| Trond Myklebust | dc0b027 | 2008-12-23 15:21:56 -0500 | [diff] [blame] | 175 | 	fmode_t			fmode; | 
| Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 176 | 	const u32 *		bitmask; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | }; | 
 | 178 |  | 
 | 179 | struct nfs_closeres { | 
 | 180 | 	nfs4_stateid            stateid; | 
| Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 181 | 	struct nfs_fattr *	fattr; | 
| Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 182 | 	struct nfs_seqid *	seqid; | 
| Trond Myklebust | 516a6af | 2005-10-27 22:12:41 -0400 | [diff] [blame] | 183 | 	const struct nfs_server *server; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | }; | 
 | 185 | /* | 
 | 186 |  *  * Arguments to the lock,lockt, and locku call. | 
 | 187 |  *   */ | 
 | 188 | struct nfs_lowner { | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 189 | 	__u64			clientid; | 
| Trond Myklebust | 9f958ab | 2007-07-02 13:58:33 -0400 | [diff] [blame] | 190 | 	__u64			id; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | }; | 
 | 192 |  | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 193 | struct nfs_lock_args { | 
 | 194 | 	struct nfs_fh *		fh; | 
 | 195 | 	struct file_lock *	fl; | 
| Trond Myklebust | 06735b3 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 196 | 	struct nfs_seqid *	lock_seqid; | 
 | 197 | 	nfs4_stateid *		lock_stateid; | 
 | 198 | 	struct nfs_seqid *	open_seqid; | 
 | 199 | 	nfs4_stateid *		open_stateid; | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 200 | 	struct nfs_lowner	lock_owner; | 
 | 201 | 	unsigned char		block : 1; | 
 | 202 | 	unsigned char		reclaim : 1; | 
 | 203 | 	unsigned char		new_lock_owner : 1; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 204 | }; | 
 | 205 |  | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 206 | struct nfs_lock_res { | 
| Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 207 | 	nfs4_stateid		stateid; | 
 | 208 | 	struct nfs_seqid *	lock_seqid; | 
 | 209 | 	struct nfs_seqid *	open_seqid; | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 210 | }; | 
 | 211 |  | 
 | 212 | struct nfs_locku_args { | 
 | 213 | 	struct nfs_fh *		fh; | 
 | 214 | 	struct file_lock *	fl; | 
| Trond Myklebust | cee54fc | 2005-10-18 14:20:12 -0700 | [diff] [blame] | 215 | 	struct nfs_seqid *	seqid; | 
| Trond Myklebust | faf5f49 | 2005-10-18 14:20:15 -0700 | [diff] [blame] | 216 | 	nfs4_stateid *		stateid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | }; | 
 | 218 |  | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 219 | struct nfs_locku_res { | 
| Trond Myklebust | c1d5193 | 2008-04-07 13:20:54 -0400 | [diff] [blame] | 220 | 	nfs4_stateid		stateid; | 
 | 221 | 	struct nfs_seqid *	seqid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | }; | 
 | 223 |  | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 224 | struct nfs_lockt_args { | 
 | 225 | 	struct nfs_fh *		fh; | 
 | 226 | 	struct file_lock *	fl; | 
 | 227 | 	struct nfs_lowner	lock_owner; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | }; | 
 | 229 |  | 
| Trond Myklebust | 911d1aa | 2006-01-03 09:55:16 +0100 | [diff] [blame] | 230 | struct nfs_lockt_res { | 
 | 231 | 	struct file_lock *	denied; /* LOCK, LOCKT failed */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 232 | }; | 
 | 233 |  | 
 | 234 | struct nfs4_delegreturnargs { | 
 | 235 | 	const struct nfs_fh *fhandle; | 
 | 236 | 	const nfs4_stateid *stateid; | 
| Trond Myklebust | fa178f2 | 2006-01-03 09:55:38 +0100 | [diff] [blame] | 237 | 	const u32 * bitmask; | 
 | 238 | }; | 
 | 239 |  | 
 | 240 | struct nfs4_delegreturnres { | 
 | 241 | 	struct nfs_fattr * fattr; | 
 | 242 | 	const struct nfs_server *server; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | }; | 
 | 244 |  | 
 | 245 | /* | 
 | 246 |  * Arguments to the read call. | 
 | 247 |  */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | struct nfs_readargs { | 
 | 249 | 	struct nfs_fh *		fh; | 
 | 250 | 	struct nfs_open_context *context; | 
 | 251 | 	__u64			offset; | 
 | 252 | 	__u32			count; | 
 | 253 | 	unsigned int		pgbase; | 
 | 254 | 	struct page **		pages; | 
 | 255 | }; | 
 | 256 |  | 
 | 257 | struct nfs_readres { | 
 | 258 | 	struct nfs_fattr *	fattr; | 
 | 259 | 	__u32			count; | 
 | 260 | 	int                     eof; | 
 | 261 | }; | 
 | 262 |  | 
 | 263 | /* | 
 | 264 |  * Arguments to the write call. | 
 | 265 |  */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | struct nfs_writeargs { | 
 | 267 | 	struct nfs_fh *		fh; | 
 | 268 | 	struct nfs_open_context *context; | 
 | 269 | 	__u64			offset; | 
 | 270 | 	__u32			count; | 
 | 271 | 	enum nfs3_stable_how	stable; | 
 | 272 | 	unsigned int		pgbase; | 
 | 273 | 	struct page **		pages; | 
| Trond Myklebust | 4f9838c | 2005-10-27 22:12:44 -0400 | [diff] [blame] | 274 | 	const u32 *		bitmask; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | }; | 
 | 276 |  | 
 | 277 | struct nfs_writeverf { | 
 | 278 | 	enum nfs3_stable_how	committed; | 
| Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 279 | 	__be32			verifier[2]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 280 | }; | 
 | 281 |  | 
 | 282 | struct nfs_writeres { | 
 | 283 | 	struct nfs_fattr *	fattr; | 
 | 284 | 	struct nfs_writeverf *	verf; | 
 | 285 | 	__u32			count; | 
| Trond Myklebust | 4f9838c | 2005-10-27 22:12:44 -0400 | [diff] [blame] | 286 | 	const struct nfs_server *server; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | }; | 
 | 288 |  | 
 | 289 | /* | 
| Trond Myklebust | 4fdc17b | 2007-07-14 15:39:57 -0400 | [diff] [blame] | 290 |  * Common arguments to the unlink call | 
 | 291 |  */ | 
 | 292 | struct nfs_removeargs { | 
 | 293 | 	const struct nfs_fh	*fh; | 
 | 294 | 	struct qstr		name; | 
 | 295 | 	const u32 *		bitmask; | 
 | 296 | }; | 
 | 297 |  | 
 | 298 | struct nfs_removeres { | 
 | 299 | 	const struct nfs_server *server; | 
 | 300 | 	struct nfs4_change_info	cinfo; | 
 | 301 | 	struct nfs_fattr	dir_attr; | 
 | 302 | }; | 
 | 303 |  | 
 | 304 | /* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 |  * Argument struct for decode_entry function | 
 | 306 |  */ | 
 | 307 | struct nfs_entry { | 
 | 308 | 	__u64			ino; | 
 | 309 | 	__u64			cookie, | 
 | 310 | 				prev_cookie; | 
 | 311 | 	const char *		name; | 
 | 312 | 	unsigned int		len; | 
 | 313 | 	int			eof; | 
 | 314 | 	struct nfs_fh *		fh; | 
 | 315 | 	struct nfs_fattr *	fattr; | 
 | 316 | }; | 
 | 317 |  | 
 | 318 | /* | 
 | 319 |  * The following types are for NFSv2 only. | 
 | 320 |  */ | 
 | 321 | struct nfs_sattrargs { | 
 | 322 | 	struct nfs_fh *		fh; | 
 | 323 | 	struct iattr *		sattr; | 
 | 324 | }; | 
 | 325 |  | 
 | 326 | struct nfs_diropargs { | 
 | 327 | 	struct nfs_fh *		fh; | 
 | 328 | 	const char *		name; | 
 | 329 | 	unsigned int		len; | 
 | 330 | }; | 
 | 331 |  | 
 | 332 | struct nfs_createargs { | 
 | 333 | 	struct nfs_fh *		fh; | 
 | 334 | 	const char *		name; | 
 | 335 | 	unsigned int		len; | 
 | 336 | 	struct iattr *		sattr; | 
 | 337 | }; | 
 | 338 |  | 
 | 339 | struct nfs_renameargs { | 
 | 340 | 	struct nfs_fh *		fromfh; | 
 | 341 | 	const char *		fromname; | 
 | 342 | 	unsigned int		fromlen; | 
 | 343 | 	struct nfs_fh *		tofh; | 
 | 344 | 	const char *		toname; | 
 | 345 | 	unsigned int		tolen; | 
 | 346 | }; | 
 | 347 |  | 
 | 348 | struct nfs_setattrargs { | 
 | 349 | 	struct nfs_fh *                 fh; | 
 | 350 | 	nfs4_stateid                    stateid; | 
 | 351 | 	struct iattr *                  iap; | 
 | 352 | 	const struct nfs_server *	server; /* Needed for name mapping */ | 
 | 353 | 	const u32 *			bitmask; | 
 | 354 | }; | 
 | 355 |  | 
| J. Bruce Fields | 23ec696 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 356 | struct nfs_setaclargs { | 
 | 357 | 	struct nfs_fh *			fh; | 
 | 358 | 	size_t				acl_len; | 
 | 359 | 	unsigned int			acl_pgbase; | 
 | 360 | 	struct page **			acl_pages; | 
 | 361 | }; | 
 | 362 |  | 
| J. Bruce Fields | 029d105 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 363 | struct nfs_getaclargs { | 
 | 364 | 	struct nfs_fh *			fh; | 
 | 365 | 	size_t				acl_len; | 
 | 366 | 	unsigned int			acl_pgbase; | 
 | 367 | 	struct page **			acl_pages; | 
 | 368 | }; | 
 | 369 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 370 | struct nfs_setattrres { | 
 | 371 | 	struct nfs_fattr *              fattr; | 
 | 372 | 	const struct nfs_server *	server; | 
 | 373 | }; | 
 | 374 |  | 
 | 375 | struct nfs_linkargs { | 
 | 376 | 	struct nfs_fh *		fromfh; | 
 | 377 | 	struct nfs_fh *		tofh; | 
 | 378 | 	const char *		toname; | 
 | 379 | 	unsigned int		tolen; | 
 | 380 | }; | 
 | 381 |  | 
 | 382 | struct nfs_symlinkargs { | 
 | 383 | 	struct nfs_fh *		fromfh; | 
 | 384 | 	const char *		fromname; | 
 | 385 | 	unsigned int		fromlen; | 
| Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 386 | 	struct page **		pages; | 
 | 387 | 	unsigned int		pathlen; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 388 | 	struct iattr *		sattr; | 
 | 389 | }; | 
 | 390 |  | 
 | 391 | struct nfs_readdirargs { | 
 | 392 | 	struct nfs_fh *		fh; | 
 | 393 | 	__u32			cookie; | 
 | 394 | 	unsigned int		count; | 
 | 395 | 	struct page **		pages; | 
 | 396 | }; | 
 | 397 |  | 
| Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 398 | struct nfs3_getaclargs { | 
 | 399 | 	struct nfs_fh *		fh; | 
 | 400 | 	int			mask; | 
 | 401 | 	struct page **		pages; | 
 | 402 | }; | 
 | 403 |  | 
 | 404 | struct nfs3_setaclargs { | 
 | 405 | 	struct inode *		inode; | 
 | 406 | 	int			mask; | 
 | 407 | 	struct posix_acl *	acl_access; | 
 | 408 | 	struct posix_acl *	acl_default; | 
| Trond Myklebust | ae46141 | 2009-03-10 20:33:18 -0400 | [diff] [blame] | 409 | 	size_t			len; | 
 | 410 | 	unsigned int		npages; | 
| Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 411 | 	struct page **		pages; | 
 | 412 | }; | 
 | 413 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 414 | struct nfs_diropok { | 
 | 415 | 	struct nfs_fh *		fh; | 
 | 416 | 	struct nfs_fattr *	fattr; | 
 | 417 | }; | 
 | 418 |  | 
 | 419 | struct nfs_readlinkargs { | 
 | 420 | 	struct nfs_fh *		fh; | 
 | 421 | 	unsigned int		pgbase; | 
 | 422 | 	unsigned int		pglen; | 
 | 423 | 	struct page **		pages; | 
 | 424 | }; | 
 | 425 |  | 
 | 426 | struct nfs3_sattrargs { | 
 | 427 | 	struct nfs_fh *		fh; | 
 | 428 | 	struct iattr *		sattr; | 
 | 429 | 	unsigned int		guard; | 
 | 430 | 	struct timespec		guardtime; | 
 | 431 | }; | 
 | 432 |  | 
 | 433 | struct nfs3_diropargs { | 
 | 434 | 	struct nfs_fh *		fh; | 
 | 435 | 	const char *		name; | 
 | 436 | 	unsigned int		len; | 
 | 437 | }; | 
 | 438 |  | 
 | 439 | struct nfs3_accessargs { | 
 | 440 | 	struct nfs_fh *		fh; | 
 | 441 | 	__u32			access; | 
 | 442 | }; | 
 | 443 |  | 
 | 444 | struct nfs3_createargs { | 
 | 445 | 	struct nfs_fh *		fh; | 
 | 446 | 	const char *		name; | 
 | 447 | 	unsigned int		len; | 
 | 448 | 	struct iattr *		sattr; | 
 | 449 | 	enum nfs3_createmode	createmode; | 
| Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 450 | 	__be32			verifier[2]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 451 | }; | 
 | 452 |  | 
 | 453 | struct nfs3_mkdirargs { | 
 | 454 | 	struct nfs_fh *		fh; | 
 | 455 | 	const char *		name; | 
 | 456 | 	unsigned int		len; | 
 | 457 | 	struct iattr *		sattr; | 
 | 458 | }; | 
 | 459 |  | 
 | 460 | struct nfs3_symlinkargs { | 
 | 461 | 	struct nfs_fh *		fromfh; | 
 | 462 | 	const char *		fromname; | 
 | 463 | 	unsigned int		fromlen; | 
| Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 464 | 	struct page **		pages; | 
 | 465 | 	unsigned int		pathlen; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 466 | 	struct iattr *		sattr; | 
 | 467 | }; | 
 | 468 |  | 
 | 469 | struct nfs3_mknodargs { | 
 | 470 | 	struct nfs_fh *		fh; | 
 | 471 | 	const char *		name; | 
 | 472 | 	unsigned int		len; | 
 | 473 | 	enum nfs3_ftype		type; | 
 | 474 | 	struct iattr *		sattr; | 
 | 475 | 	dev_t			rdev; | 
 | 476 | }; | 
 | 477 |  | 
 | 478 | struct nfs3_renameargs { | 
 | 479 | 	struct nfs_fh *		fromfh; | 
 | 480 | 	const char *		fromname; | 
 | 481 | 	unsigned int		fromlen; | 
 | 482 | 	struct nfs_fh *		tofh; | 
 | 483 | 	const char *		toname; | 
 | 484 | 	unsigned int		tolen; | 
 | 485 | }; | 
 | 486 |  | 
 | 487 | struct nfs3_linkargs { | 
 | 488 | 	struct nfs_fh *		fromfh; | 
 | 489 | 	struct nfs_fh *		tofh; | 
 | 490 | 	const char *		toname; | 
 | 491 | 	unsigned int		tolen; | 
 | 492 | }; | 
 | 493 |  | 
 | 494 | struct nfs3_readdirargs { | 
 | 495 | 	struct nfs_fh *		fh; | 
 | 496 | 	__u64			cookie; | 
| Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 497 | 	__be32			verf[2]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | 	int			plus; | 
 | 499 | 	unsigned int            count; | 
 | 500 | 	struct page **		pages; | 
 | 501 | }; | 
 | 502 |  | 
 | 503 | struct nfs3_diropres { | 
 | 504 | 	struct nfs_fattr *	dir_attr; | 
 | 505 | 	struct nfs_fh *		fh; | 
 | 506 | 	struct nfs_fattr *	fattr; | 
 | 507 | }; | 
 | 508 |  | 
 | 509 | struct nfs3_accessres { | 
 | 510 | 	struct nfs_fattr *	fattr; | 
 | 511 | 	__u32			access; | 
 | 512 | }; | 
 | 513 |  | 
 | 514 | struct nfs3_readlinkargs { | 
 | 515 | 	struct nfs_fh *		fh; | 
 | 516 | 	unsigned int		pgbase; | 
 | 517 | 	unsigned int		pglen; | 
 | 518 | 	struct page **		pages; | 
 | 519 | }; | 
 | 520 |  | 
 | 521 | struct nfs3_renameres { | 
 | 522 | 	struct nfs_fattr *	fromattr; | 
 | 523 | 	struct nfs_fattr *	toattr; | 
 | 524 | }; | 
 | 525 |  | 
 | 526 | struct nfs3_linkres { | 
 | 527 | 	struct nfs_fattr *	dir_attr; | 
 | 528 | 	struct nfs_fattr *	fattr; | 
 | 529 | }; | 
 | 530 |  | 
 | 531 | struct nfs3_readdirres { | 
 | 532 | 	struct nfs_fattr *	dir_attr; | 
| Al Viro | bc4785c | 2006-10-19 23:28:51 -0700 | [diff] [blame] | 533 | 	__be32 *		verf; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 534 | 	int			plus; | 
 | 535 | }; | 
 | 536 |  | 
| Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 537 | struct nfs3_getaclres { | 
 | 538 | 	struct nfs_fattr *	fattr; | 
 | 539 | 	int			mask; | 
 | 540 | 	unsigned int		acl_access_count; | 
 | 541 | 	unsigned int		acl_default_count; | 
 | 542 | 	struct posix_acl *	acl_access; | 
 | 543 | 	struct posix_acl *	acl_default; | 
 | 544 | }; | 
 | 545 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 546 | #ifdef CONFIG_NFS_V4 | 
 | 547 |  | 
 | 548 | typedef u64 clientid4; | 
 | 549 |  | 
 | 550 | struct nfs4_accessargs { | 
 | 551 | 	const struct nfs_fh *		fh; | 
| Trond Myklebust | 76b3299 | 2007-08-10 17:45:11 -0400 | [diff] [blame] | 552 | 	const u32 *			bitmask; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 553 | 	u32				access; | 
 | 554 | }; | 
 | 555 |  | 
 | 556 | struct nfs4_accessres { | 
| Trond Myklebust | 76b3299 | 2007-08-10 17:45:11 -0400 | [diff] [blame] | 557 | 	const struct nfs_server *	server; | 
 | 558 | 	struct nfs_fattr *		fattr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 559 | 	u32				supported; | 
 | 560 | 	u32				access; | 
 | 561 | }; | 
 | 562 |  | 
 | 563 | struct nfs4_create_arg { | 
 | 564 | 	u32				ftype; | 
 | 565 | 	union { | 
| Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 566 | 		struct { | 
 | 567 | 			struct page **	pages; | 
 | 568 | 			unsigned int	len; | 
 | 569 | 		} symlink;   /* NF4LNK */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 570 | 		struct { | 
 | 571 | 			u32		specdata1; | 
 | 572 | 			u32		specdata2; | 
 | 573 | 		} device;    /* NF4BLK, NF4CHR */ | 
 | 574 | 	} u; | 
 | 575 | 	const struct qstr *		name; | 
 | 576 | 	const struct nfs_server *	server; | 
 | 577 | 	const struct iattr *		attrs; | 
 | 578 | 	const struct nfs_fh *		dir_fh; | 
 | 579 | 	const u32 *			bitmask; | 
 | 580 | }; | 
 | 581 |  | 
 | 582 | struct nfs4_create_res { | 
 | 583 | 	const struct nfs_server *	server; | 
 | 584 | 	struct nfs_fh *			fh; | 
 | 585 | 	struct nfs_fattr *		fattr; | 
 | 586 | 	struct nfs4_change_info		dir_cinfo; | 
| Trond Myklebust | 56ae19f | 2005-10-27 22:12:40 -0400 | [diff] [blame] | 587 | 	struct nfs_fattr *		dir_fattr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 588 | }; | 
 | 589 |  | 
 | 590 | struct nfs4_fsinfo_arg { | 
 | 591 | 	const struct nfs_fh *		fh; | 
 | 592 | 	const u32 *			bitmask; | 
 | 593 | }; | 
 | 594 |  | 
 | 595 | struct nfs4_getattr_arg { | 
 | 596 | 	const struct nfs_fh *		fh; | 
 | 597 | 	const u32 *			bitmask; | 
 | 598 | }; | 
 | 599 |  | 
 | 600 | struct nfs4_getattr_res { | 
 | 601 | 	const struct nfs_server *	server; | 
 | 602 | 	struct nfs_fattr *		fattr; | 
 | 603 | }; | 
 | 604 |  | 
 | 605 | struct nfs4_link_arg { | 
 | 606 | 	const struct nfs_fh *		fh; | 
 | 607 | 	const struct nfs_fh *		dir_fh; | 
 | 608 | 	const struct qstr *		name; | 
| Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame] | 609 | 	const u32 *			bitmask; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 610 | }; | 
 | 611 |  | 
| Trond Myklebust | 91ba2ee | 2005-10-27 22:12:42 -0400 | [diff] [blame] | 612 | struct nfs4_link_res { | 
 | 613 | 	const struct nfs_server *	server; | 
 | 614 | 	struct nfs_fattr *		fattr; | 
 | 615 | 	struct nfs4_change_info		cinfo; | 
 | 616 | 	struct nfs_fattr *		dir_attr; | 
 | 617 | }; | 
 | 618 |  | 
 | 619 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 620 | struct nfs4_lookup_arg { | 
 | 621 | 	const struct nfs_fh *		dir_fh; | 
 | 622 | 	const struct qstr *		name; | 
 | 623 | 	const u32 *			bitmask; | 
 | 624 | }; | 
 | 625 |  | 
 | 626 | struct nfs4_lookup_res { | 
 | 627 | 	const struct nfs_server *	server; | 
 | 628 | 	struct nfs_fattr *		fattr; | 
 | 629 | 	struct nfs_fh *			fh; | 
 | 630 | }; | 
 | 631 |  | 
 | 632 | struct nfs4_lookup_root_arg { | 
 | 633 | 	const u32 *			bitmask; | 
 | 634 | }; | 
 | 635 |  | 
 | 636 | struct nfs4_pathconf_arg { | 
 | 637 | 	const struct nfs_fh *		fh; | 
 | 638 | 	const u32 *			bitmask; | 
 | 639 | }; | 
 | 640 |  | 
 | 641 | struct nfs4_readdir_arg { | 
 | 642 | 	const struct nfs_fh *		fh; | 
 | 643 | 	u64				cookie; | 
 | 644 | 	nfs4_verifier			verifier; | 
 | 645 | 	u32				count; | 
 | 646 | 	struct page **			pages;	/* zero-copy data */ | 
 | 647 | 	unsigned int			pgbase;	/* zero-copy data */ | 
 | 648 | 	const u32 *			bitmask; | 
 | 649 | }; | 
 | 650 |  | 
 | 651 | struct nfs4_readdir_res { | 
 | 652 | 	nfs4_verifier			verifier; | 
 | 653 | 	unsigned int			pgbase; | 
 | 654 | }; | 
 | 655 |  | 
 | 656 | struct nfs4_readlink { | 
 | 657 | 	const struct nfs_fh *		fh; | 
 | 658 | 	unsigned int			pgbase; | 
 | 659 | 	unsigned int			pglen;   /* zero-copy data */ | 
 | 660 | 	struct page **			pages;   /* zero-copy data */ | 
 | 661 | }; | 
 | 662 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 663 | struct nfs4_rename_arg { | 
 | 664 | 	const struct nfs_fh *		old_dir; | 
 | 665 | 	const struct nfs_fh *		new_dir; | 
 | 666 | 	const struct qstr *		old_name; | 
 | 667 | 	const struct qstr *		new_name; | 
| Trond Myklebust | 6caf2c8 | 2005-10-27 22:12:43 -0400 | [diff] [blame] | 668 | 	const u32 *			bitmask; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 669 | }; | 
 | 670 |  | 
 | 671 | struct nfs4_rename_res { | 
| Trond Myklebust | 6caf2c8 | 2005-10-27 22:12:43 -0400 | [diff] [blame] | 672 | 	const struct nfs_server *	server; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 673 | 	struct nfs4_change_info		old_cinfo; | 
| Trond Myklebust | 6caf2c8 | 2005-10-27 22:12:43 -0400 | [diff] [blame] | 674 | 	struct nfs_fattr *		old_fattr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 675 | 	struct nfs4_change_info		new_cinfo; | 
| Trond Myklebust | 6caf2c8 | 2005-10-27 22:12:43 -0400 | [diff] [blame] | 676 | 	struct nfs_fattr *		new_fattr; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 677 | }; | 
 | 678 |  | 
| Trond Myklebust | 19d771f | 2008-10-08 13:54:52 -0400 | [diff] [blame] | 679 | #define NFS4_SETCLIENTID_NAMELEN	(127) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 680 | struct nfs4_setclientid { | 
| Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 681 | 	const nfs4_verifier *		sc_verifier; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 682 | 	unsigned int			sc_name_len; | 
| Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 683 | 	char				sc_name[NFS4_SETCLIENTID_NAMELEN + 1]; | 
| Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 684 | 	u32				sc_prog; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 685 | 	unsigned int			sc_netid_len; | 
| Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 686 | 	char				sc_netid[RPCBIND_MAXNETIDLEN + 1]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 687 | 	unsigned int			sc_uaddr_len; | 
| Chuck Lever | d1ce02e | 2008-09-25 11:57:12 -0400 | [diff] [blame] | 688 | 	char				sc_uaddr[RPCBIND_MAXUADDRLEN + 1]; | 
| Chuck Lever | cc38bac | 2007-12-10 14:56:54 -0500 | [diff] [blame] | 689 | 	u32				sc_cb_ident; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 690 | }; | 
 | 691 |  | 
 | 692 | struct nfs4_statfs_arg { | 
 | 693 | 	const struct nfs_fh *		fh; | 
 | 694 | 	const u32 *			bitmask; | 
 | 695 | }; | 
 | 696 |  | 
 | 697 | struct nfs4_server_caps_res { | 
 | 698 | 	u32				attr_bitmask[2]; | 
 | 699 | 	u32				acl_bitmask; | 
 | 700 | 	u32				has_links; | 
 | 701 | 	u32				has_symlinks; | 
 | 702 | }; | 
 | 703 |  | 
| Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 704 | struct nfs4_string { | 
 | 705 | 	unsigned int len; | 
 | 706 | 	char *data; | 
| Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 707 | }; | 
 | 708 |  | 
| Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 709 | #define NFS4_PATHNAME_MAXCOMPONENTS 512 | 
 | 710 | struct nfs4_pathname { | 
 | 711 | 	unsigned int ncomponents; | 
 | 712 | 	struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS]; | 
 | 713 | }; | 
 | 714 |  | 
 | 715 | #define NFS4_FS_LOCATION_MAXSERVERS 10 | 
 | 716 | struct nfs4_fs_location { | 
 | 717 | 	unsigned int nservers; | 
 | 718 | 	struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS]; | 
 | 719 | 	struct nfs4_pathname rootpath; | 
 | 720 | }; | 
 | 721 |  | 
 | 722 | #define NFS4_FS_LOCATIONS_MAXENTRIES 10 | 
 | 723 | struct nfs4_fs_locations { | 
| Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 724 | 	struct nfs_fattr fattr; | 
 | 725 | 	const struct nfs_server *server; | 
| Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 726 | 	struct nfs4_pathname fs_path; | 
| Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 727 | 	int nlocations; | 
| Manoj Naik | 7aaa0b3 | 2006-06-09 09:34:23 -0400 | [diff] [blame] | 728 | 	struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES]; | 
| Trond Myklebust | 683b57b | 2006-06-09 09:34:22 -0400 | [diff] [blame] | 729 | }; | 
 | 730 |  | 
 | 731 | struct nfs4_fs_locations_arg { | 
 | 732 | 	const struct nfs_fh *dir_fh; | 
 | 733 | 	const struct qstr *name; | 
 | 734 | 	struct page *page; | 
 | 735 | 	const u32 *bitmask; | 
 | 736 | }; | 
 | 737 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 738 | #endif /* CONFIG_NFS_V4 */ | 
 | 739 |  | 
 | 740 | struct nfs_page; | 
 | 741 |  | 
| Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 742 | #define NFS_PAGEVEC_SIZE	(8U) | 
 | 743 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 744 | struct nfs_read_data { | 
 | 745 | 	int			flags; | 
 | 746 | 	struct rpc_task		task; | 
 | 747 | 	struct inode		*inode; | 
 | 748 | 	struct rpc_cred		*cred; | 
 | 749 | 	struct nfs_fattr	fattr;	/* fattr storage */ | 
 | 750 | 	struct list_head	pages;	/* Coalesced read requests */ | 
 | 751 | 	struct nfs_page		*req;	/* multi ops per nfs_page */ | 
| Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 752 | 	struct page		**pagevec; | 
| Trond Myklebust | e9f7bee | 2006-09-08 09:48:54 -0700 | [diff] [blame] | 753 | 	unsigned int		npages;	/* Max length of pagevec */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 754 | 	struct nfs_readargs args; | 
 | 755 | 	struct nfs_readres  res; | 
 | 756 | #ifdef CONFIG_NFS_V4 | 
 | 757 | 	unsigned long		timestamp;	/* For lease renewal */ | 
 | 758 | #endif | 
| Chuck Lever | 0d0b5cb | 2006-05-25 01:40:53 -0400 | [diff] [blame] | 759 | 	struct page		*page_array[NFS_PAGEVEC_SIZE]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 760 | }; | 
 | 761 |  | 
 | 762 | struct nfs_write_data { | 
 | 763 | 	int			flags; | 
 | 764 | 	struct rpc_task		task; | 
 | 765 | 	struct inode		*inode; | 
 | 766 | 	struct rpc_cred		*cred; | 
 | 767 | 	struct nfs_fattr	fattr; | 
 | 768 | 	struct nfs_writeverf	verf; | 
 | 769 | 	struct list_head	pages;		/* Coalesced requests we wish to flush */ | 
 | 770 | 	struct nfs_page		*req;		/* multi ops per nfs_page */ | 
| Chuck Lever | 40859d7 | 2005-11-30 18:09:02 -0500 | [diff] [blame] | 771 | 	struct page		**pagevec; | 
| Trond Myklebust | e9f7bee | 2006-09-08 09:48:54 -0700 | [diff] [blame] | 772 | 	unsigned int		npages;		/* Max length of pagevec */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 773 | 	struct nfs_writeargs	args;		/* argument struct */ | 
 | 774 | 	struct nfs_writeres	res;		/* result struct */ | 
 | 775 | #ifdef CONFIG_NFS_V4 | 
 | 776 | 	unsigned long		timestamp;	/* For lease renewal */ | 
 | 777 | #endif | 
| Chuck Lever | 0d0b5cb | 2006-05-25 01:40:53 -0400 | [diff] [blame] | 778 | 	struct page		*page_array[NFS_PAGEVEC_SIZE]; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 779 | }; | 
 | 780 |  | 
 | 781 | struct nfs_access_entry; | 
 | 782 |  | 
 | 783 | /* | 
 | 784 |  * RPC procedure vector for NFSv2/NFSv3 demuxing | 
 | 785 |  */ | 
 | 786 | struct nfs_rpc_ops { | 
| Chuck Lever | c0e07cb | 2008-01-14 12:32:05 -0500 | [diff] [blame] | 787 | 	u32	version;		/* Protocol version */ | 
| Al Viro | f786aa9 | 2009-02-20 05:51:22 +0000 | [diff] [blame] | 788 | 	const struct dentry_operations *dentry_ops; | 
| Arjan van de Ven | c5ef1c4 | 2007-02-12 00:55:40 -0800 | [diff] [blame] | 789 | 	const struct inode_operations *dir_inode_ops; | 
 | 790 | 	const struct inode_operations *file_inode_ops; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 791 |  | 
 | 792 | 	int	(*getroot) (struct nfs_server *, struct nfs_fh *, | 
 | 793 | 			    struct nfs_fsinfo *); | 
| David Howells | 2b3de44 | 2006-08-22 20:06:09 -0400 | [diff] [blame] | 794 | 	int	(*lookupfh)(struct nfs_server *, struct nfs_fh *, | 
 | 795 | 			    struct qstr *, struct nfs_fh *, | 
 | 796 | 			    struct nfs_fattr *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 797 | 	int	(*getattr) (struct nfs_server *, struct nfs_fh *, | 
 | 798 | 			    struct nfs_fattr *); | 
 | 799 | 	int	(*setattr) (struct dentry *, struct nfs_fattr *, | 
 | 800 | 			    struct iattr *); | 
 | 801 | 	int	(*lookup)  (struct inode *, struct qstr *, | 
 | 802 | 			    struct nfs_fh *, struct nfs_fattr *); | 
 | 803 | 	int	(*access)  (struct inode *, struct nfs_access_entry *); | 
 | 804 | 	int	(*readlink)(struct inode *, struct page *, unsigned int, | 
 | 805 | 			    unsigned int); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 806 | 	int	(*create)  (struct inode *, struct dentry *, | 
| Trond Myklebust | 02a913a | 2005-10-18 14:20:17 -0700 | [diff] [blame] | 807 | 			    struct iattr *, int, struct nameidata *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 808 | 	int	(*remove)  (struct inode *, struct qstr *); | 
| Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 809 | 	void	(*unlink_setup)  (struct rpc_message *, struct inode *dir); | 
 | 810 | 	int	(*unlink_done) (struct rpc_task *, struct inode *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 811 | 	int	(*rename)  (struct inode *, struct qstr *, | 
 | 812 | 			    struct inode *, struct qstr *); | 
 | 813 | 	int	(*link)    (struct inode *, struct inode *, struct qstr *); | 
| Chuck Lever | 94a6d75 | 2006-08-22 20:06:23 -0400 | [diff] [blame] | 814 | 	int	(*symlink) (struct inode *, struct dentry *, struct page *, | 
 | 815 | 			    unsigned int, struct iattr *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 816 | 	int	(*mkdir)   (struct inode *, struct dentry *, struct iattr *); | 
 | 817 | 	int	(*rmdir)   (struct inode *, struct qstr *); | 
 | 818 | 	int	(*readdir) (struct dentry *, struct rpc_cred *, | 
 | 819 | 			    u64, struct page *, unsigned int, int); | 
 | 820 | 	int	(*mknod)   (struct inode *, struct dentry *, struct iattr *, | 
 | 821 | 			    dev_t); | 
 | 822 | 	int	(*statfs)  (struct nfs_server *, struct nfs_fh *, | 
 | 823 | 			    struct nfs_fsstat *); | 
 | 824 | 	int	(*fsinfo)  (struct nfs_server *, struct nfs_fh *, | 
 | 825 | 			    struct nfs_fsinfo *); | 
 | 826 | 	int	(*pathconf) (struct nfs_server *, struct nfs_fh *, | 
 | 827 | 			     struct nfs_pathconf *); | 
| David Howells | e9326dc | 2006-08-22 20:06:10 -0400 | [diff] [blame] | 828 | 	int	(*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 
| Al Viro | 0dbb4c6 | 2006-10-19 23:28:49 -0700 | [diff] [blame] | 829 | 	__be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus); | 
| Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 830 | 	void	(*read_setup)   (struct nfs_read_data *, struct rpc_message *); | 
| Trond Myklebust | ec06c09 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 831 | 	int	(*read_done)  (struct rpc_task *, struct nfs_read_data *); | 
| Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 832 | 	void	(*write_setup)  (struct nfs_write_data *, struct rpc_message *); | 
| Trond Myklebust | 788e7a8 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 833 | 	int	(*write_done)  (struct rpc_task *, struct nfs_write_data *); | 
| Trond Myklebust | bdc7f02 | 2007-07-14 15:40:00 -0400 | [diff] [blame] | 834 | 	void	(*commit_setup) (struct nfs_write_data *, struct rpc_message *); | 
| Trond Myklebust | 788e7a8 | 2006-03-20 13:44:27 -0500 | [diff] [blame] | 835 | 	int	(*commit_done) (struct rpc_task *, struct nfs_write_data *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 836 | 	int	(*lock)(struct file *, int, struct file_lock *); | 
| Trond Myklebust | 2116271 | 2008-05-20 19:34:39 -0400 | [diff] [blame] | 837 | 	int	(*lock_check_bounds)(const struct file_lock *); | 
| Trond Myklebust | ada70d9 | 2005-06-22 17:16:22 +0000 | [diff] [blame] | 838 | 	void	(*clear_acl_cache)(struct inode *); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 839 | }; | 
 | 840 |  | 
 | 841 | /* | 
 | 842 |  * 	NFS_CALL(getattr, inode, (fattr)); | 
 | 843 |  * into | 
 | 844 |  *	NFS_PROTO(inode)->getattr(fattr); | 
 | 845 |  */ | 
 | 846 | #define NFS_CALL(op, inode, args)	NFS_PROTO(inode)->op args | 
 | 847 |  | 
 | 848 | /* | 
 | 849 |  * Function vectors etc. for the NFS client | 
 | 850 |  */ | 
| David Howells | 509de81 | 2006-08-22 20:06:11 -0400 | [diff] [blame] | 851 | extern const struct nfs_rpc_ops	nfs_v2_clientops; | 
 | 852 | extern const struct nfs_rpc_ops	nfs_v3_clientops; | 
 | 853 | extern const struct nfs_rpc_ops	nfs_v4_clientops; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 854 | extern struct rpc_version	nfs_version2; | 
 | 855 | extern struct rpc_version	nfs_version3; | 
 | 856 | extern struct rpc_version	nfs_version4; | 
 | 857 |  | 
| Andreas Gruenbacher | b7fa055 | 2005-06-22 17:16:27 +0000 | [diff] [blame] | 858 | extern struct rpc_version	nfsacl_version3; | 
 | 859 | extern struct rpc_program	nfsacl_program; | 
 | 860 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 861 | #endif |