nfs.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2012 Netapp, Inc. All rights reserved.
  3. *
  4. * Function and structures exported by the NFS module
  5. * for use by NFS version-specific modules.
  6. */
  7. #ifndef __LINUX_INTERNAL_NFS_H
  8. #define __LINUX_INTERNAL_NFS_H
  9. #include <linux/fs.h>
  10. #include <linux/sunrpc/sched.h>
  11. #include <linux/nfs_xdr.h>
  12. struct nfs_subversion {
  13. struct module *owner; /* THIS_MODULE pointer */
  14. struct file_system_type *nfs_fs; /* NFS filesystem type */
  15. const struct rpc_version *rpc_vers; /* NFS version information */
  16. const struct nfs_rpc_ops *rpc_ops; /* NFS operations */
  17. const struct super_operations *sops; /* NFS Super operations */
  18. const struct xattr_handler **xattr; /* NFS xattr handlers */
  19. struct list_head list; /* List of NFS versions */
  20. };
  21. int nfs_register_versions(void);
  22. void nfs_unregister_versions(void);
  23. #ifdef CONFIG_NFS_V2
  24. int init_nfs_v2(void);
  25. void exit_nfs_v2(void);
  26. #else /* CONFIG_NFS_V2 */
  27. static inline int __init init_nfs_v2(void)
  28. {
  29. return 0;
  30. }
  31. static inline void exit_nfs_v2(void)
  32. {
  33. }
  34. #endif /* CONFIG_NFS_V2 */
  35. #ifdef CONFIG_NFS_V3
  36. int init_nfs_v3(void);
  37. void exit_nfs_v3(void);
  38. #else /* CONFIG_NFS_V3 */
  39. static inline int __init init_nfs_v3(void)
  40. {
  41. return 0;
  42. }
  43. static inline void exit_nfs_v3(void)
  44. {
  45. }
  46. #endif /* CONFIG_NFS_V3 */
  47. #ifdef CONFIG_NFS_V4
  48. int init_nfs_v4(void);
  49. void exit_nfs_v4(void);
  50. #else /* CONFIG_NFS_V4 */
  51. static inline int __init init_nfs_v4(void)
  52. {
  53. return 0;
  54. }
  55. static inline void exit_nfs_v4(void)
  56. {
  57. }
  58. #endif /* CONFIG_NFS_V4 */
  59. struct nfs_subversion *get_nfs_version(unsigned int);
  60. void put_nfs_version(struct nfs_subversion *);
  61. void register_nfs_version(struct nfs_subversion *);
  62. void unregister_nfs_version(struct nfs_subversion *);
  63. #endif /* __LINUX_INTERNAL_NFS_H */