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