xdr4.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. /*
  2. * Server-side types for NFSv4.
  3. *
  4. * Copyright (c) 2002 The Regents of the University of Michigan.
  5. * All rights reserved.
  6. *
  7. * Kendrick Smith <kmsmith@umich.edu>
  8. * Andy Adamson <andros@umich.edu>
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. *
  14. * 1. Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. * 2. Redistributions in binary form must reproduce the above copyright
  17. * notice, this list of conditions and the following disclaimer in the
  18. * documentation and/or other materials provided with the distribution.
  19. * 3. Neither the name of the University nor the names of its
  20. * contributors may be used to endorse or promote products derived
  21. * from this software without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  24. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  25. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  27. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  28. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  29. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  30. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  31. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  32. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  33. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. */
  36. #ifndef _LINUX_NFSD_XDR4_H
  37. #define _LINUX_NFSD_XDR4_H
  38. #include "state.h"
  39. #include "nfsd.h"
  40. #define NFSD4_MAX_TAGLEN 128
  41. #define XDR_LEN(n) (((n) + 3) & ~3)
  42. #define CURRENT_STATE_ID_FLAG (1<<0)
  43. #define SAVED_STATE_ID_FLAG (1<<1)
  44. #define SET_STATE_ID(c, f) ((c)->sid_flags |= (f))
  45. #define HAS_STATE_ID(c, f) ((c)->sid_flags & (f))
  46. #define CLEAR_STATE_ID(c, f) ((c)->sid_flags &= ~(f))
  47. struct nfsd4_compound_state {
  48. struct svc_fh current_fh;
  49. struct svc_fh save_fh;
  50. struct nfs4_stateowner *replay_owner;
  51. struct nfs4_client *clp;
  52. /* For sessions DRC */
  53. struct nfsd4_session *session;
  54. struct nfsd4_slot *slot;
  55. int data_offset;
  56. size_t iovlen;
  57. u32 minorversion;
  58. __be32 status;
  59. stateid_t current_stateid;
  60. stateid_t save_stateid;
  61. /* to indicate current and saved state id presents */
  62. u32 sid_flags;
  63. };
  64. static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
  65. {
  66. return cs->slot != NULL;
  67. }
  68. struct nfsd4_change_info {
  69. u32 atomic;
  70. bool change_supported;
  71. u32 before_ctime_sec;
  72. u32 before_ctime_nsec;
  73. u64 before_change;
  74. u32 after_ctime_sec;
  75. u32 after_ctime_nsec;
  76. u64 after_change;
  77. };
  78. struct nfsd4_access {
  79. u32 ac_req_access; /* request */
  80. u32 ac_supported; /* response */
  81. u32 ac_resp_access; /* response */
  82. };
  83. struct nfsd4_close {
  84. u32 cl_seqid; /* request */
  85. stateid_t cl_stateid; /* request+response */
  86. };
  87. struct nfsd4_commit {
  88. u64 co_offset; /* request */
  89. u32 co_count; /* request */
  90. nfs4_verifier co_verf; /* response */
  91. };
  92. struct nfsd4_create {
  93. u32 cr_namelen; /* request */
  94. char * cr_name; /* request */
  95. u32 cr_type; /* request */
  96. union { /* request */
  97. struct {
  98. u32 datalen;
  99. char *data;
  100. } link; /* NF4LNK */
  101. struct {
  102. u32 specdata1;
  103. u32 specdata2;
  104. } dev; /* NF4BLK, NF4CHR */
  105. } u;
  106. u32 cr_bmval[3]; /* request */
  107. struct iattr cr_iattr; /* request */
  108. struct nfsd4_change_info cr_cinfo; /* response */
  109. struct nfs4_acl *cr_acl;
  110. struct xdr_netobj cr_label;
  111. };
  112. #define cr_datalen u.link.datalen
  113. #define cr_data u.link.data
  114. #define cr_specdata1 u.dev.specdata1
  115. #define cr_specdata2 u.dev.specdata2
  116. struct nfsd4_delegreturn {
  117. stateid_t dr_stateid;
  118. };
  119. struct nfsd4_getattr {
  120. u32 ga_bmval[3]; /* request */
  121. struct svc_fh *ga_fhp; /* response */
  122. };
  123. struct nfsd4_link {
  124. u32 li_namelen; /* request */
  125. char * li_name; /* request */
  126. struct nfsd4_change_info li_cinfo; /* response */
  127. };
  128. struct nfsd4_lock_denied {
  129. clientid_t ld_clientid;
  130. struct xdr_netobj ld_owner;
  131. u64 ld_start;
  132. u64 ld_length;
  133. u32 ld_type;
  134. };
  135. struct nfsd4_lock {
  136. /* request */
  137. u32 lk_type;
  138. u32 lk_reclaim; /* boolean */
  139. u64 lk_offset;
  140. u64 lk_length;
  141. u32 lk_is_new;
  142. union {
  143. struct {
  144. u32 open_seqid;
  145. stateid_t open_stateid;
  146. u32 lock_seqid;
  147. clientid_t clientid;
  148. struct xdr_netobj owner;
  149. } new;
  150. struct {
  151. stateid_t lock_stateid;
  152. u32 lock_seqid;
  153. } old;
  154. } v;
  155. /* response */
  156. union {
  157. struct {
  158. stateid_t stateid;
  159. } ok;
  160. struct nfsd4_lock_denied denied;
  161. } u;
  162. };
  163. #define lk_new_open_seqid v.new.open_seqid
  164. #define lk_new_open_stateid v.new.open_stateid
  165. #define lk_new_lock_seqid v.new.lock_seqid
  166. #define lk_new_clientid v.new.clientid
  167. #define lk_new_owner v.new.owner
  168. #define lk_old_lock_stateid v.old.lock_stateid
  169. #define lk_old_lock_seqid v.old.lock_seqid
  170. #define lk_resp_stateid u.ok.stateid
  171. #define lk_denied u.denied
  172. struct nfsd4_lockt {
  173. u32 lt_type;
  174. clientid_t lt_clientid;
  175. struct xdr_netobj lt_owner;
  176. u64 lt_offset;
  177. u64 lt_length;
  178. struct nfsd4_lock_denied lt_denied;
  179. };
  180. struct nfsd4_locku {
  181. u32 lu_type;
  182. u32 lu_seqid;
  183. stateid_t lu_stateid;
  184. u64 lu_offset;
  185. u64 lu_length;
  186. };
  187. struct nfsd4_lookup {
  188. u32 lo_len; /* request */
  189. char * lo_name; /* request */
  190. };
  191. struct nfsd4_putfh {
  192. u32 pf_fhlen; /* request */
  193. char *pf_fhval; /* request */
  194. };
  195. struct nfsd4_open {
  196. u32 op_claim_type; /* request */
  197. struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */
  198. u32 op_delegate_type; /* request - CLAIM_PREV only */
  199. stateid_t op_delegate_stateid; /* request - response */
  200. u32 op_why_no_deleg; /* response - DELEG_NONE_EXT only */
  201. u32 op_create; /* request */
  202. u32 op_createmode; /* request */
  203. u32 op_bmval[3]; /* request */
  204. struct iattr op_iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */
  205. nfs4_verifier op_verf __attribute__((aligned(32)));
  206. /* EXCLUSIVE4 */
  207. clientid_t op_clientid; /* request */
  208. struct xdr_netobj op_owner; /* request */
  209. u32 op_seqid; /* request */
  210. u32 op_share_access; /* request */
  211. u32 op_share_deny; /* request */
  212. u32 op_deleg_want; /* request */
  213. stateid_t op_stateid; /* response */
  214. __be32 op_xdr_error; /* see nfsd4_open_omfg() */
  215. u32 op_recall; /* recall */
  216. struct nfsd4_change_info op_cinfo; /* response */
  217. u32 op_rflags; /* response */
  218. bool op_truncate; /* used during processing */
  219. bool op_created; /* used during processing */
  220. struct nfs4_openowner *op_openowner; /* used during processing */
  221. struct nfs4_file *op_file; /* used during processing */
  222. struct nfs4_ol_stateid *op_stp; /* used during processing */
  223. struct nfs4_clnt_odstate *op_odstate; /* used during processing */
  224. struct nfs4_acl *op_acl;
  225. struct xdr_netobj op_label;
  226. };
  227. struct nfsd4_open_confirm {
  228. stateid_t oc_req_stateid /* request */;
  229. u32 oc_seqid /* request */;
  230. stateid_t oc_resp_stateid /* response */;
  231. };
  232. struct nfsd4_open_downgrade {
  233. stateid_t od_stateid;
  234. u32 od_seqid;
  235. u32 od_share_access; /* request */
  236. u32 od_deleg_want; /* request */
  237. u32 od_share_deny; /* request */
  238. };
  239. struct nfsd4_read {
  240. stateid_t rd_stateid; /* request */
  241. u64 rd_offset; /* request */
  242. u32 rd_length; /* request */
  243. int rd_vlen;
  244. struct file *rd_filp;
  245. bool rd_tmp_file;
  246. struct svc_rqst *rd_rqstp; /* response */
  247. struct svc_fh * rd_fhp; /* response */
  248. };
  249. struct nfsd4_readdir {
  250. u64 rd_cookie; /* request */
  251. nfs4_verifier rd_verf; /* request */
  252. u32 rd_dircount; /* request */
  253. u32 rd_maxcount; /* request */
  254. u32 rd_bmval[3]; /* request */
  255. struct svc_rqst *rd_rqstp; /* response */
  256. struct svc_fh * rd_fhp; /* response */
  257. struct readdir_cd common;
  258. struct xdr_stream *xdr;
  259. int cookie_offset;
  260. };
  261. struct nfsd4_release_lockowner {
  262. clientid_t rl_clientid;
  263. struct xdr_netobj rl_owner;
  264. };
  265. struct nfsd4_readlink {
  266. struct svc_rqst *rl_rqstp; /* request */
  267. struct svc_fh * rl_fhp; /* request */
  268. };
  269. struct nfsd4_remove {
  270. u32 rm_namelen; /* request */
  271. char * rm_name; /* request */
  272. struct nfsd4_change_info rm_cinfo; /* response */
  273. };
  274. struct nfsd4_rename {
  275. u32 rn_snamelen; /* request */
  276. char * rn_sname; /* request */
  277. u32 rn_tnamelen; /* request */
  278. char * rn_tname; /* request */
  279. struct nfsd4_change_info rn_sinfo; /* response */
  280. struct nfsd4_change_info rn_tinfo; /* response */
  281. };
  282. struct nfsd4_secinfo {
  283. u32 si_namelen; /* request */
  284. char *si_name; /* request */
  285. struct svc_export *si_exp; /* response */
  286. };
  287. struct nfsd4_secinfo_no_name {
  288. u32 sin_style; /* request */
  289. struct svc_export *sin_exp; /* response */
  290. };
  291. struct nfsd4_setattr {
  292. stateid_t sa_stateid; /* request */
  293. u32 sa_bmval[3]; /* request */
  294. struct iattr sa_iattr; /* request */
  295. struct nfs4_acl *sa_acl;
  296. struct xdr_netobj sa_label;
  297. };
  298. struct nfsd4_setclientid {
  299. nfs4_verifier se_verf; /* request */
  300. struct xdr_netobj se_name;
  301. u32 se_callback_prog; /* request */
  302. u32 se_callback_netid_len; /* request */
  303. char * se_callback_netid_val; /* request */
  304. u32 se_callback_addr_len; /* request */
  305. char * se_callback_addr_val; /* request */
  306. u32 se_callback_ident; /* request */
  307. clientid_t se_clientid; /* response */
  308. nfs4_verifier se_confirm; /* response */
  309. };
  310. struct nfsd4_setclientid_confirm {
  311. clientid_t sc_clientid;
  312. nfs4_verifier sc_confirm;
  313. };
  314. struct nfsd4_saved_compoundargs {
  315. __be32 *p;
  316. __be32 *end;
  317. int pagelen;
  318. struct page **pagelist;
  319. };
  320. struct nfsd4_test_stateid_id {
  321. __be32 ts_id_status;
  322. stateid_t ts_id_stateid;
  323. struct list_head ts_id_list;
  324. };
  325. struct nfsd4_test_stateid {
  326. u32 ts_num_ids;
  327. struct list_head ts_stateid_list;
  328. };
  329. struct nfsd4_free_stateid {
  330. stateid_t fr_stateid; /* request */
  331. };
  332. /* also used for NVERIFY */
  333. struct nfsd4_verify {
  334. u32 ve_bmval[3]; /* request */
  335. u32 ve_attrlen; /* request */
  336. char * ve_attrval; /* request */
  337. };
  338. struct nfsd4_write {
  339. stateid_t wr_stateid; /* request */
  340. u64 wr_offset; /* request */
  341. u32 wr_stable_how; /* request */
  342. u32 wr_buflen; /* request */
  343. struct kvec wr_head;
  344. struct page ** wr_pagelist; /* request */
  345. u32 wr_bytes_written; /* response */
  346. u32 wr_how_written; /* response */
  347. nfs4_verifier wr_verifier; /* response */
  348. };
  349. struct nfsd4_exchange_id {
  350. nfs4_verifier verifier;
  351. struct xdr_netobj clname;
  352. u32 flags;
  353. clientid_t clientid;
  354. u32 seqid;
  355. int spa_how;
  356. };
  357. struct nfsd4_sequence {
  358. struct nfs4_sessionid sessionid; /* request/response */
  359. u32 seqid; /* request/response */
  360. u32 slotid; /* request/response */
  361. u32 maxslots; /* request/response */
  362. u32 cachethis; /* request */
  363. #if 0
  364. u32 target_maxslots; /* response */
  365. #endif /* not yet */
  366. u32 status_flags; /* response */
  367. };
  368. struct nfsd4_destroy_session {
  369. struct nfs4_sessionid sessionid;
  370. };
  371. struct nfsd4_destroy_clientid {
  372. clientid_t clientid;
  373. };
  374. struct nfsd4_reclaim_complete {
  375. u32 rca_one_fs;
  376. };
  377. struct nfsd4_deviceid {
  378. u64 fsid_idx;
  379. u32 generation;
  380. u32 pad;
  381. };
  382. struct nfsd4_layout_seg {
  383. u32 iomode;
  384. u64 offset;
  385. u64 length;
  386. };
  387. struct nfsd4_getdeviceinfo {
  388. struct nfsd4_deviceid gd_devid; /* request */
  389. u32 gd_layout_type; /* request */
  390. u32 gd_maxcount; /* request */
  391. u32 gd_notify_types;/* request - response */
  392. void *gd_device; /* response */
  393. };
  394. struct nfsd4_layoutget {
  395. u64 lg_minlength; /* request */
  396. u32 lg_signal; /* request */
  397. u32 lg_layout_type; /* request */
  398. u32 lg_maxcount; /* request */
  399. stateid_t lg_sid; /* request/response */
  400. struct nfsd4_layout_seg lg_seg; /* request/response */
  401. void *lg_content; /* response */
  402. };
  403. struct nfsd4_layoutcommit {
  404. stateid_t lc_sid; /* request */
  405. struct nfsd4_layout_seg lc_seg; /* request */
  406. u32 lc_reclaim; /* request */
  407. u32 lc_newoffset; /* request */
  408. u64 lc_last_wr; /* request */
  409. struct timespec lc_mtime; /* request */
  410. u32 lc_layout_type; /* request */
  411. u32 lc_up_len; /* layout length */
  412. void *lc_up_layout; /* decoded by callback */
  413. u32 lc_size_chg; /* boolean for response */
  414. u64 lc_newsize; /* response */
  415. };
  416. struct nfsd4_layoutreturn {
  417. u32 lr_return_type; /* request */
  418. u32 lr_layout_type; /* request */
  419. struct nfsd4_layout_seg lr_seg; /* request */
  420. u32 lr_reclaim; /* request */
  421. u32 lrf_body_len; /* request */
  422. void *lrf_body; /* request */
  423. stateid_t lr_sid; /* request/response */
  424. u32 lrs_present; /* response */
  425. };
  426. struct nfsd4_fallocate {
  427. /* request */
  428. stateid_t falloc_stateid;
  429. loff_t falloc_offset;
  430. u64 falloc_length;
  431. };
  432. struct nfsd4_seek {
  433. /* request */
  434. stateid_t seek_stateid;
  435. loff_t seek_offset;
  436. u32 seek_whence;
  437. /* response */
  438. u32 seek_eof;
  439. loff_t seek_pos;
  440. };
  441. struct nfsd4_op {
  442. int opnum;
  443. __be32 status;
  444. union {
  445. struct nfsd4_access access;
  446. struct nfsd4_close close;
  447. struct nfsd4_commit commit;
  448. struct nfsd4_create create;
  449. struct nfsd4_delegreturn delegreturn;
  450. struct nfsd4_getattr getattr;
  451. struct svc_fh * getfh;
  452. struct nfsd4_link link;
  453. struct nfsd4_lock lock;
  454. struct nfsd4_lockt lockt;
  455. struct nfsd4_locku locku;
  456. struct nfsd4_lookup lookup;
  457. struct nfsd4_verify nverify;
  458. struct nfsd4_open open;
  459. struct nfsd4_open_confirm open_confirm;
  460. struct nfsd4_open_downgrade open_downgrade;
  461. struct nfsd4_putfh putfh;
  462. struct nfsd4_read read;
  463. struct nfsd4_readdir readdir;
  464. struct nfsd4_readlink readlink;
  465. struct nfsd4_remove remove;
  466. struct nfsd4_rename rename;
  467. clientid_t renew;
  468. struct nfsd4_secinfo secinfo;
  469. struct nfsd4_setattr setattr;
  470. struct nfsd4_setclientid setclientid;
  471. struct nfsd4_setclientid_confirm setclientid_confirm;
  472. struct nfsd4_verify verify;
  473. struct nfsd4_write write;
  474. struct nfsd4_release_lockowner release_lockowner;
  475. /* NFSv4.1 */
  476. struct nfsd4_exchange_id exchange_id;
  477. struct nfsd4_backchannel_ctl backchannel_ctl;
  478. struct nfsd4_bind_conn_to_session bind_conn_to_session;
  479. struct nfsd4_create_session create_session;
  480. struct nfsd4_destroy_session destroy_session;
  481. struct nfsd4_sequence sequence;
  482. struct nfsd4_reclaim_complete reclaim_complete;
  483. struct nfsd4_test_stateid test_stateid;
  484. struct nfsd4_free_stateid free_stateid;
  485. struct nfsd4_getdeviceinfo getdeviceinfo;
  486. struct nfsd4_layoutget layoutget;
  487. struct nfsd4_layoutcommit layoutcommit;
  488. struct nfsd4_layoutreturn layoutreturn;
  489. /* NFSv4.2 */
  490. struct nfsd4_fallocate allocate;
  491. struct nfsd4_fallocate deallocate;
  492. struct nfsd4_seek seek;
  493. } u;
  494. struct nfs4_replay * replay;
  495. };
  496. bool nfsd4_cache_this_op(struct nfsd4_op *);
  497. /*
  498. * Memory needed just for the duration of processing one compound:
  499. */
  500. struct svcxdr_tmpbuf {
  501. struct svcxdr_tmpbuf *next;
  502. char buf[];
  503. };
  504. struct nfsd4_compoundargs {
  505. /* scratch variables for XDR decode */
  506. __be32 * p;
  507. __be32 * end;
  508. struct page ** pagelist;
  509. int pagelen;
  510. __be32 tmp[8];
  511. __be32 * tmpp;
  512. struct svcxdr_tmpbuf *to_free;
  513. struct svc_rqst *rqstp;
  514. u32 taglen;
  515. char * tag;
  516. u32 minorversion;
  517. u32 opcnt;
  518. struct nfsd4_op *ops;
  519. struct nfsd4_op iops[8];
  520. int cachetype;
  521. };
  522. struct nfsd4_compoundres {
  523. /* scratch variables for XDR encode */
  524. struct xdr_stream xdr;
  525. struct svc_rqst * rqstp;
  526. u32 taglen;
  527. char * tag;
  528. u32 opcnt;
  529. __be32 * tagp; /* tag, opcount encode location */
  530. struct nfsd4_compound_state cstate;
  531. };
  532. static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
  533. {
  534. struct nfsd4_compoundargs *args = resp->rqstp->rq_argp;
  535. return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE;
  536. }
  537. static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
  538. {
  539. return !(resp->cstate.slot->sl_flags & NFSD4_SLOT_CACHETHIS)
  540. || nfsd4_is_solo_sequence(resp);
  541. }
  542. static inline bool nfsd4_last_compound_op(struct svc_rqst *rqstp)
  543. {
  544. struct nfsd4_compoundres *resp = rqstp->rq_resp;
  545. struct nfsd4_compoundargs *argp = rqstp->rq_argp;
  546. return argp->opcnt == resp->opcnt;
  547. }
  548. int nfsd4_max_reply(struct svc_rqst *rqstp, struct nfsd4_op *op);
  549. void warn_on_nonidempotent_op(struct nfsd4_op *op);
  550. #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
  551. static inline void
  552. set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
  553. {
  554. BUG_ON(!fhp->fh_pre_saved);
  555. cinfo->atomic = (u32)fhp->fh_post_saved;
  556. cinfo->change_supported = IS_I_VERSION(d_inode(fhp->fh_dentry));
  557. cinfo->before_change = fhp->fh_pre_change;
  558. cinfo->after_change = fhp->fh_post_change;
  559. cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
  560. cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
  561. cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
  562. cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
  563. }
  564. int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
  565. int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
  566. struct nfsd4_compoundargs *);
  567. int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
  568. struct nfsd4_compoundres *);
  569. __be32 nfsd4_check_resp_size(struct nfsd4_compoundres *, u32);
  570. void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
  571. void nfsd4_encode_replay(struct xdr_stream *xdr, struct nfsd4_op *op);
  572. __be32 nfsd4_encode_fattr_to_buf(__be32 **p, int words,
  573. struct svc_fh *fhp, struct svc_export *exp,
  574. struct dentry *dentry,
  575. u32 *bmval, struct svc_rqst *, int ignore_crossmnt);
  576. extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
  577. struct nfsd4_compound_state *,
  578. struct nfsd4_setclientid *setclid);
  579. extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
  580. struct nfsd4_compound_state *,
  581. struct nfsd4_setclientid_confirm *setclientid_confirm);
  582. extern __be32 nfsd4_exchange_id(struct svc_rqst *rqstp,
  583. struct nfsd4_compound_state *, struct nfsd4_exchange_id *);
  584. extern __be32 nfsd4_backchannel_ctl(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_backchannel_ctl *);
  585. extern __be32 nfsd4_bind_conn_to_session(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_bind_conn_to_session *);
  586. extern __be32 nfsd4_create_session(struct svc_rqst *,
  587. struct nfsd4_compound_state *,
  588. struct nfsd4_create_session *);
  589. extern __be32 nfsd4_sequence(struct svc_rqst *,
  590. struct nfsd4_compound_state *,
  591. struct nfsd4_sequence *);
  592. extern void nfsd4_sequence_done(struct nfsd4_compoundres *resp);
  593. extern __be32 nfsd4_destroy_session(struct svc_rqst *,
  594. struct nfsd4_compound_state *,
  595. struct nfsd4_destroy_session *);
  596. extern __be32 nfsd4_destroy_clientid(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_destroy_clientid *);
  597. __be32 nfsd4_reclaim_complete(struct svc_rqst *, struct nfsd4_compound_state *, struct nfsd4_reclaim_complete *);
  598. extern __be32 nfsd4_process_open1(struct nfsd4_compound_state *,
  599. struct nfsd4_open *open, struct nfsd_net *nn);
  600. extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
  601. struct svc_fh *current_fh, struct nfsd4_open *open);
  602. extern void nfsd4_cstate_clear_replay(struct nfsd4_compound_state *cstate);
  603. extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate,
  604. struct nfsd4_open *open);
  605. extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
  606. struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc);
  607. extern __be32 nfsd4_close(struct svc_rqst *rqstp,
  608. struct nfsd4_compound_state *,
  609. struct nfsd4_close *close);
  610. extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
  611. struct nfsd4_compound_state *,
  612. struct nfsd4_open_downgrade *od);
  613. extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *,
  614. struct nfsd4_lock *lock);
  615. extern __be32 nfsd4_lockt(struct svc_rqst *rqstp,
  616. struct nfsd4_compound_state *,
  617. struct nfsd4_lockt *lockt);
  618. extern __be32 nfsd4_locku(struct svc_rqst *rqstp,
  619. struct nfsd4_compound_state *,
  620. struct nfsd4_locku *locku);
  621. extern __be32
  622. nfsd4_release_lockowner(struct svc_rqst *rqstp,
  623. struct nfsd4_compound_state *,
  624. struct nfsd4_release_lockowner *rlockowner);
  625. extern int nfsd4_release_compoundargs(void *rq, __be32 *p, void *resp);
  626. extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
  627. struct nfsd4_compound_state *, struct nfsd4_delegreturn *dr);
  628. extern __be32 nfsd4_renew(struct svc_rqst *rqstp,
  629. struct nfsd4_compound_state *, clientid_t *clid);
  630. extern __be32 nfsd4_test_stateid(struct svc_rqst *rqstp,
  631. struct nfsd4_compound_state *, struct nfsd4_test_stateid *test_stateid);
  632. extern __be32 nfsd4_free_stateid(struct svc_rqst *rqstp,
  633. struct nfsd4_compound_state *, struct nfsd4_free_stateid *free_stateid);
  634. extern void nfsd4_bump_seqid(struct nfsd4_compound_state *, __be32 nfserr);
  635. #endif
  636. /*
  637. * Local variables:
  638. * c-basic-offset: 8
  639. * End:
  640. */