nfs_xdr.h 33 KB

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