nfs_xdr.h 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  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. struct nfs_client *client;
  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. /* In the future extend to include curr_fh for use with migration */
  1006. unsigned char one_fs:1;
  1007. struct nfs4_sequence_args seq_args;
  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. int style;
  1016. struct nfs4_sequence_args seq_args;
  1017. };
  1018. struct nfs41_test_stateid_args {
  1019. nfs4_stateid *stateid;
  1020. struct nfs4_sequence_args seq_args;
  1021. };
  1022. struct nfs41_test_stateid_res {
  1023. unsigned int status;
  1024. struct nfs4_sequence_res seq_res;
  1025. };
  1026. struct nfs41_free_stateid_args {
  1027. nfs4_stateid *stateid;
  1028. struct nfs4_sequence_args seq_args;
  1029. };
  1030. struct nfs41_free_stateid_res {
  1031. unsigned int status;
  1032. struct nfs4_sequence_res seq_res;
  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 pnfs_layout_segment *lseg;
  1074. loff_t io_start;
  1075. const struct rpc_call_ops *mds_ops;
  1076. void (*release) (struct nfs_pgio_header *hdr);
  1077. const struct nfs_pgio_completion_ops *completion_ops;
  1078. struct nfs_direct_req *dreq;
  1079. spinlock_t lock;
  1080. /* fields protected by lock */
  1081. int pnfs_error;
  1082. int error; /* merge with pnfs_error */
  1083. unsigned long good_bytes; /* boundary of good data */
  1084. unsigned long flags;
  1085. };
  1086. struct nfs_read_header {
  1087. struct nfs_pgio_header header;
  1088. struct nfs_read_data rpc_data;
  1089. };
  1090. struct nfs_write_data {
  1091. struct nfs_pgio_header *header;
  1092. struct list_head list;
  1093. struct rpc_task task;
  1094. struct nfs_fattr fattr;
  1095. struct nfs_writeverf verf;
  1096. struct nfs_writeargs args; /* argument struct */
  1097. struct nfs_writeres res; /* result struct */
  1098. unsigned long timestamp; /* For lease renewal */
  1099. int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
  1100. __u64 mds_offset; /* Filelayout dense stripe */
  1101. struct nfs_page_array pages;
  1102. struct nfs_client *ds_clp; /* pNFS data server */
  1103. };
  1104. struct nfs_write_header {
  1105. struct nfs_pgio_header header;
  1106. struct nfs_write_data rpc_data;
  1107. };
  1108. struct nfs_mds_commit_info {
  1109. atomic_t rpcs_out;
  1110. unsigned long ncommit;
  1111. struct list_head list;
  1112. };
  1113. struct nfs_commit_data;
  1114. struct nfs_inode;
  1115. struct nfs_commit_completion_ops {
  1116. void (*error_cleanup) (struct nfs_inode *nfsi);
  1117. void (*completion) (struct nfs_commit_data *data);
  1118. };
  1119. struct nfs_commit_info {
  1120. spinlock_t *lock;
  1121. struct nfs_mds_commit_info *mds;
  1122. struct pnfs_ds_commit_info *ds;
  1123. struct nfs_direct_req *dreq; /* O_DIRECT request */
  1124. const struct nfs_commit_completion_ops *completion_ops;
  1125. };
  1126. struct nfs_commit_data {
  1127. struct rpc_task task;
  1128. struct inode *inode;
  1129. struct rpc_cred *cred;
  1130. struct nfs_fattr fattr;
  1131. struct nfs_writeverf verf;
  1132. struct list_head pages; /* Coalesced requests we wish to flush */
  1133. struct list_head list; /* lists of struct nfs_write_data */
  1134. struct nfs_direct_req *dreq; /* O_DIRECT request */
  1135. struct nfs_commitargs args; /* argument struct */
  1136. struct nfs_commitres res; /* result struct */
  1137. struct nfs_open_context *context;
  1138. struct pnfs_layout_segment *lseg;
  1139. struct nfs_client *ds_clp; /* pNFS data server */
  1140. int ds_commit_index;
  1141. const struct rpc_call_ops *mds_ops;
  1142. const struct nfs_commit_completion_ops *completion_ops;
  1143. int (*commit_done_cb) (struct rpc_task *task, struct nfs_commit_data *data);
  1144. };
  1145. struct nfs_pgio_completion_ops {
  1146. void (*error_cleanup)(struct list_head *head);
  1147. void (*init_hdr)(struct nfs_pgio_header *hdr);
  1148. void (*completion)(struct nfs_pgio_header *hdr);
  1149. };
  1150. struct nfs_unlinkdata {
  1151. struct hlist_node list;
  1152. struct nfs_removeargs args;
  1153. struct nfs_removeres res;
  1154. struct inode *dir;
  1155. struct rpc_cred *cred;
  1156. struct nfs_fattr dir_attr;
  1157. };
  1158. struct nfs_renamedata {
  1159. struct nfs_renameargs args;
  1160. struct nfs_renameres res;
  1161. struct rpc_cred *cred;
  1162. struct inode *old_dir;
  1163. struct dentry *old_dentry;
  1164. struct nfs_fattr old_fattr;
  1165. struct inode *new_dir;
  1166. struct dentry *new_dentry;
  1167. struct nfs_fattr new_fattr;
  1168. };
  1169. struct nfs_access_entry;
  1170. struct nfs_client;
  1171. struct rpc_timeout;
  1172. /*
  1173. * RPC procedure vector for NFSv2/NFSv3 demuxing
  1174. */
  1175. struct nfs_rpc_ops {
  1176. u32 version; /* Protocol version */
  1177. const struct dentry_operations *dentry_ops;
  1178. const struct inode_operations *dir_inode_ops;
  1179. const struct inode_operations *file_inode_ops;
  1180. const struct file_operations *file_ops;
  1181. int (*getroot) (struct nfs_server *, struct nfs_fh *,
  1182. struct nfs_fsinfo *);
  1183. struct vfsmount *(*submount) (struct nfs_server *, struct dentry *,
  1184. struct nfs_fh *, struct nfs_fattr *);
  1185. int (*getattr) (struct nfs_server *, struct nfs_fh *,
  1186. struct nfs_fattr *);
  1187. int (*setattr) (struct dentry *, struct nfs_fattr *,
  1188. struct iattr *);
  1189. int (*lookup) (struct inode *, struct qstr *,
  1190. struct nfs_fh *, struct nfs_fattr *);
  1191. int (*access) (struct inode *, struct nfs_access_entry *);
  1192. int (*readlink)(struct inode *, struct page *, unsigned int,
  1193. unsigned int);
  1194. int (*create) (struct inode *, struct dentry *,
  1195. struct iattr *, int, struct nfs_open_context *);
  1196. int (*remove) (struct inode *, struct qstr *);
  1197. void (*unlink_setup) (struct rpc_message *, struct inode *dir);
  1198. void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
  1199. int (*unlink_done) (struct rpc_task *, struct inode *);
  1200. int (*rename) (struct inode *, struct qstr *,
  1201. struct inode *, struct qstr *);
  1202. void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
  1203. void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
  1204. int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
  1205. int (*link) (struct inode *, struct inode *, struct qstr *);
  1206. int (*symlink) (struct inode *, struct dentry *, struct page *,
  1207. unsigned int, struct iattr *);
  1208. int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
  1209. int (*rmdir) (struct inode *, struct qstr *);
  1210. int (*readdir) (struct dentry *, struct rpc_cred *,
  1211. u64, struct page **, unsigned int, int);
  1212. int (*mknod) (struct inode *, struct dentry *, struct iattr *,
  1213. dev_t);
  1214. int (*statfs) (struct nfs_server *, struct nfs_fh *,
  1215. struct nfs_fsstat *);
  1216. int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
  1217. struct nfs_fsinfo *);
  1218. int (*pathconf) (struct nfs_server *, struct nfs_fh *,
  1219. struct nfs_pathconf *);
  1220. int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
  1221. int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
  1222. void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
  1223. void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
  1224. int (*read_done) (struct rpc_task *, struct nfs_read_data *);
  1225. void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
  1226. void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
  1227. int (*write_done) (struct rpc_task *, struct nfs_write_data *);
  1228. void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
  1229. void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
  1230. int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
  1231. int (*lock)(struct file *, int, struct file_lock *);
  1232. int (*lock_check_bounds)(const struct file_lock *);
  1233. void (*clear_acl_cache)(struct inode *);
  1234. void (*close_context)(struct nfs_open_context *ctx, int);
  1235. struct inode * (*open_context) (struct inode *dir,
  1236. struct nfs_open_context *ctx,
  1237. int open_flags,
  1238. struct iattr *iattr);
  1239. struct nfs_client *
  1240. (*init_client) (struct nfs_client *, const struct rpc_timeout *,
  1241. const char *, rpc_authflavor_t);
  1242. };
  1243. /*
  1244. * NFS_CALL(getattr, inode, (fattr));
  1245. * into
  1246. * NFS_PROTO(inode)->getattr(fattr);
  1247. */
  1248. #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
  1249. /*
  1250. * Function vectors etc. for the NFS client
  1251. */
  1252. extern const struct nfs_rpc_ops nfs_v2_clientops;
  1253. extern const struct nfs_rpc_ops nfs_v3_clientops;
  1254. extern const struct nfs_rpc_ops nfs_v4_clientops;
  1255. extern const struct rpc_version nfs_version2;
  1256. extern const struct rpc_version nfs_version3;
  1257. extern const struct rpc_version nfs_version4;
  1258. extern const struct rpc_version nfsacl_version3;
  1259. extern const struct rpc_program nfsacl_program;
  1260. #endif