Bryan Schumaker | ab7017a | 2012-07-30 16:05:16 -0400 | [diff] [blame] | 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 | |
| 10 | #include <linux/fs.h> |
| 11 | #include <linux/sunrpc/sched.h> |
| 12 | #include <linux/nfs_xdr.h> |
| 13 | |
| 14 | struct nfs_subversion { |
| 15 | struct module *owner; /* THIS_MODULE pointer */ |
| 16 | struct file_system_type *nfs_fs; /* NFS filesystem type */ |
| 17 | const struct rpc_version *rpc_vers; /* NFS version information */ |
| 18 | const struct nfs_rpc_ops *rpc_ops; /* NFS operations */ |
Bryan Schumaker | 6a74490 | 2012-07-30 16:05:20 -0400 | [diff] [blame^] | 19 | const struct super_operations *sops; /* NFS Super operations */ |
| 20 | const struct xattr_handler **xattr; /* NFS xattr handlers */ |
Bryan Schumaker | ab7017a | 2012-07-30 16:05:16 -0400 | [diff] [blame] | 21 | struct list_head list; /* List of NFS versions */ |
| 22 | }; |
| 23 | |
| 24 | int nfs_register_versions(void); |
| 25 | void nfs_unregister_versions(void); |
| 26 | |
| 27 | #ifdef CONFIG_NFS_V2 |
| 28 | int init_nfs_v2(void); |
| 29 | void exit_nfs_v2(void); |
| 30 | #else /* CONFIG_NFS_V2 */ |
| 31 | static inline int __init init_nfs_v2(void) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | static inline void exit_nfs_v2(void) |
| 37 | { |
| 38 | } |
| 39 | #endif /* CONFIG_NFS_V2 */ |
| 40 | |
| 41 | #ifdef CONFIG_NFS_V3 |
| 42 | int init_nfs_v3(void); |
| 43 | void exit_nfs_v3(void); |
| 44 | #else /* CONFIG_NFS_V3 */ |
| 45 | static inline int __init init_nfs_v3(void) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | static inline void exit_nfs_v3(void) |
| 51 | { |
| 52 | } |
| 53 | #endif /* CONFIG_NFS_V3 */ |
| 54 | |
| 55 | #ifdef CONFIG_NFS_V4 |
| 56 | int init_nfs_v4(void); |
| 57 | void exit_nfs_v4(void); |
| 58 | #else /* CONFIG_NFS_V4 */ |
| 59 | static inline int __init init_nfs_v4(void) |
| 60 | { |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 64 | static inline void exit_nfs_v4(void) |
| 65 | { |
| 66 | } |
| 67 | #endif /* CONFIG_NFS_V4 */ |
| 68 | |
| 69 | struct nfs_subversion *get_nfs_version(unsigned int); |
| 70 | void put_nfs_version(struct nfs_subversion *); |
| 71 | void register_nfs_version(struct nfs_subversion *); |
| 72 | void unregister_nfs_version(struct nfs_subversion *); |
| 73 | |
| 74 | #endif /* __LINUX_INTERNAL_NFS_H */ |