callback.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_NOTIFY_DEVICEID = 14,
  31. OP_CB_ILLEGAL = 10044,
  32. };
  33. struct cb_compound_hdr_arg {
  34. unsigned int taglen;
  35. const char *tag;
  36. unsigned int minorversion;
  37. unsigned nops;
  38. };
  39. struct cb_compound_hdr_res {
  40. __be32 *status;
  41. unsigned int taglen;
  42. const char *tag;
  43. __be32 *nops;
  44. };
  45. struct cb_getattrargs {
  46. struct sockaddr *addr;
  47. struct nfs_fh fh;
  48. uint32_t bitmap[2];
  49. };
  50. struct cb_getattrres {
  51. __be32 status;
  52. uint32_t bitmap[2];
  53. uint64_t size;
  54. uint64_t change_attr;
  55. struct timespec ctime;
  56. struct timespec mtime;
  57. };
  58. struct cb_recallargs {
  59. struct sockaddr *addr;
  60. struct nfs_fh fh;
  61. nfs4_stateid stateid;
  62. uint32_t truncate;
  63. };
  64. extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
  65. extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
  66. #ifdef CONFIG_NFS_V4
  67. extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt);
  68. extern void nfs_callback_down(int minorversion);
  69. #endif /* CONFIG_NFS_V4 */
  70. /*
  71. * nfs41: Callbacks are expected to not cause substantial latency,
  72. * so we limit their concurrency to 1 by setting up the maximum number
  73. * of slots for the backchannel.
  74. */
  75. #define NFS41_BC_MIN_CALLBACKS 1
  76. extern unsigned int nfs_callback_set_tcpport;
  77. extern unsigned short nfs_callback_tcpport;
  78. extern unsigned short nfs_callback_tcpport6;
  79. #endif /* __LINUX_FS_NFS_CALLBACK_H */