nfs_xdr.h 34 KB

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