nfs_xdr.h 33 KB

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