callback.h 1.8 KB

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