callback.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. uint32_t *status;
  30. int taglen;
  31. const char *tag;
  32. uint32_t *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. uint32_t 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 unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
  54. extern unsigned nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
  55. extern int nfs_callback_up(void);
  56. extern int nfs_callback_down(void);
  57. extern unsigned int nfs_callback_set_tcpport;
  58. extern unsigned short nfs_callback_tcpport;
  59. #endif /* __LINUX_FS_NFS_CALLBACK_H */