aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs.h
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-07-30 16:05:16 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-07-30 19:04:17 -0400
commitab7017a3a0a64b953e091619c30413b3721d925d (patch)
tree1ec947c2794b217d7ead01ee29d8cc5aae4c51f8 /fs/nfs/nfs.h
parenta427b9ec4eda8cd6e641ea24541d30b641fc3140 (diff)
NFS: Add version registering framework
This patch adds in the code to track multiple versions of the NFS protocol. I created default structures for v2, v3 and v4 so that each version can continue to work while I convert them into kernel modules. I also removed the const parameter from the rpc_version array so that I can change it at runtime. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs.h')
-rw-r--r--fs/nfs/nfs.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/fs/nfs/nfs.h b/fs/nfs/nfs.h
new file mode 100644
index 000000000000..ac10b9e6c920
--- /dev/null
+++ b/fs/nfs/nfs.h
@@ -0,0 +1,72 @@
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
14struct 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 */
19 struct list_head list; /* List of NFS versions */
20};
21
22int nfs_register_versions(void);
23void nfs_unregister_versions(void);
24
25#ifdef CONFIG_NFS_V2
26int init_nfs_v2(void);
27void exit_nfs_v2(void);
28#else /* CONFIG_NFS_V2 */
29static inline int __init init_nfs_v2(void)
30{
31 return 0;
32}
33
34static inline void exit_nfs_v2(void)
35{
36}
37#endif /* CONFIG_NFS_V2 */
38
39#ifdef CONFIG_NFS_V3
40int init_nfs_v3(void);
41void exit_nfs_v3(void);
42#else /* CONFIG_NFS_V3 */
43static inline int __init init_nfs_v3(void)
44{
45 return 0;
46}
47
48static inline void exit_nfs_v3(void)
49{
50}
51#endif /* CONFIG_NFS_V3 */
52
53#ifdef CONFIG_NFS_V4
54int init_nfs_v4(void);
55void exit_nfs_v4(void);
56#else /* CONFIG_NFS_V4 */
57static inline int __init init_nfs_v4(void)
58{
59 return 0;
60}
61
62static inline void exit_nfs_v4(void)
63{
64}
65#endif /* CONFIG_NFS_V4 */
66
67struct nfs_subversion *get_nfs_version(unsigned int);
68void put_nfs_version(struct nfs_subversion *);
69void register_nfs_version(struct nfs_subversion *);
70void unregister_nfs_version(struct nfs_subversion *);
71
72#endif /* __LINUX_INTERNAL_NFS_H */