callback.h 1.8 KB

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