nfs_xdr.h 34 KB

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