bind.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * linux/include/linux/lockd/bind.h
  3. *
  4. * This is the part of lockd visible to nfsd and the nfs client.
  5. *
  6. * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  7. */
  8. #ifndef LINUX_LOCKD_BIND_H
  9. #define LINUX_LOCKD_BIND_H
  10. #include <linux/lockd/nlm.h>
  11. /* need xdr-encoded error codes too, so... */
  12. #include <linux/lockd/xdr.h>
  13. #ifdef CONFIG_LOCKD_V4
  14. #include <linux/lockd/xdr4.h>
  15. #endif
  16. /* Dummy declarations */
  17. struct svc_rqst;
  18. /*
  19. * This is the set of functions for lockd->nfsd communication
  20. */
  21. struct nlmsvc_binding {
  22. __be32 (*fopen)(struct svc_rqst *,
  23. struct nfs_fh *,
  24. struct file **);
  25. void (*fclose)(struct file *);
  26. unsigned long (*get_grace_period)(void);
  27. };
  28. extern struct nlmsvc_binding * nlmsvc_ops;
  29. /*
  30. * Similar to nfs_client_initdata, but without the NFS-specific
  31. * rpc_ops field.
  32. */
  33. struct nlmclnt_initdata {
  34. const char *hostname;
  35. const struct sockaddr *address;
  36. size_t addrlen;
  37. unsigned short protocol;
  38. u32 nfs_version;
  39. };
  40. /*
  41. * Functions exported by the lockd module
  42. */
  43. extern struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init);
  44. extern void nlmclnt_done(struct nlm_host *host);
  45. extern int nlmclnt_proc(struct nlm_host *host, int cmd,
  46. struct file_lock *fl);
  47. extern int lockd_up(int proto);
  48. extern void lockd_down(void);
  49. unsigned long get_nfs_grace_period(void);
  50. #ifdef CONFIG_NFSD_V4
  51. unsigned long get_nfs4_grace_period(void);
  52. #else
  53. static inline unsigned long get_nfs4_grace_period(void) {return 0;}
  54. #endif
  55. #endif /* LINUX_LOCKD_BIND_H */