nfs_xdr.h 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316
  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. #define NFS_ATTR_FATTR_V2 (NFS_ATTR_FATTR \
  102. | NFS_ATTR_FATTR_BLOCKS_USED)
  103. #define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
  104. | NFS_ATTR_FATTR_SPACE_USED)
  105. #define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
  106. | NFS_ATTR_FATTR_SPACE_USED \
  107. | NFS_ATTR_FATTR_CHANGE)
  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. * Common arguments to the unlink call
  464. */
  465. struct nfs_removeargs {
  466. const struct nfs_fh *fh;
  467. struct qstr name;
  468. const u32 * bitmask;
  469. struct nfs4_sequence_args seq_args;
  470. };
  471. struct nfs_removeres {
  472. const struct nfs_server *server;
  473. struct nfs_fattr *dir_attr;
  474. struct nfs4_change_info cinfo;
  475. struct nfs4_sequence_res seq_res;
  476. };
  477. /*
  478. * Common arguments to the rename call
  479. */
  480. struct nfs_renameargs {
  481. const struct nfs_fh *old_dir;
  482. const struct nfs_fh *new_dir;
  483. const struct qstr *old_name;
  484. const struct qstr *new_name;
  485. const u32 *bitmask;
  486. struct nfs4_sequence_args seq_args;
  487. };
  488. struct nfs_renameres {
  489. const struct nfs_server *server;
  490. struct nfs4_change_info old_cinfo;
  491. struct nfs_fattr *old_fattr;
  492. struct nfs4_change_info new_cinfo;
  493. struct nfs_fattr *new_fattr;
  494. struct nfs4_sequence_res seq_res;
  495. };
  496. /*
  497. * Argument struct for decode_entry function
  498. */
  499. struct nfs_entry {
  500. __u64 ino;
  501. __u64 cookie,
  502. prev_cookie;
  503. const char * name;
  504. unsigned int len;
  505. int eof;
  506. struct nfs_fh * fh;
  507. struct nfs_fattr * fattr;
  508. unsigned char d_type;
  509. struct nfs_server * server;
  510. };
  511. /*
  512. * The following types are for NFSv2 only.
  513. */
  514. struct nfs_sattrargs {
  515. struct nfs_fh * fh;
  516. struct iattr * sattr;
  517. };
  518. struct nfs_diropargs {
  519. struct nfs_fh * fh;
  520. const char * name;
  521. unsigned int len;
  522. };
  523. struct nfs_createargs {
  524. struct nfs_fh * fh;
  525. const char * name;
  526. unsigned int len;
  527. struct iattr * sattr;
  528. };
  529. struct nfs_setattrargs {
  530. struct nfs_fh * fh;
  531. nfs4_stateid stateid;
  532. struct iattr * iap;
  533. const struct nfs_server * server; /* Needed for name mapping */
  534. const u32 * bitmask;
  535. struct nfs4_sequence_args seq_args;
  536. };
  537. struct nfs_setaclargs {
  538. struct nfs_fh * fh;
  539. size_t acl_len;
  540. unsigned int acl_pgbase;
  541. struct page ** acl_pages;
  542. struct nfs4_sequence_args seq_args;
  543. };
  544. struct nfs_setaclres {
  545. struct nfs4_sequence_res seq_res;
  546. };
  547. struct nfs_getaclargs {
  548. struct nfs_fh * fh;
  549. size_t acl_len;
  550. unsigned int acl_pgbase;
  551. struct page ** acl_pages;
  552. struct nfs4_sequence_args seq_args;
  553. };
  554. /* getxattr ACL interface flags */
  555. #define NFS4_ACL_LEN_REQUEST 0x0001 /* zero length getxattr buffer */
  556. struct nfs_getaclres {
  557. size_t acl_len;
  558. size_t acl_data_offset;
  559. int acl_flags;
  560. struct page * acl_scratch;
  561. struct nfs4_sequence_res seq_res;
  562. };
  563. struct nfs_setattrres {
  564. struct nfs_fattr * fattr;
  565. const struct nfs_server * server;
  566. struct nfs4_sequence_res seq_res;
  567. };
  568. struct nfs_linkargs {
  569. struct nfs_fh * fromfh;
  570. struct nfs_fh * tofh;
  571. const char * toname;
  572. unsigned int tolen;
  573. };
  574. struct nfs_symlinkargs {
  575. struct nfs_fh * fromfh;
  576. const char * fromname;
  577. unsigned int fromlen;
  578. struct page ** pages;
  579. unsigned int pathlen;
  580. struct iattr * sattr;
  581. };
  582. struct nfs_readdirargs {
  583. struct nfs_fh * fh;
  584. __u32 cookie;
  585. unsigned int count;
  586. struct page ** pages;
  587. };
  588. struct nfs3_getaclargs {
  589. struct nfs_fh * fh;
  590. int mask;
  591. struct page ** pages;
  592. };
  593. struct nfs3_setaclargs {
  594. struct inode * inode;
  595. int mask;
  596. struct posix_acl * acl_access;
  597. struct posix_acl * acl_default;
  598. size_t len;
  599. unsigned int npages;
  600. struct page ** pages;
  601. };
  602. struct nfs_diropok {
  603. struct nfs_fh * fh;
  604. struct nfs_fattr * fattr;
  605. };
  606. struct nfs_readlinkargs {
  607. struct nfs_fh * fh;
  608. unsigned int pgbase;
  609. unsigned int pglen;
  610. struct page ** pages;
  611. };
  612. struct nfs3_sattrargs {
  613. struct nfs_fh * fh;
  614. struct iattr * sattr;
  615. unsigned int guard;
  616. struct timespec guardtime;
  617. };
  618. struct nfs3_diropargs {
  619. struct nfs_fh * fh;
  620. const char * name;
  621. unsigned int len;
  622. };
  623. struct nfs3_accessargs {
  624. struct nfs_fh * fh;
  625. __u32 access;
  626. };
  627. struct nfs3_createargs {
  628. struct nfs_fh * fh;
  629. const char * name;
  630. unsigned int len;
  631. struct iattr * sattr;
  632. enum nfs3_createmode createmode;
  633. __be32 verifier[2];
  634. };
  635. struct nfs3_mkdirargs {
  636. struct nfs_fh * fh;
  637. const char * name;
  638. unsigned int len;
  639. struct iattr * sattr;
  640. };
  641. struct nfs3_symlinkargs {
  642. struct nfs_fh * fromfh;
  643. const char * fromname;
  644. unsigned int fromlen;
  645. struct page ** pages;
  646. unsigned int pathlen;
  647. struct iattr * sattr;
  648. };
  649. struct nfs3_mknodargs {
  650. struct nfs_fh * fh;
  651. const char * name;
  652. unsigned int len;
  653. enum nfs3_ftype type;
  654. struct iattr * sattr;
  655. dev_t rdev;
  656. };
  657. struct nfs3_linkargs {
  658. struct nfs_fh * fromfh;
  659. struct nfs_fh * tofh;
  660. const char * toname;
  661. unsigned int tolen;
  662. };
  663. struct nfs3_readdirargs {
  664. struct nfs_fh * fh;
  665. __u64 cookie;
  666. __be32 verf[2];
  667. int plus;
  668. unsigned int count;
  669. struct page ** pages;
  670. };
  671. struct nfs3_diropres {
  672. struct nfs_fattr * dir_attr;
  673. struct nfs_fh * fh;
  674. struct nfs_fattr * fattr;
  675. };
  676. struct nfs3_accessres {
  677. struct nfs_fattr * fattr;
  678. __u32 access;
  679. };
  680. struct nfs3_readlinkargs {
  681. struct nfs_fh * fh;
  682. unsigned int pgbase;
  683. unsigned int pglen;
  684. struct page ** pages;
  685. };
  686. struct nfs3_linkres {
  687. struct nfs_fattr * dir_attr;
  688. struct nfs_fattr * fattr;
  689. };
  690. struct nfs3_readdirres {
  691. struct nfs_fattr * dir_attr;
  692. __be32 * verf;
  693. int plus;
  694. };
  695. struct nfs3_getaclres {
  696. struct nfs_fattr * fattr;
  697. int mask;
  698. unsigned int acl_access_count;
  699. unsigned int acl_default_count;
  700. struct posix_acl * acl_access;
  701. struct posix_acl * acl_default;
  702. };
  703. #ifdef CONFIG_NFS_V4
  704. typedef u64 clientid4;
  705. struct nfs4_accessargs {
  706. const struct nfs_fh * fh;
  707. const u32 * bitmask;
  708. u32 access;
  709. struct nfs4_sequence_args seq_args;
  710. };
  711. struct nfs4_accessres {
  712. const struct nfs_server * server;
  713. struct nfs_fattr * fattr;
  714. u32 supported;
  715. u32 access;
  716. struct nfs4_sequence_res seq_res;
  717. };
  718. struct nfs4_create_arg {
  719. u32 ftype;
  720. union {
  721. struct {
  722. struct page ** pages;
  723. unsigned int len;
  724. } symlink; /* NF4LNK */
  725. struct {
  726. u32 specdata1;
  727. u32 specdata2;
  728. } device; /* NF4BLK, NF4CHR */
  729. } u;
  730. const struct qstr * name;
  731. const struct nfs_server * server;
  732. const struct iattr * attrs;
  733. const struct nfs_fh * dir_fh;
  734. const u32 * bitmask;
  735. struct nfs4_sequence_args seq_args;
  736. };
  737. struct nfs4_create_res {
  738. const struct nfs_server * server;
  739. struct nfs_fh * fh;
  740. struct nfs_fattr * fattr;
  741. struct nfs4_change_info dir_cinfo;
  742. struct nfs_fattr * dir_fattr;
  743. struct nfs4_sequence_res seq_res;
  744. };
  745. struct nfs4_fsinfo_arg {
  746. const struct nfs_fh * fh;
  747. const u32 * bitmask;
  748. struct nfs4_sequence_args seq_args;
  749. };
  750. struct nfs4_fsinfo_res {
  751. struct nfs_fsinfo *fsinfo;
  752. struct nfs4_sequence_res seq_res;
  753. };
  754. struct nfs4_getattr_arg {
  755. const struct nfs_fh * fh;
  756. const u32 * bitmask;
  757. struct nfs4_sequence_args seq_args;
  758. };
  759. struct nfs4_getattr_res {
  760. const struct nfs_server * server;
  761. struct nfs_fattr * fattr;
  762. struct nfs4_sequence_res seq_res;
  763. };
  764. struct nfs4_link_arg {
  765. const struct nfs_fh * fh;
  766. const struct nfs_fh * dir_fh;
  767. const struct qstr * name;
  768. const u32 * bitmask;
  769. struct nfs4_sequence_args seq_args;
  770. };
  771. struct nfs4_link_res {
  772. const struct nfs_server * server;
  773. struct nfs_fattr * fattr;
  774. struct nfs4_change_info cinfo;
  775. struct nfs_fattr * dir_attr;
  776. struct nfs4_sequence_res seq_res;
  777. };
  778. struct nfs4_lookup_arg {
  779. const struct nfs_fh * dir_fh;
  780. const struct qstr * name;
  781. const u32 * bitmask;
  782. struct nfs4_sequence_args seq_args;
  783. };
  784. struct nfs4_lookup_res {
  785. const struct nfs_server * server;
  786. struct nfs_fattr * fattr;
  787. struct nfs_fh * fh;
  788. struct nfs4_sequence_res seq_res;
  789. };
  790. struct nfs4_lookup_root_arg {
  791. const u32 * bitmask;
  792. struct nfs4_sequence_args seq_args;
  793. };
  794. struct nfs4_pathconf_arg {
  795. const struct nfs_fh * fh;
  796. const u32 * bitmask;
  797. struct nfs4_sequence_args seq_args;
  798. };
  799. struct nfs4_pathconf_res {
  800. struct nfs_pathconf *pathconf;
  801. struct nfs4_sequence_res seq_res;
  802. };
  803. struct nfs4_readdir_arg {
  804. const struct nfs_fh * fh;
  805. u64 cookie;
  806. nfs4_verifier verifier;
  807. u32 count;
  808. struct page ** pages; /* zero-copy data */
  809. unsigned int pgbase; /* zero-copy data */
  810. const u32 * bitmask;
  811. int plus;
  812. struct nfs4_sequence_args seq_args;
  813. };
  814. struct nfs4_readdir_res {
  815. nfs4_verifier verifier;
  816. unsigned int pgbase;
  817. struct nfs4_sequence_res seq_res;
  818. };
  819. struct nfs4_readlink {
  820. const struct nfs_fh * fh;
  821. unsigned int pgbase;
  822. unsigned int pglen; /* zero-copy data */
  823. struct page ** pages; /* zero-copy data */
  824. struct nfs4_sequence_args seq_args;
  825. };
  826. struct nfs4_readlink_res {
  827. struct nfs4_sequence_res seq_res;
  828. };
  829. #define NFS4_SETCLIENTID_NAMELEN (127)
  830. struct nfs4_setclientid {
  831. const nfs4_verifier * sc_verifier;
  832. unsigned int sc_name_len;
  833. char sc_name[NFS4_SETCLIENTID_NAMELEN + 1];
  834. u32 sc_prog;
  835. unsigned int sc_netid_len;
  836. char sc_netid[RPCBIND_MAXNETIDLEN + 1];
  837. unsigned int sc_uaddr_len;
  838. char sc_uaddr[RPCBIND_MAXUADDRLEN + 1];
  839. u32 sc_cb_ident;
  840. };
  841. struct nfs4_setclientid_res {
  842. u64 clientid;
  843. nfs4_verifier confirm;
  844. };
  845. struct nfs4_statfs_arg {
  846. const struct nfs_fh * fh;
  847. const u32 * bitmask;
  848. struct nfs4_sequence_args seq_args;
  849. };
  850. struct nfs4_statfs_res {
  851. struct nfs_fsstat *fsstat;
  852. struct nfs4_sequence_res seq_res;
  853. };
  854. struct nfs4_server_caps_arg {
  855. struct nfs_fh *fhandle;
  856. struct nfs4_sequence_args seq_args;
  857. };
  858. struct nfs4_server_caps_res {
  859. u32 attr_bitmask[3];
  860. u32 acl_bitmask;
  861. u32 has_links;
  862. u32 has_symlinks;
  863. u32 fh_expire_type;
  864. struct nfs4_sequence_res seq_res;
  865. };
  866. #define NFS4_PATHNAME_MAXCOMPONENTS 512
  867. struct nfs4_pathname {
  868. unsigned int ncomponents;
  869. struct nfs4_string components[NFS4_PATHNAME_MAXCOMPONENTS];
  870. };
  871. #define NFS4_FS_LOCATION_MAXSERVERS 10
  872. struct nfs4_fs_location {
  873. unsigned int nservers;
  874. struct nfs4_string servers[NFS4_FS_LOCATION_MAXSERVERS];
  875. struct nfs4_pathname rootpath;
  876. };
  877. #define NFS4_FS_LOCATIONS_MAXENTRIES 10
  878. struct nfs4_fs_locations {
  879. struct nfs_fattr fattr;
  880. const struct nfs_server *server;
  881. struct nfs4_pathname fs_path;
  882. int nlocations;
  883. struct nfs4_fs_location locations[NFS4_FS_LOCATIONS_MAXENTRIES];
  884. };
  885. struct nfs4_fs_locations_arg {
  886. const struct nfs_fh *dir_fh;
  887. const struct qstr *name;
  888. struct page *page;
  889. const u32 *bitmask;
  890. struct nfs4_sequence_args seq_args;
  891. };
  892. struct nfs4_fs_locations_res {
  893. struct nfs4_fs_locations *fs_locations;
  894. struct nfs4_sequence_res seq_res;
  895. };
  896. struct nfs4_secinfo_oid {
  897. unsigned int len;
  898. char data[GSS_OID_MAX_LEN];
  899. };
  900. struct nfs4_secinfo_gss {
  901. struct nfs4_secinfo_oid sec_oid4;
  902. unsigned int qop4;
  903. unsigned int service;
  904. };
  905. struct nfs4_secinfo_flavor {
  906. unsigned int flavor;
  907. struct nfs4_secinfo_gss gss;
  908. };
  909. struct nfs4_secinfo_flavors {
  910. unsigned int num_flavors;
  911. struct nfs4_secinfo_flavor flavors[0];
  912. };
  913. struct nfs4_secinfo_arg {
  914. const struct nfs_fh *dir_fh;
  915. const struct qstr *name;
  916. struct nfs4_sequence_args seq_args;
  917. };
  918. struct nfs4_secinfo_res {
  919. struct nfs4_secinfo_flavors *flavors;
  920. struct nfs4_sequence_res seq_res;
  921. };
  922. #endif /* CONFIG_NFS_V4 */
  923. struct nfstime4 {
  924. u64 seconds;
  925. u32 nseconds;
  926. };
  927. #ifdef CONFIG_NFS_V4_1
  928. #define NFS4_EXCHANGE_ID_LEN (127)
  929. struct nfs41_exchange_id_args {
  930. struct nfs_client *client;
  931. nfs4_verifier *verifier;
  932. unsigned int id_len;
  933. char id[NFS4_EXCHANGE_ID_LEN];
  934. u32 flags;
  935. };
  936. struct server_owner {
  937. uint64_t minor_id;
  938. uint32_t major_id_sz;
  939. char major_id[NFS4_OPAQUE_LIMIT];
  940. };
  941. struct server_scope {
  942. uint32_t server_scope_sz;
  943. char server_scope[NFS4_OPAQUE_LIMIT];
  944. };
  945. struct nfs41_impl_id {
  946. char domain[NFS4_OPAQUE_LIMIT + 1];
  947. char name[NFS4_OPAQUE_LIMIT + 1];
  948. struct nfstime4 date;
  949. };
  950. struct nfs41_exchange_id_res {
  951. struct nfs_client *client;
  952. u32 flags;
  953. struct server_scope *server_scope;
  954. struct nfs41_impl_id *impl_id;
  955. };
  956. struct nfs41_create_session_args {
  957. struct nfs_client *client;
  958. uint32_t flags;
  959. uint32_t cb_program;
  960. struct nfs4_channel_attrs fc_attrs; /* Fore Channel */
  961. struct nfs4_channel_attrs bc_attrs; /* Back Channel */
  962. };
  963. struct nfs41_create_session_res {
  964. struct nfs_client *client;
  965. };
  966. struct nfs41_reclaim_complete_args {
  967. /* In the future extend to include curr_fh for use with migration */
  968. unsigned char one_fs:1;
  969. struct nfs4_sequence_args seq_args;
  970. };
  971. struct nfs41_reclaim_complete_res {
  972. struct nfs4_sequence_res seq_res;
  973. };
  974. #define SECINFO_STYLE_CURRENT_FH 0
  975. #define SECINFO_STYLE_PARENT 1
  976. struct nfs41_secinfo_no_name_args {
  977. int style;
  978. struct nfs4_sequence_args seq_args;
  979. };
  980. struct nfs41_test_stateid_args {
  981. nfs4_stateid *stateid;
  982. struct nfs4_sequence_args seq_args;
  983. };
  984. struct nfs41_test_stateid_res {
  985. unsigned int status;
  986. struct nfs4_sequence_res seq_res;
  987. };
  988. struct nfs41_free_stateid_args {
  989. nfs4_stateid *stateid;
  990. struct nfs4_sequence_args seq_args;
  991. };
  992. struct nfs41_free_stateid_res {
  993. unsigned int status;
  994. struct nfs4_sequence_res seq_res;
  995. };
  996. #endif /* CONFIG_NFS_V4_1 */
  997. struct nfs_page;
  998. #define NFS_PAGEVEC_SIZE (8U)
  999. struct nfs_read_data {
  1000. struct rpc_task task;
  1001. struct inode *inode;
  1002. struct rpc_cred *cred;
  1003. struct nfs_fattr fattr; /* fattr storage */
  1004. struct list_head pages; /* Coalesced read requests */
  1005. struct list_head list; /* lists of struct nfs_read_data */
  1006. struct nfs_page *req; /* multi ops per nfs_page */
  1007. struct page **pagevec;
  1008. unsigned int npages; /* Max length of pagevec */
  1009. struct nfs_readargs args;
  1010. struct nfs_readres res;
  1011. unsigned long timestamp; /* For lease renewal */
  1012. struct pnfs_layout_segment *lseg;
  1013. struct nfs_client *ds_clp; /* pNFS data server */
  1014. const struct rpc_call_ops *mds_ops;
  1015. int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
  1016. __u64 mds_offset;
  1017. int pnfs_error;
  1018. struct page *page_array[NFS_PAGEVEC_SIZE];
  1019. };
  1020. struct nfs_write_data {
  1021. struct rpc_task task;
  1022. struct inode *inode;
  1023. struct rpc_cred *cred;
  1024. struct nfs_fattr fattr;
  1025. struct nfs_writeverf verf;
  1026. struct list_head pages; /* Coalesced requests we wish to flush */
  1027. struct list_head list; /* lists of struct nfs_write_data */
  1028. struct nfs_page *req; /* multi ops per nfs_page */
  1029. struct page **pagevec;
  1030. unsigned int npages; /* Max length of pagevec */
  1031. struct nfs_writeargs args; /* argument struct */
  1032. struct nfs_writeres res; /* result struct */
  1033. struct pnfs_layout_segment *lseg;
  1034. struct nfs_client *ds_clp; /* pNFS data server */
  1035. int ds_commit_index;
  1036. const struct rpc_call_ops *mds_ops;
  1037. int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data);
  1038. #ifdef CONFIG_NFS_V4
  1039. unsigned long timestamp; /* For lease renewal */
  1040. #endif
  1041. __u64 mds_offset; /* Filelayout dense stripe */
  1042. int pnfs_error;
  1043. struct page *page_array[NFS_PAGEVEC_SIZE];
  1044. };
  1045. struct nfs_unlinkdata {
  1046. struct hlist_node list;
  1047. struct nfs_removeargs args;
  1048. struct nfs_removeres res;
  1049. struct inode *dir;
  1050. struct rpc_cred *cred;
  1051. struct nfs_fattr dir_attr;
  1052. };
  1053. struct nfs_renamedata {
  1054. struct nfs_renameargs args;
  1055. struct nfs_renameres res;
  1056. struct rpc_cred *cred;
  1057. struct inode *old_dir;
  1058. struct dentry *old_dentry;
  1059. struct nfs_fattr old_fattr;
  1060. struct inode *new_dir;
  1061. struct dentry *new_dentry;
  1062. struct nfs_fattr new_fattr;
  1063. };
  1064. struct nfs_access_entry;
  1065. struct nfs_client;
  1066. struct rpc_timeout;
  1067. /*
  1068. * RPC procedure vector for NFSv2/NFSv3 demuxing
  1069. */
  1070. struct nfs_rpc_ops {
  1071. u32 version; /* Protocol version */
  1072. const struct dentry_operations *dentry_ops;
  1073. const struct inode_operations *dir_inode_ops;
  1074. const struct inode_operations *file_inode_ops;
  1075. const struct file_operations *file_ops;
  1076. int (*getroot) (struct nfs_server *, struct nfs_fh *,
  1077. struct nfs_fsinfo *);
  1078. int (*getattr) (struct nfs_server *, struct nfs_fh *,
  1079. struct nfs_fattr *);
  1080. int (*setattr) (struct dentry *, struct nfs_fattr *,
  1081. struct iattr *);
  1082. int (*lookup) (struct rpc_clnt *clnt, struct inode *, struct qstr *,
  1083. struct nfs_fh *, struct nfs_fattr *);
  1084. int (*access) (struct inode *, struct nfs_access_entry *);
  1085. int (*readlink)(struct inode *, struct page *, unsigned int,
  1086. unsigned int);
  1087. int (*create) (struct inode *, struct dentry *,
  1088. struct iattr *, int, struct nfs_open_context *);
  1089. int (*remove) (struct inode *, struct qstr *);
  1090. void (*unlink_setup) (struct rpc_message *, struct inode *dir);
  1091. void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
  1092. int (*unlink_done) (struct rpc_task *, struct inode *);
  1093. int (*rename) (struct inode *, struct qstr *,
  1094. struct inode *, struct qstr *);
  1095. void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
  1096. void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
  1097. int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
  1098. int (*link) (struct inode *, struct inode *, struct qstr *);
  1099. int (*symlink) (struct inode *, struct dentry *, struct page *,
  1100. unsigned int, struct iattr *);
  1101. int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
  1102. int (*rmdir) (struct inode *, struct qstr *);
  1103. int (*readdir) (struct dentry *, struct rpc_cred *,
  1104. u64, struct page **, unsigned int, int);
  1105. int (*mknod) (struct inode *, struct dentry *, struct iattr *,
  1106. dev_t);
  1107. int (*statfs) (struct nfs_server *, struct nfs_fh *,
  1108. struct nfs_fsstat *);
  1109. int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
  1110. struct nfs_fsinfo *);
  1111. int (*pathconf) (struct nfs_server *, struct nfs_fh *,
  1112. struct nfs_pathconf *);
  1113. int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
  1114. int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
  1115. void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
  1116. void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
  1117. int (*read_done) (struct rpc_task *, struct nfs_read_data *);
  1118. void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
  1119. void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
  1120. int (*write_done) (struct rpc_task *, struct nfs_write_data *);
  1121. void (*commit_setup) (struct nfs_write_data *, struct rpc_message *);
  1122. int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
  1123. int (*lock)(struct file *, int, struct file_lock *);
  1124. int (*lock_check_bounds)(const struct file_lock *);
  1125. void (*clear_acl_cache)(struct inode *);
  1126. void (*close_context)(struct nfs_open_context *ctx, int);
  1127. struct inode * (*open_context) (struct inode *dir,
  1128. struct nfs_open_context *ctx,
  1129. int open_flags,
  1130. struct iattr *iattr);
  1131. int (*init_client) (struct nfs_client *, const struct rpc_timeout *,
  1132. const char *, rpc_authflavor_t, int);
  1133. int (*secinfo)(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
  1134. };
  1135. /*
  1136. * NFS_CALL(getattr, inode, (fattr));
  1137. * into
  1138. * NFS_PROTO(inode)->getattr(fattr);
  1139. */
  1140. #define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
  1141. /*
  1142. * Function vectors etc. for the NFS client
  1143. */
  1144. extern const struct nfs_rpc_ops nfs_v2_clientops;
  1145. extern const struct nfs_rpc_ops nfs_v3_clientops;
  1146. extern const struct nfs_rpc_ops nfs_v4_clientops;
  1147. extern const struct rpc_version nfs_version2;
  1148. extern const struct rpc_version nfs_version3;
  1149. extern const struct rpc_version nfs_version4;
  1150. extern const struct rpc_version nfsacl_version3;
  1151. extern const struct rpc_program nfsacl_program;
  1152. #endif