nfs_xdr.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427
  1. #ifndef _LINUX_NFS_XDR_H
  2. #define _LINUX_NFS_XDR_H
  3. #include <linux/nfsacl.h>
  4. #include <linux/sunrpc/gss_api.h>
  5. /*
  6. * To change the maximum rsize and wsize supported by the NFS client, adjust
  7. * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
  8. * support a megabyte or more. The default is left at 4096 bytes, which is
  9. * reasonable for NFS over UDP.
  10. */
  11. #define NFS_MAX_FILE_IO_SIZE (1048576U)
  12. #define NFS_DEF_FILE_IO_SIZE (4096U)
  13. #define NFS_MIN_FILE_IO_SIZE (1024U)
  14. /* Forward declaration for NFS v3 */
  15. struct nfs4_secinfo_flavors;
  16. struct nfs4_string {
  17. unsigned int len;
  18. char *data;
  19. };
  20. struct nfs_fsid {
  21. uint64_t major;
  22. uint64_t minor;
  23. };
  24. /*
  25. * Helper for checking equality between 2 fsids.
  26. */
  27. static inline int nfs_fsid_equal(const struct nfs_fsid *a, const struct nfs_fsid *b)
  28. {
  29. return a->major == b->major && a->minor == b->minor;
  30. }
  31. struct nfs_fattr {
  32. unsigned int valid; /* which fields are valid */
  33. umode_t mode;
  34. __u32 nlink;
  35. __u32 uid;
  36. __u32 gid;
  37. dev_t rdev;
  38. __u64 size;
  39. union {
  40. struct {
  41. __u32 blocksize;
  42. __u32 blocks;
  43. } nfs2;
  44. struct {
  45. __u64 used;
  46. } nfs3;
  47. } du;
  48. struct nfs_fsid fsid;
  49. __u64 fileid;
  50. __u64 mounted_on_fileid;
  51. struct timespec atime;
  52. struct timespec mtime;
  53. struct timespec ctime;
  54. __u64 change_attr; /* NFSv4 change attribute */
  55. __u64 pre_change_attr;/* pre-op NFSv4 change attribute */
  56. __u64 pre_size; /* pre_op_attr.size */
  57. struct timespec pre_mtime; /* pre_op_attr.mtime */
  58. struct timespec pre_ctime; /* pre_op_attr.ctime */
  59. unsigned long time_start;
  60. unsigned long gencount;
  61. struct nfs4_string *owner_name;
  62. struct nfs4_string *group_name;
  63. };
  64. #define NFS_ATTR_FATTR_TYPE (1U << 0)
  65. #define NFS_ATTR_FATTR_MODE (1U << 1)
  66. #define NFS_ATTR_FATTR_NLINK (1U << 2)
  67. #define NFS_ATTR_FATTR_OWNER (1U << 3)
  68. #define NFS_ATTR_FATTR_GROUP (1U << 4)
  69. #define NFS_ATTR_FATTR_RDEV (1U << 5)
  70. #define NFS_ATTR_FATTR_SIZE (1U << 6)
  71. #define NFS_ATTR_FATTR_PRESIZE (1U << 7)
  72. #define NFS_ATTR_FATTR_BLOCKS_USED (1U << 8)
  73. #define NFS_ATTR_FATTR_SPACE_USED (1U << 9)
  74. #define NFS_ATTR_FATTR_FSID (1U << 10)
  75. #define NFS_ATTR_FATTR_FILEID (1U << 11)
  76. #define NFS_ATTR_FATTR_ATIME (1U << 12)
  77. #define NFS_ATTR_FATTR_MTIME (1U << 13)
  78. #define NFS_ATTR_FATTR_CTIME (1U << 14)
  79. #define NFS_ATTR_FATTR_PREMTIME (1U << 15)
  80. #define NFS_ATTR_FATTR_PRECTIME (1U << 16)
  81. #define NFS_ATTR_FATTR_CHANGE (1U << 17)
  82. #define NFS_ATTR_FATTR_PRECHANGE (1U << 18)
  83. #define NFS_ATTR_FATTR_V4_LOCATIONS (1U << 19)
  84. #define NFS_ATTR_FATTR_V4_REFERRAL (1U << 20)
  85. #define NFS_ATTR_FATTR_MOUNTPOINT (1U << 21)
  86. #define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
  87. #define NFS_ATTR_FATTR_OWNER_NAME (1U << 23)
  88. #define NFS_ATTR_FATTR_GROUP_NAME (1U << 24)
  89. #define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
  90. | NFS_ATTR_FATTR_MODE \
  91. | NFS_ATTR_FATTR_NLINK \
  92. | NFS_ATTR_FATTR_OWNER \
  93. | NFS_ATTR_FATTR_GROUP \
  94. | NFS_ATTR_FATTR_RDEV \
  95. | NFS_ATTR_FATTR_SIZE \
  96. | NFS_ATTR_FATTR_FSID \
  97. | NFS_ATTR_FATTR_FILEID \
  98. | NFS_ATTR_FATTR_ATIME \
  99. | NFS_ATTR_FATTR_MTIME \
  100. | NFS_ATTR_FATTR_CTIME \
  101. | NFS_ATTR_FATTR_CHANGE)
  102. #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
  103. | NFS_ATTR_FATTR_BLOCKS_USED)
  104. #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
  105. | NFS_ATTR_FATTR_SPACE_USED)
  106. #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
  107. | NFS_ATTR_FATTR_SPACE_USED)
  108. /*
  109. * Info on the file system
  110. */
  111. struct nfs_fsinfo {
  112. struct nfs_fattr *fattr; /* Post-op attributes */
  113. __u32 rtmax; /* max. read transfer size */
  114. __u32 rtpref; /* pref. read transfer size */
  115. __u32 rtmult; /* reads should be multiple of this */
  116. __u32 wtmax; /* max. write transfer size */
  117. __u32 wtpref; /* pref. write transfer size */
  118. __u32 wtmult; /* writes should be multiple of this */
  119. __u32 dtpref; /* pref. readdir transfer size */
  120. __u64 maxfilesize;
  121. struct timespec time_delta; /* server time granularity */
  122. __u32 lease_time; /* in seconds */
  123. __u32 layouttype; /* supported pnfs layout driver */
  124. __u32 blksize; /* preferred pnfs io block size */
  125. };
  126. struct nfs_fsstat {
  127. struct nfs_fattr *fattr; /* Post-op attributes */
  128. __u64 tbytes; /* total size in bytes */
  129. __u64 fbytes; /* # of free bytes */
  130. __u64 abytes; /* # of bytes available to user */
  131. __u64 tfiles; /* # of files */
  132. __u64 ffiles; /* # of free files */
  133. __u64 afiles; /* # of files available to user */
  134. };
  135. struct nfs2_fsstat {
  136. __u32 tsize; /* Server transfer size */
  137. __u32 bsize; /* Filesystem block size */
  138. __u32 blocks; /* No. of "bsize" blocks on filesystem */
  139. __u32 bfree; /* No. of free "bsize" blocks */
  140. __u32 bavail; /* No. of available "bsize" blocks */
  141. };
  142. struct nfs_pathconf {
  143. struct nfs_fattr *fattr; /* Post-op attributes */
  144. __u32 max_link; /* max # of hard links */
  145. __u32 max_namelen; /* max name length */
  146. };
  147. struct nfs4_change_info {
  148. u32 atomic;
  149. u64 before;
  150. u64 after;
  151. };
  152. struct nfs_seqid;
  153. /* nfs41 sessions channel attributes */
  154. struct nfs4_channel_attrs {
  155. u32 max_rqst_sz;
  156. u32 max_resp_sz;
  157. u32 max_resp_sz_cached;
  158. u32 max_ops;
  159. u32 max_reqs;
  160. };
  161. /* nfs41 sessions slot seqid */
  162. struct nfs4_slot {
  163. u32 seq_nr;
  164. };
  165. struct nfs4_sequence_args {
  166. struct nfs4_session *sa_session;
  167. u32 sa_slotid;
  168. u8 sa_cache_this;
  169. };
  170. struct nfs4_sequence_res {
  171. struct nfs4_session *sr_session;
  172. struct nfs4_slot *sr_slot; /* slot used to send request */
  173. int sr_status; /* sequence operation status */
  174. unsigned long sr_renewal_time;
  175. u32 sr_status_flags;
  176. };
  177. struct nfs4_get_lease_time_args {
  178. struct nfs4_sequence_args la_seq_args;
  179. };
  180. struct nfs4_get_lease_time_res {
  181. struct nfs_fsinfo *lr_fsinfo;
  182. struct nfs4_sequence_res lr_seq_res;
  183. };
  184. #define PNFS_LAYOUT_MAXSIZE 4096
  185. struct nfs4_layoutdriver_data {
  186. struct page **pages;
  187. __u32 pglen;
  188. __u32 len;
  189. };
  190. struct pnfs_layout_range {
  191. u32 iomode;
  192. u64 offset;
  193. u64 length;
  194. };
  195. struct nfs4_layoutget_args {
  196. __u32 type;
  197. struct pnfs_layout_range range;
  198. __u64 minlength;
  199. __u32 maxcount;
  200. struct inode *inode;
  201. struct nfs_open_context *ctx;
  202. struct nfs4_sequence_args seq_args;
  203. nfs4_stateid stateid;
  204. struct nfs4_layoutdriver_data layout;
  205. };
  206. struct nfs4_layoutget_res {
  207. __u32 return_on_close;
  208. struct pnfs_layout_range range;
  209. __u32 type;
  210. nfs4_stateid stateid;
  211. struct nfs4_sequence_res seq_res;
  212. struct nfs4_layoutdriver_data *layoutp;
  213. };
  214. struct nfs4_layoutget {
  215. struct nfs4_layoutget_args args;
  216. struct nfs4_layoutget_res res;
  217. struct pnfs_layout_segment **lsegpp;
  218. gfp_t gfp_flags;
  219. };
  220. struct nfs4_getdevicelist_args {
  221. const struct nfs_fh *fh;
  222. u32 layoutclass;
  223. struct nfs4_sequence_args seq_args;
  224. };
  225. struct nfs4_getdevicelist_res {
  226. struct pnfs_devicelist *devlist;
  227. struct nfs4_sequence_res seq_res;
  228. };
  229. struct nfs4_getdeviceinfo_args {
  230. struct pnfs_device *pdev;
  231. struct nfs4_sequence_args seq_args;
  232. };
  233. struct nfs4_getdeviceinfo_res {
  234. struct pnfs_device *pdev;
  235. struct nfs4_sequence_res seq_res;
  236. };
  237. struct nfs4_layoutcommit_args {
  238. nfs4_stateid stateid;
  239. __u64 lastbytewritten;
  240. struct inode *inode;
  241. const u32 *bitmask;
  242. struct nfs4_sequence_args seq_args;
  243. };
  244. struct nfs4_layoutcommit_res {
  245. struct nfs_fattr *fattr;
  246. const struct nfs_server *server;
  247. struct nfs4_sequence_res seq_res;
  248. int status;
  249. };
  250. struct nfs4_layoutcommit_data {
  251. struct rpc_task task;
  252. struct nfs_fattr fattr;
  253. struct list_head lseg_list;
  254. struct rpc_cred *cred;
  255. struct nfs4_layoutcommit_args args;
  256. struct nfs4_layoutcommit_res res;
  257. };
  258. struct nfs4_layoutreturn_args {
  259. struct pnfs_layout_hdr *layout;
  260. struct inode *inode;
  261. nfs4_stateid stateid;
  262. __u32 layout_type;
  263. struct nfs4_sequence_args seq_args;
  264. };
  265. struct nfs4_layoutreturn_res {
  266. struct nfs4_sequence_res seq_res;
  267. u32 lrs_present;
  268. nfs4_stateid stateid;
  269. };
  270. struct nfs4_layoutreturn {
  271. struct nfs4_layoutreturn_args args;
  272. struct nfs4_layoutreturn_res res;
  273. struct rpc_cred *cred;
  274. struct nfs_client *clp;
  275. int rpc_status;
  276. };
  277. struct stateowner_id {
  278. __u64 create_time;
  279. __u32 uniquifier;
  280. };
  281. /*
  282. * Arguments to the open call.
  283. */
  284. struct nfs_openargs {
  285. const struct nfs_fh * fh;
  286. struct nfs_seqid * seqid;
  287. int open_flags;
  288. fmode_t fmode;
  289. __u64 clientid;
  290. struct stateowner_id id;
  291. union {
  292. struct {
  293. struct iattr * attrs; /* UNCHECKED, GUARDED */
  294. nfs4_verifier verifier; /* EXCLUSIVE */
  295. };
  296. nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
  297. fmode_t delegation_type; /* CLAIM_PREVIOUS */
  298. } u;
  299. const struct qstr * name;
  300. const struct nfs_server *server; /* Needed for ID mapping */
  301. const u32 * bitmask;
  302. __u32 claim;
  303. struct nfs4_sequence_args seq_args;
  304. };
  305. struct nfs_openres {
  306. nfs4_stateid stateid;
  307. struct nfs_fh fh;
  308. struct nfs4_change_info cinfo;
  309. __u32 rflags;
  310. struct nfs_fattr * f_attr;
  311. struct nfs_seqid * seqid;
  312. const struct nfs_server *server;
  313. fmode_t delegation_type;
  314. nfs4_stateid delegation;
  315. __u32 do_recall;
  316. __u64 maxsize;
  317. __u32 attrset[NFS4_BITMAP_SIZE];
  318. struct nfs4_string *owner;
  319. struct nfs4_string *group_owner;
  320. struct nfs4_sequence_res seq_res;
  321. };
  322. /*
  323. * Arguments to the open_confirm call.
  324. */
  325. struct nfs_open_confirmargs {
  326. const struct nfs_fh * fh;
  327. nfs4_stateid * stateid;
  328. struct nfs_seqid * seqid;
  329. };
  330. struct nfs_open_confirmres {
  331. nfs4_stateid stateid;
  332. struct nfs_seqid * seqid;
  333. };
  334. /*
  335. * Arguments to the close call.
  336. */
  337. struct nfs_closeargs {
  338. struct nfs_fh * fh;
  339. nfs4_stateid * stateid;
  340. struct nfs_seqid * seqid;
  341. fmode_t fmode;
  342. const u32 * bitmask;
  343. struct nfs4_sequence_args seq_args;
  344. };
  345. struct nfs_closeres {
  346. nfs4_stateid stateid;
  347. struct nfs_fattr * fattr;
  348. struct nfs_seqid * seqid;
  349. const struct nfs_server *server;
  350. struct nfs4_sequence_res seq_res;
  351. };
  352. /*
  353. * * Arguments to the lock,lockt, and locku call.
  354. * */
  355. struct nfs_lowner {
  356. __u64 clientid;
  357. __u64 id;
  358. dev_t s_dev;
  359. };
  360. struct nfs_lock_args {
  361. struct nfs_fh * fh;
  362. struct file_lock * fl;
  363. struct nfs_seqid * lock_seqid;
  364. nfs4_stateid * lock_stateid;
  365. struct nfs_seqid * open_seqid;
  366. nfs4_stateid * open_stateid;
  367. struct nfs_lowner lock_owner;
  368. unsigned char block : 1;
  369. unsigned char reclaim : 1;
  370. unsigned char new_lock_owner : 1;
  371. struct nfs4_sequence_args seq_args;
  372. };
  373. struct nfs_lock_res {
  374. nfs4_stateid stateid;
  375. struct nfs_seqid * lock_seqid;
  376. struct nfs_seqid * open_seqid;
  377. struct nfs4_sequence_res seq_res;
  378. };
  379. struct nfs_locku_args {
  380. struct nfs_fh * fh;
  381. struct file_lock * fl;
  382. struct nfs_seqid * seqid;
  383. nfs4_stateid * stateid;
  384. struct nfs4_sequence_args seq_args;
  385. };
  386. struct nfs_locku_res {
  387. nfs4_stateid stateid;
  388. struct nfs_seqid * seqid;
  389. struct nfs4_sequence_res seq_res;
  390. };
  391. struct nfs_lockt_args {
  392. struct nfs_fh * fh;
  393. struct file_lock * fl;
  394. struct nfs_lowner lock_owner;
  395. struct nfs4_sequence_args seq_args;
  396. };
  397. struct nfs_lockt_res {
  398. struct file_lock * denied; /* LOCK, LOCKT failed */
  399. struct nfs4_sequence_res seq_res;
  400. };
  401. struct nfs_release_lockowner_args {
  402. struct nfs_lowner lock_owner;
  403. };
  404. struct nfs4_delegreturnargs {
  405. const struct nfs_fh *fhandle;
  406. const nfs4_stateid *stateid;
  407. const u32 * bitmask;
  408. struct nfs4_sequence_args seq_args;
  409. };
  410. struct nfs4_delegreturnres {
  411. struct nfs_fattr * fattr;
  412. const struct nfs_server *server;
  413. struct nfs4_sequence_res seq_res;
  414. };
  415. /*
  416. * Arguments to the read call.
  417. */
  418. struct nfs_readargs {
  419. struct nfs_fh * fh;
  420. struct nfs_open_context *context;
  421. struct nfs_lock_context *lock_context;
  422. __u64 offset;
  423. __u32 count;
  424. unsigned int pgbase;
  425. struct page ** pages;
  426. struct nfs4_sequence_args seq_args;
  427. };
  428. struct nfs_readres {
  429. struct nfs_fattr * fattr;
  430. __u32 count;
  431. int eof;
  432. struct nfs4_sequence_res seq_res;
  433. };
  434. /*
  435. * Arguments to the write call.
  436. */
  437. struct nfs_writeargs {
  438. struct nfs_fh * fh;
  439. struct nfs_open_context *context;
  440. struct nfs_lock_context *lock_context;
  441. __u64 offset;
  442. __u32 count;
  443. enum nfs3_stable_how stable;
  444. unsigned int pgbase;
  445. struct page ** pages;
  446. const u32 * bitmask;
  447. struct nfs4_sequence_args seq_args;
  448. };
  449. struct nfs_writeverf {
  450. enum nfs3_stable_how committed;
  451. __be32 verifier[2];
  452. };
  453. struct nfs_writeres {
  454. struct nfs_fattr * fattr;
  455. struct nfs_writeverf * verf;
  456. __u32 count;
  457. const struct nfs_server *server;
  458. struct nfs4_sequence_res seq_res;
  459. };
  460. /*
  461. * Arguments to the commit call.
  462. */
  463. struct nfs_commitargs {
  464. struct nfs_fh *fh;
  465. __u64 offset;
  466. __u32 count;
  467. const u32 *bitmask;
  468. struct nfs4_sequence_args seq_args;
  469. };
  470. struct nfs_commitres {
  471. struct nfs_fattr *fattr;
  472. struct nfs_writeverf *verf;
  473. const struct nfs_server *server;
  474. struct nfs4_sequence_res seq_res;
  475. };
  476. /*
  477. * Common arguments to the unlink call
  478. */
  479. struct nfs_removeargs {
  480. const struct nfs_fh *fh;
  481. struct qstr name;
  482. const u32 * bitmask;
  483. struct nfs4_sequence_args seq_args;
  484. };
  485. struct nfs_removeres {
  486. const struct nfs_server *server;
  487. struct nfs_fattr *dir_attr;
  488. struct nfs4_change_info cinfo;
  489. struct nfs4_sequence_res seq_res;
  490. };
  491. /*
  492. * Common arguments to the rename call
  493. */
  494. struct nfs_renameargs {
  495. const struct nfs_fh *old_dir;
  496. const struct nfs_fh *new_dir;
  497. const struct qstr *old_name;
  498. const struct qstr *new_name;
  499. const u32 *bitmask;
  500. struct nfs4_sequence_args seq_args;
  501. };
  502. struct nfs_renameres {
  503. const struct nfs_server *server;
  504. struct nfs4_change_info old_cinfo;
  505. struct nfs_fattr *old_fattr;
  506. struct nfs4_change_info new_cinfo;
  507. struct nfs_fattr *new_fattr;
  508. struct nfs4_sequence_res seq_res;
  509. };
  510. /*
  511. * Argument struct for decode_entry function
  512. */
  513. struct nfs_entry {
  514. __u64 ino;
  515. __u64 cookie,
  516. prev_cookie;
  517. const char * name;
  518. unsigned int len;
  519. int eof;
  520. struct nfs_fh * fh;
  521. struct nfs_fattr * fattr;
  522. unsigned char d_type;
  523. struct nfs_server * server;
  524. };
  525. /*
  526. * The following types are for NFSv2 only.
  527. */
  528. struct nfs_sattrargs {
  529. struct nfs_fh * fh;
  530. struct iattr * sattr;
  531. };
  532. struct nfs_diropargs {
  533. struct nfs_fh * fh;
  534. const char * name;
  535. unsigned int len;
  536. };
  537. struct nfs_createargs {
  538. struct nfs_fh * fh;
  539. const char * name;
  540. unsigned int len;
  541. struct iattr * sattr;
  542. };
  543. struct nfs_setattrargs {
  544. struct nfs_fh * fh;
  545. nfs4_stateid stateid;
  546. struct iattr * iap;
  547. const struct nfs_server * server; /* Needed for name mapping */
  548. const u32 * bitmask;
  549. struct nfs4_sequence_args seq_args;
  550. };
  551. struct nfs_setaclargs {
  552. struct nfs_fh * fh;
  553. size_t acl_len;
  554. unsigned int acl_pgbase;
  555. struct page ** acl_pages;
  556. struct nfs4_sequence_args seq_args;
  557. };
  558. struct nfs_setaclres {
  559. struct nfs4_sequence_res seq_res;
  560. };
  561. struct nfs_getaclargs {
  562. struct nfs_fh * fh;
  563. size_t acl_len;
  564. unsigned int acl_pgbase;
  565. struct page ** acl_pages;
  566. struct nfs4_sequence_args seq_args;
  567. };
  568. /* getxattr ACL interface flags */
  569. #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */
  570. struct nfs_getaclres {
  571. size_t acl_len;
  572. size_t acl_data_offset;
  573. int acl_flags;
  574. struct page * acl_scratch;
  575. struct nfs4_sequence_res seq_res;
  576. };
  577. struct nfs_setattrres {
  578. struct nfs_fattr * fattr;
  579. const struct nfs_server * server;
  580. struct nfs4_sequence_res seq_res;
  581. };
  582. struct nfs_linkargs {
  583. struct nfs_fh * fromfh;
  584. struct nfs_fh * tofh;
  585. const char * toname;
  586. unsigned int tolen;
  587. };
  588. struct nfs_symlinkargs {
  589. struct nfs_fh * fromfh;
  590. const char * fromname;
  591. unsigned int fromlen;
  592. struct page ** pages;
  593. unsigned int pathlen;
  594. struct iattr * sattr;
  595. };
  596. struct nfs_readdirargs {
  597. struct nfs_fh * fh;
  598. __u32 cookie;
  599. unsigned int count;
  600. struct page ** pages;
  601. };
  602. struct nfs3_getaclargs {
  603. struct nfs_fh * fh;
  604. int mask;
  605. struct page ** pages;
  606. };
  607. struct nfs3_setaclargs {
  608. struct inode * inode;
  609. int mask;
  610. struct posix_acl * acl_access;
  611. struct posix_acl * acl_default;
  612. size_t len;
  613. unsigned int npages;
  614. struct page ** pages;
  615. };
  616. struct nfs_diropok {
  617. struct nfs_fh * fh;
  618. struct nfs_fattr * fattr;
  619. };
  620. struct nfs_readlinkargs {
  621. struct nfs_fh * fh;
  622. unsigned int pgbase;
  623. unsigned int pglen;
  624. struct page ** pages;
  625. };
  626. struct nfs3_sattrargs {
  627. struct nfs_fh * fh;
  628. struct iattr * sattr;
  629. unsigned int guard;
  630. struct timespec guardtime;
  631. };
  632. struct nfs3_diropargs {
  633. struct nfs_fh * fh;
  634. const char * name;
  635. unsigned int len;
  636. };
  637. struct nfs3_accessargs {
  638. struct nfs_fh * fh;
  639. __u32 access;
  640. };
  641. struct nfs3_createargs {
  642. struct nfs_fh * fh;
  643. const char * name;
  644. unsigned int len;
  645. struct iattr * sattr;
  646. enum nfs3_createmode createmode;
  647. __be32 verifier[2];
  648. };
  649. struct nfs3_mkdirargs {
  650. struct nfs_fh * fh;
  651. const char * name;
  652. unsigned int len;
  653. struct iattr * sattr;
  654. };
  655. struct nfs3_symlinkargs {
  656. struct nfs_fh * fromfh;
  657. const char * fromname;
  658. unsigned int fromlen;
  659. struct page ** pages;
  660. unsigned int pathlen;
  661. struct iattr * sattr;
  662. };
  663. struct nfs3_mknodargs {
  664. struct nfs_fh * fh;
  665. const char * name;
  666. unsigned int len;
  667. enum nfs3_ftype type;
  668. struct iattr * sattr;
  669. dev_t rdev;
  670. };
  671. struct nfs3_linkargs {
  672. struct nfs_fh * fromfh;
  673. struct nfs_fh * tofh;
  674. const char * toname;
  675. unsigned int tolen;
  676. };
  677. struct nfs3_readdirargs {
  678. struct nfs_fh * fh;
  679. __u64 cookie;
  680. __be32 verf[2];
  681. int plus;
  682. unsigned int count;
  683. struct page ** pages;
  684. };
  685. struct nfs3_diropres {
  686. struct nfs_fattr * dir_attr;
  687. struct nfs_fh * fh;
  688. struct nfs_fattr * fattr;
  689. };
  690. struct nfs3_accessres {
  691. struct nfs_fattr * fattr;
  692. __u32 access;
  693. };
  694. struct nfs3_readlinkargs {
  695. struct nfs_fh * fh;
  696. unsigned int pgbase;
  697. unsigned int pglen;
  698. struct page ** pages;
  699. };
  700. struct nfs3_linkres {
  701. struct nfs_fattr * dir_attr;
  702. struct nfs_fattr * fattr;
  703. };
  704. struct nfs3_readdirres {
  705. struct nfs_fattr * dir_attr;
  706. __be32 * verf;
  707. int plus;
  708. };
  709. struct nfs3_getaclres {
  710. struct nfs_fattr * fattr;
  711. int mask;
  712. unsigned int acl_access_count;
  713. unsigned int acl_default_count;
  714. struct posix_acl * acl_access;
  715. struct posix_acl * acl_default;
  716. };
  717. #ifdef CONFIG_NFS_V4
  718. typedef u64 clientid4;
  719. struct nfs4_accessargs {
  720. const struct nfs_fh * fh;
  721. const u32 * bitmask;
  722. u32 access;
  723. struct nfs4_sequence_args seq_args;
  724. };
  725. struct nfs4_accessres {
  726. const struct nfs_server * server;
  727. struct nfs_fattr * fattr;
  728. u32 supported;
  729. u32 access;
  730. struct nfs4_sequence_res seq_res;
  731. };
  732. struct nfs4_create_arg {
  733. u32 ftype;
  734. union {
  735. struct {
  736. struct page ** pages;
  737. unsigned int len;
  738. } symlink; /* NF4LNK */
  739. struct {
  740. u32 specdata1;
  741. u32 specdata2;
  742. } device; /* NF4BLK, NF4CHR */
  743. } u;
  744. const struct qstr * name;
  745. const struct nfs_server * server;
  746. const struct iattr * attrs;
  747. const struct nfs_fh * dir_fh;
  748. const u32 * bitmask;
  749. struct nfs4_sequence_args seq_args;
  750. };
  751. struct nfs4_create_res {
  752. const struct nfs_server * server;
  753. struct nfs_fh * fh;
  754. struct nfs_fattr * fattr;
  755. struct nfs4_change_info dir_cinfo;
  756. struct nfs_fattr * dir_fattr;
  757. struct nfs4_sequence_res seq_res;
  758. };
  759. struct nfs4_fsinfo_arg {
  760. const struct nfs_fh * fh;
  761. const u32 * bitmask;
  762. struct nfs4_sequence_args seq_args;
  763. };
  764. struct nfs4_fsinfo_res {
  765. struct nfs_fsinfo *fsinfo;
  766. struct nfs4_sequence_res seq_res;
  767. };
  768. struct nfs4_getattr_arg {
  769. const struct nfs_fh * fh;
  770. const u32 * bitmask;
  771. struct nfs4_sequence_args seq_args;
  772. };
  773. struct nfs4_getattr_res {
  774. const struct nfs_server * server;
  775. struct nfs_fattr * fattr;
  776. struct nfs4_sequence_res seq_res;
  777. };
  778. struct nfs4_link_arg {
  779. const struct nfs_fh * fh;
  780. const struct nfs_fh * dir_fh;
  781. const struct qstr * name;
  782. const u32 * bitmask;
  783. struct nfs4_sequence_args seq_args;
  784. };
  785. struct nfs4_link_res {
  786. const struct nfs_server * server;
  787. struct nfs_fattr * fattr;
  788. struct nfs4_change_info cinfo;
  789. struct nfs_fattr * dir_attr;
  790. struct nfs4_sequence_res seq_res;
  791. };
  792. struct nfs4_lookup_arg {
  793. const struct nfs_fh * dir_fh;
  794. const struct qstr * name;
  795. const u32 * bitmask;
  796. struct nfs4_sequence_args seq_args;
  797. };
  798. struct nfs4_lookup_res {
  799. const struct nfs_server * server;
  800. struct nfs_fattr * fattr;
  801. struct nfs_fh * fh;
  802. struct nfs4_sequence_res seq_res;
  803. };
  804. struct nfs4_lookup_root_arg {
  805. const u32 * bitmask;
  806. struct nfs4_sequence_args seq_args;
  807. };
  808. struct nfs4_pathconf_arg {
  809. const struct nfs_fh * fh;
  810. const u32 * bitmask;
  811. struct nfs4_sequence_args seq_args;
  812. };
  813. struct nfs4_pathconf_res {
  814. struct nfs_pathconf *pathconf;
  815. struct nfs4_sequence_res seq_res;
  816. };
  817. struct nfs4_readdir_arg {
  818. const struct nfs_fh * fh;
  819. u64 cookie;
  820. nfs4_verifier verifier;
  821. u32 count;
  822. struct page ** pages; /* zero-copy data */
  823. unsigned int pgbase; /* zero-copy data */
  824. const u32 * bitmask;
  825. int plus;
  826. struct nfs4_sequence_args seq_args;
  827. };
  828. struct nfs4_readdir_res {
  829. nfs4_verifier verifier;
  830. unsigned int pgbase;
  831. struct nfs4_sequence_res seq_res;
  832. };
  833. struct nfs4_readlink {
  834. const struct nfs_fh * fh;
  835. unsigned int pgbase;
  836. unsigned int pglen; /* zero-copy data */
  837. struct page ** pages; /* zero-copy data */
  838. struct nfs4_sequence_args seq_args;
  839. };
  840. struct nfs4_readlink_res {
  841. struct nfs4_sequence_res seq_res;
  842. };
  843. #define NFS4_SETCLIENTID_NAMELEN (127)
  844. struct nfs4_setclientid {
  845. const nfs4_verifier * sc_verifier;
  846. unsigned int sc_name_len;
  847. char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
  848. u32 sc_prog;
  849. unsigned int sc_netid_len;
  850. char sc_netid[RPCBIND_MAXNETIDLEN + 1];
  851. unsigned int sc_uaddr_len;
  852. char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
  853. u32 sc_cb_ident;
  854. };
  855. struct nfs4_setclientid_res {
  856. u64 clientid;
  857. nfs4_verifier confirm;
  858. };
  859. struct nfs4_statfs_arg {
  860. const struct nfs_fh * fh;
  861. const u32 * bitmask;
  862. struct nfs4_sequence_args seq_args;
  863. };
  864. struct nfs4_statfs_res {
  865. struct nfs_fsstat *fsstat;
  866. struct nfs4_sequence_res seq_res;
  867. };
  868. struct nfs4_server_caps_arg {
  869. struct nfs_fh *fhandle;
  870. struct nfs4_sequence_args seq_args;
  871. };
  872. struct nfs4_server_caps_res {
  873. u32 attr_bitmask[3];
  874. u32 acl_bitmask;
  875. u32 has_links;
  876. u32 has_symlinks;
  877. u32 fh_expire_type;
  878. struct nfs4_sequence_res seq_res;
  879. };
  880. #define NFS4_PATHNAME_MAXCOMPONENTS 512
  881. struct nfs4_pathname {
  882. unsigned int ncomponents;
  883. struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
  884. };
  885. #define NFS4_FS_LOCATION_MAXSERVERS 10
  886. struct nfs4_fs_location {
  887. unsigned int nservers;
  888. struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
  889. struct nfs4_pathname rootpath;
  890. };
  891. #define NFS4_FS_LOCATIONS_MAXENTRIES 10
  892. struct nfs4_fs_locations {
  893. struct nfs_fattr fattr;
  894. const struct nfs_server *server;
  895. struct nfs4_pathname fs_path;
  896. int nlocations;
  897. struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
  898. };
  899. struct nfs4_fs_locations_arg {
  900. const struct nfs_fh *dir_fh;
  901. const struct qstr *name;
  902. struct page *page;
  903. const u32 *bitmask;
  904. struct nfs4_sequence_args seq_args;
  905. };
  906. struct nfs4_fs_locations_res {
  907. struct nfs4_fs_locations *fs_locations;
  908. struct nfs4_sequence_res seq_res;
  909. };
  910. struct nfs4_secinfo_oid {
  911. unsigned int len;
  912. char data[GSS_OID_MAX_LEN];
  913. };
  914. struct nfs4_secinfo_gss {
  915. struct nfs4_secinfo_oid sec_oid4;
  916. unsigned int qop4;
  917. unsigned int service;
  918. };
  919. struct nfs4_secinfo_flavor {
  920. unsigned int flavor;
  921. struct nfs4_secinfo_gss gss;
  922. };
  923. struct nfs4_secinfo_flavors {
  924. unsigned int num_flavors;
  925. struct nfs4_secinfo_flavor flavors[0];
  926. };
  927. struct nfs4_secinfo_arg {
  928. const struct nfs_fh *dir_fh;
  929. const struct qstr *name;
  930. struct nfs4_sequence_args seq_args;
  931. };
  932. struct nfs4_secinfo_res {
  933. struct nfs4_secinfo_flavors *flavors;
  934. struct nfs4_sequence_res seq_res;
  935. };
  936. #endif /* CONFIG_NFS_V4 */
  937. struct nfstime4 {
  938. u64 seconds;
  939. u32 nseconds;
  940. };
  941. #ifdef CONFIG_NFS_V4_1
  942. struct pnfs_commit_bucket {
  943. struct list_head written;
  944. struct list_head committing;
  945. struct pnfs_layout_segment *wlseg;
  946. struct pnfs_layout_segment *clseg;
  947. };
  948. struct pnfs_ds_commit_info {
  949. int nwritten;
  950. int ncommitting;
  951. int nbuckets;
  952. struct pnfs_commit_bucket *buckets;
  953. };
  954. #define NFS4_EXCHANGE_ID_LEN (48)
  955. struct nfs41_exchange_id_args {
  956. struct nfs_client *client;
  957. nfs4_verifier *verifier;
  958. unsigned int id_len;
  959. char id[NFS4_EXCHANGE_ID_LEN];
  960. u32 flags;
  961. };
  962. struct server_owner {
  963. uint64_t minor_id;
  964. uint32_t major_id_sz;
  965. char major_id[NFS4_OPAQUE_LIMIT];
  966. };
  967. struct server_scope {
  968. uint32_t server_scope_sz;
  969. char server_scope[NFS4_OPAQUE_LIMIT];
  970. };
  971. struct nfs41_impl_id {
  972. char domain[NFS4_OPAQUE_LIMIT + 1];
  973. char name[NFS4_OPAQUE_LIMIT + 1];
  974. struct nfstime4 date;
  975. };
  976. struct nfs41_exchange_id_res {
  977. struct nfs_client *client;
  978. u32 flags;
  979. struct server_scope *server_scope;
  980. struct nfs41_impl_id *impl_id;
  981. };
  982. struct nfs41_create_session_args {
  983. struct nfs_client *client;
  984. uint32_t flags;
  985. uint32_t cb_program;
  986. struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
  987. struct nfs4_channel_attrs bc_attrs; /* Back Channel */
  988. };
  989. struct nfs41_create_session_res {
  990. struct nfs_client *client;
  991. };
  992. struct nfs41_reclaim_complete_args {
  993. /* In the future extend to include curr_fh for use with migration */
  994. unsigned char one_fs:1;
  995. struct nfs4_sequence_args seq_args;
  996. };
  997. struct nfs41_reclaim_complete_res {
  998. struct nfs4_sequence_res seq_res;
  999. };
  1000. #define SECINFO_STYLE_CURRENT_FH 0
  1001. #define SECINFO_STYLE_PARENT 1
  1002. struct nfs41_secinfo_no_name_args {
  1003. int style;
  1004. struct nfs4_sequence_args seq_args;
  1005. };
  1006. struct nfs41_test_stateid_args {
  1007. nfs4_stateid *stateid;
  1008. struct nfs4_sequence_args seq_args;
  1009. };
  1010. struct nfs41_test_stateid_res {
  1011. unsigned int status;
  1012. struct nfs4_sequence_res seq_res;
  1013. };
  1014. struct nfs41_free_stateid_args {
  1015. nfs4_stateid *stateid;
  1016. struct nfs4_sequence_args seq_args;
  1017. };
  1018. struct nfs41_free_stateid_res {
  1019. unsigned int status;
  1020. struct nfs4_sequence_res seq_res;
  1021. };
  1022. #else
  1023. struct pnfs_ds_commit_info {
  1024. };
  1025. #endif /* CONFIG_NFS_V4_1 */
  1026. struct nfs_page;
  1027. #define NFS_PAGEVEC_SIZE (8U)
  1028. struct nfs_page_array {
  1029. struct page **pagevec;
  1030. unsigned int npages; /* Max length of pagevec */
  1031. struct page *page_array[NFS_PAGEVEC_SIZE];
  1032. };
  1033. struct nfs_read_data {
  1034. struct nfs_pgio_header *header;
  1035. struct list_head list;
  1036. struct rpc_task task;
  1037. struct nfs_fattr fattr; /* fattr storage */
  1038. struct nfs_readargs args;
  1039. struct nfs_readres res;
  1040. unsigned long timestamp; /* For lease renewal */
  1041. int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
  1042. __u64 mds_offset;
  1043. struct nfs_page_array pages;
  1044. struct nfs_client *ds_clp; /* pNFS data server */
  1045. };
  1046. /* used as flag bits in nfs_pgio_header */
  1047. enum {
  1048. NFS_IOHDR_ERROR = 0,
  1049. NFS_IOHDR_EOF,
  1050. NFS_IOHDR_REDO,
  1051. NFS_IOHDR_NEED_COMMIT,
  1052. NFS_IOHDR_NEED_RESCHED,
  1053. };
  1054. struct nfs_pgio_header {
  1055. struct inode *inode;
  1056. struct rpc_cred *cred;
  1057. struct list_head pages;
  1058. struct list_head rpc_list;
  1059. atomic_t refcnt;
  1060. struct nfs_page *req;
  1061. struct pnfs_layout_segment *lseg;
  1062. loff_t io_start;
  1063. const struct rpc_call_ops *mds_ops;
  1064. void (*release) (struct nfs_pgio_header *hdr);
  1065. const struct nfs_pgio_completion_ops *completion_ops;
  1066. struct nfs_direct_req *dreq;
  1067. spinlock_t lock;
  1068. /* fields protected by lock */
  1069. int pnfs_error;
  1070. int error; /* merge with pnfs_error */
  1071. unsigned long good_bytes; /* boundary of good data */
  1072. unsigned long flags;
  1073. };
  1074. struct nfs_read_header {
  1075. struct nfs_pgio_header header;
  1076. struct nfs_read_data rpc_data;
  1077. };
  1078. struct nfs_write_data {
  1079. struct nfs_pgio_header *header;
  1080. struct list_head list;
  1081. struct rpc_task task;
  1082. struct nfs_fattr fattr;
  1083. struct nfs_writeverf verf;
  1084. struct nfs_writeargs args; /* argument struct */
  1085. struct nfs_writeres res; /* result struct */
  1086. unsigned long timestamp; /* For lease renewal */
  1087. int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
  1088. __u64 mds_offset; /* Filelayout dense stripe */
  1089. struct nfs_page_array pages;
  1090. struct nfs_client *ds_clp; /* pNFS data server */
  1091. };
  1092. struct nfs_write_header {
  1093. struct nfs_pgio_header header;
  1094. struct nfs_write_data rpc_data;
  1095. };
  1096. struct nfs_mds_commit_info {
  1097. atomic_t rpcs_out;
  1098. unsigned long ncommit;
  1099. struct list_head list;
  1100. };
  1101. struct nfs_commit_data;
  1102. struct nfs_inode;
  1103. struct nfs_commit_completion_ops {
  1104. void (*error_cleanup) (struct nfs_inode *nfsi);
  1105. void (*completion) (struct nfs_commit_data *data);
  1106. };
  1107. struct nfs_commit_info {
  1108. spinlock_t *lock;
  1109. struct nfs_mds_commit_info *mds;
  1110. struct pnfs_ds_commit_info *ds;
  1111. struct nfs_direct_req *dreq; /* O_DIRECT request */
  1112. const struct nfs_commit_completion_ops *completion_ops;
  1113. };
  1114. struct nfs_commit_data {
  1115. struct rpc_task task;
  1116. struct inode *inode;
  1117. struct rpc_cred *cred;
  1118. struct nfs_fattr fattr;
  1119. struct nfs_writeverf verf;
  1120. struct list_head pages; /* Coalesced requests we wish to flush */
  1121. struct list_head list; /* lists of struct nfs_write_data */
  1122. struct nfs_direct_req *dreq; /* O_DIRECT request */
  1123. struct nfs_commitargs args; /* argument struct */
  1124. struct nfs_commitres res; /* result struct */
  1125. struct nfs_open_context *context;
  1126. struct pnfs_layout_segment *lseg;
  1127. struct nfs_client *ds_clp; /* pNFS data server */
  1128. int ds_commit_index;
  1129. const struct rpc_call_ops *mds_ops;
  1130. const struct nfs_commit_completion_ops *completion_ops;
  1131. int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
  1132. };
  1133. struct nfs_pgio_completion_ops {
  1134. void (*error_cleanup)(struct list_head *head);
  1135. void (*init_hdr)(struct nfs_pgio_header *hdr);
  1136. void (*completion)(struct nfs_pgio_header *hdr);
  1137. };
  1138. struct nfs_unlinkdata {
  1139. struct hlist_node list;
  1140. struct nfs_removeargs args;
  1141. struct nfs_removeres res;
  1142. struct inode *dir;
  1143. struct rpc_cred *cred;
  1144. struct nfs_fattr dir_attr;
  1145. };
  1146. struct nfs_renamedata {
  1147. struct nfs_renameargs args;
  1148. struct nfs_renameres res;
  1149. struct rpc_cred *cred;
  1150. struct inode *old_dir;
  1151. struct dentry *old_dentry;
  1152. struct nfs_fattr old_fattr;
  1153. struct inode *new_dir;
  1154. struct dentry *new_dentry;
  1155. struct nfs_fattr new_fattr;
  1156. };
  1157. struct nfs_access_entry;
  1158. struct nfs_client;
  1159. struct rpc_timeout;
  1160. /*
  1161. * RPC procedure vector for NFSv2/NFSv3 demuxing
  1162. */
  1163. struct nfs_rpc_ops {
  1164. u32 version; /* Protocol version */
  1165. const struct dentry_operations *dentry_ops;
  1166. const struct inode_operations *dir_inode_ops;
  1167. const struct inode_operations *file_inode_ops;
  1168. const struct file_operations *file_ops;
  1169. int (*getroot) (struct nfs_server *, struct nfs_fh *,
  1170. struct nfs_fsinfo *);
  1171. struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
  1172. struct nfs_fh *, struct nfs_fattr *);
  1173. int (*getattr) (struct nfs_server *, struct nfs_fh *,
  1174. struct nfs_fattr *);
  1175. int (*setattr) (struct dentry *, struct nfs_fattr *,
  1176. struct iattr *);
  1177. int (*lookup) (struct inode *, struct qstr *,
  1178. struct nfs_fh *, struct nfs_fattr *);
  1179. int (*access) (struct inode *, struct nfs_access_entry *);
  1180. int (*readlink)(struct inode *, struct page *, unsigned int,
  1181. unsigned int);
  1182. int (*create) (struct inode *, struct dentry *,
  1183. struct iattr *, int, struct nfs_open_context *);
  1184. int (*remove) (struct inode *, struct qstr *);
  1185. void (*unlink_setup) (struct rpc_message *, struct inode *dir);
  1186. void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
  1187. int (*unlink_done) (struct rpc_task *, struct inode *);
  1188. int (*rename) (struct inode *, struct qstr *,
  1189. struct inode *, struct qstr *);
  1190. void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
  1191. void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
  1192. int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
  1193. int (*link) (struct inode *, struct inode *, struct qstr *);
  1194. int (*symlink) (struct inode *, struct dentry *, struct page *,
  1195. unsigned int, struct iattr *);
  1196. int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
  1197. int (*rmdir) (struct inode *, struct qstr *);
  1198. int (*readdir) (struct dentry *, struct rpc_cred *,
  1199. u64, struct page **, unsigned int, int);
  1200. int (*mknod) (struct inode *, struct dentry *, struct iattr *,
  1201. dev_t);
  1202. int (*statfs) (struct nfs_server *, struct nfs_fh *,
  1203. struct nfs_fsstat *);
  1204. int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
  1205. struct nfs_fsinfo *);
  1206. int (*pathconf) (struct nfs_server *, struct nfs_fh *,
  1207. struct nfs_pathconf *);
  1208. int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
  1209. int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
  1210. void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
  1211. void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
  1212. int (*read_done) (struct rpc_task *, struct nfs_read_data *);
  1213. void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
  1214. void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
  1215. int (*write_done) (struct rpc_task *, struct nfs_write_data *);
  1216. void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
  1217. void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
  1218. int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
  1219. int (*lock)(struct file *, int, struct file_lock *);
  1220. int (*lock_check_bounds)(const struct file_lock *);
  1221. void (*clear_acl_cache)(struct inode *);
  1222. void (*close_context)(struct nfs_open_context *ctx, int);
  1223. struct inode * (*open_context) (struct inode *dir,
  1224. struct nfs_open_context *ctx,
  1225. int open_flags,
  1226. struct iattr *iattr);
  1227. int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
  1228. const char *, rpc_authflavor_t, int);
  1229. };
  1230. /*
  1231. * NFS_CALL(getattr, inode, (fattr));
  1232. * into
  1233. * NFS_PROTO(inode)->getattr(fattr);
  1234. */
  1235. #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
  1236. /*
  1237. * Function vectors etc. for the NFS client
  1238. */
  1239. extern const struct nfs_rpc_ops nfs_v2_clientops;
  1240. extern const struct nfs_rpc_ops nfs_v3_clientops;
  1241. extern const struct nfs_rpc_ops nfs_v4_clientops;
  1242. extern const struct rpc_version nfs_version2;
  1243. extern const struct rpc_version nfs_version3;
  1244. extern const struct rpc_version nfs_version4;
  1245. extern const struct rpc_version nfsacl_version3;
  1246. extern const struct rpc_program nfsacl_program;
  1247. #endif