callback.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * linux/fs/nfs/callback.h
  3. *
  4. * Copyright (C) 2004 Trond Myklebust
  5. *
  6. * NFSv4 callback definitions
  7. */
  8. #ifndef __LINUX_FS_NFS_CALLBACK_H
  9. #define __LINUX_FS_NFS_CALLBACK_H
  10. #define NFS4_CALLBACK 0x40000000
  11. #define NFS4_CALLBACK_XDRSIZE 2048
  12. #define NFS4_CALLBACK_BUFSIZE (1024 + NFS4_CALLBACK_XDRSIZE)
  13. enum nfs4_callback_procnum {
  14. CB_NULL = 0,
  15. CB_COMPOUND = 1,
  16. };
  17. enum nfs4_callback_opnum {
  18. OP_CB_GETATTR = 3,
  19. OP_CB_RECALL = 4,
  20. /* Callback operations new to NFSv4.1 */
  21. OP_CB_LAYOUTRECALL = 5,
  22. OP_CB_NOTIFY = 6,
  23. OP_CB_PUSH_DELEG = 7,
  24. OP_CB_RECALL_ANY = 8,
  25. OP_CB_RECALLABLE_OBJ_AVAIL = 9,
  26. OP_CB_RECALL_SLOT = 10,
  27. OP_CB_SEQUENCE = 11,
  28. OP_CB_WANTS_CANCELLED = 12,
  29. OP_CB_NOTIFY_LOCK = 13,
  30. OP_CB_ILLEGAL = 10044,
  31. };
  32. struct cb_compound_hdr_arg {
  33. unsigned int taglen;
  34. const char *tag;
  35. unsigned int minorversion;
  36. unsigned nops;
  37. };
  38. struct cb_compound_hdr_res {
  39. __be32 *status;
  40. unsigned int taglen;
  41. const char *tag;
  42. __be32 *nops;
  43. };
  44. struct cb_getattrargs {
  45. struct sockaddr *addr;
  46. struct nfs_fh fh;
  47. uint32_t bitmap[2];
  48. };
  49. struct cb_getattrres {
  50. __be32 status;
  51. uint32_t bitmap[2];
  52. uint64_t size;
  53. uint64_t change_attr;
  54. struct timespec ctime;
  55. struct timespec mtime;
  56. };
  57. struct cb_recallargs {
  58. struct sockaddr *addr;
  59. struct nfs_fh fh;
  60. nfs4_stateid stateid;
  61. uint32_t truncate;
  62. };
  63. extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
  64. extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
  65. #ifdef CONFIG_NFS_V4
  66. extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt);
  67. extern void nfs_callback_down(int minorversion);
  68. #endif /* CONFIG_NFS_V4 */
  69. /*
  70. * nfs41: Callbacks are expected to not cause substantial latency,
  71. * so we limit their concurrency to 1 by setting up the maximum number
  72. * of slots for the backchannel.
  73. */
  74. #define NFS41_BC_MIN_CALLBACKS 1
  75. extern unsigned int nfs_callback_set_tcpport;
  76. extern unsigned short nfs_callback_tcpport;
  77. extern unsigned short nfs_callback_tcpport6;
  78. #endif /* __LINUX_FS_NFS_CALLBACK_H */