callback.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. 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. int taglen;
  31. const char *tag;
  32. __be32 *nops;
  33. };
  34. struct cb_getattrargs {
  35. struct sockaddr_in *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_in *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(void);
  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. extern unsigned int nfs_callback_set_tcpport;
  63. extern unsigned short nfs_callback_tcpport;
  64. #endif /* __LINUX_FS_NFS_CALLBACK_H */