diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-07-30 16:05:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-30 19:06:41 -0400 |
commit | ddda8e0aa8b955e20cb80908189bfa154ab54837 (patch) | |
tree | ff5b1041ce86c76519c1b824161ce5d7ad2e49db | |
parent | fac1e8e4ef417e958060a6c3a061cc1a180bd8ae (diff) |
NFS: Convert v2 into a module
The module (nfs2.ko) will be created in the same directory as nfs.ko and
will be automatically loaded the first time you try to mount over NFS v2.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/Kconfig | 2 | ||||
-rw-r--r-- | fs/nfs/Makefile | 4 | ||||
-rw-r--r-- | fs/nfs/client.c | 12 | ||||
-rw-r--r-- | fs/nfs/dir.c | 13 | ||||
-rw-r--r-- | fs/nfs/file.c | 2 | ||||
-rw-r--r-- | fs/nfs/inode.c | 10 | ||||
-rw-r--r-- | fs/nfs/namespace.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs.h | 14 | ||||
-rw-r--r-- | fs/nfs/nfs2super.c | 9 | ||||
-rw-r--r-- | fs/nfs/read.c | 1 | ||||
-rw-r--r-- | fs/nfs/super.c | 3 | ||||
-rw-r--r-- | fs/nfs/write.c | 2 |
12 files changed, 50 insertions, 24 deletions
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index 404c6a8ac394..6764dbf66d05 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig | |||
@@ -30,7 +30,7 @@ config NFS_FS | |||
30 | If unsure, say N. | 30 | If unsure, say N. |
31 | 31 | ||
32 | config NFS_V2 | 32 | config NFS_V2 |
33 | bool "NFS client support for NFS version 2" | 33 | tristate "NFS client support for NFS version 2" |
34 | depends on NFS_FS | 34 | depends on NFS_FS |
35 | default y | 35 | default y |
36 | help | 36 | help |
diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index 7ca0125da65e..df61db41bfa8 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile | |||
@@ -9,7 +9,6 @@ nfs-y := client.o dir.o file.o getroot.o inode.o super.o \ | |||
9 | write.o namespace.o mount_clnt.o \ | 9 | write.o namespace.o mount_clnt.o \ |
10 | dns_resolve.o cache_lib.o | 10 | dns_resolve.o cache_lib.o |
11 | nfs-$(CONFIG_ROOT_NFS) += nfsroot.o | 11 | nfs-$(CONFIG_ROOT_NFS) += nfsroot.o |
12 | nfs-$(CONFIG_NFS_V2) += nfs2super.o proc.o nfs2xdr.o | ||
13 | nfs-$(CONFIG_NFS_V3) += nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o | 12 | nfs-$(CONFIG_NFS_V3) += nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o |
14 | nfs-$(CONFIG_NFS_V3_ACL) += nfs3acl.o | 13 | nfs-$(CONFIG_NFS_V3_ACL) += nfs3acl.o |
15 | nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ | 14 | nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ |
@@ -25,6 +24,9 @@ endif | |||
25 | 24 | ||
26 | nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o | 25 | nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o |
27 | 26 | ||
27 | obj-$(CONFIG_NFS_V2) += nfs2.o | ||
28 | nfs2-y := nfs2super.o proc.o nfs2xdr.o | ||
29 | |||
28 | obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o | 30 | obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o |
29 | nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o | 31 | nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o |
30 | 32 | ||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 1f2908287cba..fa8acf510333 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -149,11 +149,7 @@ EXPORT_SYMBOL_GPL(unregister_nfs_version); | |||
149 | */ | 149 | */ |
150 | int __init nfs_register_versions(void) | 150 | int __init nfs_register_versions(void) |
151 | { | 151 | { |
152 | int err = init_nfs_v2(); | 152 | int err = init_nfs_v3(); |
153 | if (err) | ||
154 | return err; | ||
155 | |||
156 | err = init_nfs_v3(); | ||
157 | if (err) | 153 | if (err) |
158 | return err; | 154 | return err; |
159 | 155 | ||
@@ -165,7 +161,6 @@ int __init nfs_register_versions(void) | |||
165 | */ | 161 | */ |
166 | void nfs_unregister_versions(void) | 162 | void nfs_unregister_versions(void) |
167 | { | 163 | { |
168 | exit_nfs_v2(); | ||
169 | exit_nfs_v3(); | 164 | exit_nfs_v3(); |
170 | exit_nfs_v4(); | 165 | exit_nfs_v4(); |
171 | } | 166 | } |
@@ -222,6 +217,7 @@ error_cleanup: | |||
222 | error_0: | 217 | error_0: |
223 | return ERR_PTR(err); | 218 | return ERR_PTR(err); |
224 | } | 219 | } |
220 | EXPORT_SYMBOL_GPL(nfs_alloc_client); | ||
225 | 221 | ||
226 | #ifdef CONFIG_NFS_V4 | 222 | #ifdef CONFIG_NFS_V4 |
227 | /* idr_remove_all is not needed as all id's are removed by nfs_put_client */ | 223 | /* idr_remove_all is not needed as all id's are removed by nfs_put_client */ |
@@ -284,6 +280,7 @@ void nfs_free_client(struct nfs_client *clp) | |||
284 | 280 | ||
285 | dprintk("<-- nfs_free_client()\n"); | 281 | dprintk("<-- nfs_free_client()\n"); |
286 | } | 282 | } |
283 | EXPORT_SYMBOL_GPL(nfs_free_client); | ||
287 | 284 | ||
288 | /* | 285 | /* |
289 | * Release a reference to a shared client record | 286 | * Release a reference to a shared client record |
@@ -753,6 +750,7 @@ error: | |||
753 | dprintk("<-- nfs_init_client() = xerror %d\n", error); | 750 | dprintk("<-- nfs_init_client() = xerror %d\n", error); |
754 | return ERR_PTR(error); | 751 | return ERR_PTR(error); |
755 | } | 752 | } |
753 | EXPORT_SYMBOL_GPL(nfs_init_client); | ||
756 | 754 | ||
757 | /* | 755 | /* |
758 | * Create a version 2 or 3 client | 756 | * Create a version 2 or 3 client |
@@ -1122,6 +1120,7 @@ error: | |||
1122 | nfs_free_server(server); | 1120 | nfs_free_server(server); |
1123 | return ERR_PTR(error); | 1121 | return ERR_PTR(error); |
1124 | } | 1122 | } |
1123 | EXPORT_SYMBOL_GPL(nfs_create_server); | ||
1125 | 1124 | ||
1126 | /* | 1125 | /* |
1127 | * Clone an NFS2, NFS3 or NFS4 server record | 1126 | * Clone an NFS2, NFS3 or NFS4 server record |
@@ -1191,6 +1190,7 @@ out_free_server: | |||
1191 | dprintk("<-- nfs_clone_server() = error %d\n", error); | 1190 | dprintk("<-- nfs_clone_server() = error %d\n", error); |
1192 | return ERR_PTR(error); | 1191 | return ERR_PTR(error); |
1193 | } | 1192 | } |
1193 | EXPORT_SYMBOL_GPL(nfs_clone_server); | ||
1194 | 1194 | ||
1195 | void nfs_clients_init(struct net *net) | 1195 | void nfs_clients_init(struct net *net) |
1196 | { | 1196 | { |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index d49f1b9cd3fd..c382a6d5e177 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM | 17 | * 6 Jun 1999 Cache readdir lookups in the page cache. -DaveM |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <linux/module.h> | ||
20 | #include <linux/time.h> | 21 | #include <linux/time.h> |
21 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
22 | #include <linux/stat.h> | 23 | #include <linux/stat.h> |
@@ -1196,6 +1197,7 @@ const struct dentry_operations nfs_dentry_operations = { | |||
1196 | .d_automount = nfs_d_automount, | 1197 | .d_automount = nfs_d_automount, |
1197 | .d_release = nfs_d_release, | 1198 | .d_release = nfs_d_release, |
1198 | }; | 1199 | }; |
1200 | EXPORT_SYMBOL_GPL(nfs_dentry_operations); | ||
1199 | 1201 | ||
1200 | struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) | 1202 | struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, unsigned int flags) |
1201 | { | 1203 | { |
@@ -1263,6 +1265,7 @@ out: | |||
1263 | nfs_free_fhandle(fhandle); | 1265 | nfs_free_fhandle(fhandle); |
1264 | return res; | 1266 | return res; |
1265 | } | 1267 | } |
1268 | EXPORT_SYMBOL_GPL(nfs_lookup); | ||
1266 | 1269 | ||
1267 | #ifdef CONFIG_NFS_V4 | 1270 | #ifdef CONFIG_NFS_V4 |
1268 | static int nfs4_lookup_revalidate(struct dentry *, unsigned int); | 1271 | static int nfs4_lookup_revalidate(struct dentry *, unsigned int); |
@@ -1508,6 +1511,7 @@ out_error: | |||
1508 | dput(parent); | 1511 | dput(parent); |
1509 | return error; | 1512 | return error; |
1510 | } | 1513 | } |
1514 | EXPORT_SYMBOL_GPL(nfs_instantiate); | ||
1511 | 1515 | ||
1512 | /* | 1516 | /* |
1513 | * Following a failed create operation, we drop the dentry rather | 1517 | * Following a failed create operation, we drop the dentry rather |
@@ -1536,6 +1540,7 @@ out_err: | |||
1536 | d_drop(dentry); | 1540 | d_drop(dentry); |
1537 | return error; | 1541 | return error; |
1538 | } | 1542 | } |
1543 | EXPORT_SYMBOL_GPL(nfs_create); | ||
1539 | 1544 | ||
1540 | /* | 1545 | /* |
1541 | * See comments for nfs_proc_create regarding failed operations. | 1546 | * See comments for nfs_proc_create regarding failed operations. |
@@ -1563,6 +1568,7 @@ out_err: | |||
1563 | d_drop(dentry); | 1568 | d_drop(dentry); |
1564 | return status; | 1569 | return status; |
1565 | } | 1570 | } |
1571 | EXPORT_SYMBOL_GPL(nfs_mknod); | ||
1566 | 1572 | ||
1567 | /* | 1573 | /* |
1568 | * See comments for nfs_proc_create regarding failed operations. | 1574 | * See comments for nfs_proc_create regarding failed operations. |
@@ -1586,6 +1592,7 @@ out_err: | |||
1586 | d_drop(dentry); | 1592 | d_drop(dentry); |
1587 | return error; | 1593 | return error; |
1588 | } | 1594 | } |
1595 | EXPORT_SYMBOL_GPL(nfs_mkdir); | ||
1589 | 1596 | ||
1590 | static void nfs_dentry_handle_enoent(struct dentry *dentry) | 1597 | static void nfs_dentry_handle_enoent(struct dentry *dentry) |
1591 | { | 1598 | { |
@@ -1609,6 +1616,7 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
1609 | 1616 | ||
1610 | return error; | 1617 | return error; |
1611 | } | 1618 | } |
1619 | EXPORT_SYMBOL_GPL(nfs_rmdir); | ||
1612 | 1620 | ||
1613 | /* | 1621 | /* |
1614 | * Remove a file after making sure there are no pending writes, | 1622 | * Remove a file after making sure there are no pending writes, |
@@ -1680,6 +1688,7 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry) | |||
1680 | d_rehash(dentry); | 1688 | d_rehash(dentry); |
1681 | return error; | 1689 | return error; |
1682 | } | 1690 | } |
1691 | EXPORT_SYMBOL_GPL(nfs_unlink); | ||
1683 | 1692 | ||
1684 | /* | 1693 | /* |
1685 | * To create a symbolic link, most file systems instantiate a new inode, | 1694 | * To create a symbolic link, most file systems instantiate a new inode, |
@@ -1750,6 +1759,7 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) | |||
1750 | 1759 | ||
1751 | return 0; | 1760 | return 0; |
1752 | } | 1761 | } |
1762 | EXPORT_SYMBOL_GPL(nfs_symlink); | ||
1753 | 1763 | ||
1754 | int | 1764 | int |
1755 | nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | 1765 | nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) |
@@ -1771,6 +1781,7 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1771 | } | 1781 | } |
1772 | return error; | 1782 | return error; |
1773 | } | 1783 | } |
1784 | EXPORT_SYMBOL_GPL(nfs_link); | ||
1774 | 1785 | ||
1775 | /* | 1786 | /* |
1776 | * RENAME | 1787 | * RENAME |
@@ -1869,6 +1880,7 @@ out: | |||
1869 | dput(dentry); | 1880 | dput(dentry); |
1870 | return error; | 1881 | return error; |
1871 | } | 1882 | } |
1883 | EXPORT_SYMBOL_GPL(nfs_rename); | ||
1872 | 1884 | ||
1873 | static DEFINE_SPINLOCK(nfs_access_lru_lock); | 1885 | static DEFINE_SPINLOCK(nfs_access_lru_lock); |
1874 | static LIST_HEAD(nfs_access_lru_list); | 1886 | static LIST_HEAD(nfs_access_lru_list); |
@@ -2188,6 +2200,7 @@ out_notsup: | |||
2188 | res = generic_permission(inode, mask); | 2200 | res = generic_permission(inode, mask); |
2189 | goto out; | 2201 | goto out; |
2190 | } | 2202 | } |
2203 | EXPORT_SYMBOL_GPL(nfs_permission); | ||
2191 | 2204 | ||
2192 | /* | 2205 | /* |
2193 | * Local variables: | 2206 | * Local variables: |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 1b3925426929..5b3e70389553 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -16,6 +16,7 @@ | |||
16 | * nfs regular file handling functions | 16 | * nfs regular file handling functions |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/module.h> | ||
19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
20 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
21 | #include <linux/errno.h> | 22 | #include <linux/errno.h> |
@@ -865,3 +866,4 @@ const struct file_operations nfs_file_operations = { | |||
865 | .check_flags = nfs_check_flags, | 866 | .check_flags = nfs_check_flags, |
866 | .setlease = nfs_setlease, | 867 | .setlease = nfs_setlease, |
867 | }; | 868 | }; |
869 | EXPORT_SYMBOL_GPL(nfs_file_operations); | ||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a6ffa4be2a03..f358b976e9e6 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -193,6 +193,7 @@ void nfs_invalidate_atime(struct inode *inode) | |||
193 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; | 193 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATIME; |
194 | spin_unlock(&inode->i_lock); | 194 | spin_unlock(&inode->i_lock); |
195 | } | 195 | } |
196 | EXPORT_SYMBOL_GPL(nfs_invalidate_atime); | ||
196 | 197 | ||
197 | /* | 198 | /* |
198 | * Invalidate, but do not unhash, the inode. | 199 | * Invalidate, but do not unhash, the inode. |
@@ -438,6 +439,7 @@ nfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
438 | out: | 439 | out: |
439 | return error; | 440 | return error; |
440 | } | 441 | } |
442 | EXPORT_SYMBOL_GPL(nfs_setattr); | ||
441 | 443 | ||
442 | /** | 444 | /** |
443 | * nfs_vmtruncate - unmap mappings "freed" by truncate() syscall | 445 | * nfs_vmtruncate - unmap mappings "freed" by truncate() syscall |
@@ -496,6 +498,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr) | |||
496 | nfs_vmtruncate(inode, attr->ia_size); | 498 | nfs_vmtruncate(inode, attr->ia_size); |
497 | } | 499 | } |
498 | } | 500 | } |
501 | EXPORT_SYMBOL_GPL(nfs_setattr_update_inode); | ||
499 | 502 | ||
500 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 503 | int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
501 | { | 504 | { |
@@ -535,6 +538,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
535 | out: | 538 | out: |
536 | return err; | 539 | return err; |
537 | } | 540 | } |
541 | EXPORT_SYMBOL_GPL(nfs_getattr); | ||
538 | 542 | ||
539 | static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) | 543 | static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) |
540 | { | 544 | { |
@@ -623,6 +627,7 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync) | |||
623 | return; | 627 | return; |
624 | nfs_revalidate_inode(server, inode); | 628 | nfs_revalidate_inode(server, inode); |
625 | } | 629 | } |
630 | EXPORT_SYMBOL_GPL(nfs_close_context); | ||
626 | 631 | ||
627 | struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode) | 632 | struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode) |
628 | { | 633 | { |
@@ -1028,6 +1033,7 @@ void nfs_fattr_init(struct nfs_fattr *fattr) | |||
1028 | fattr->owner_name = NULL; | 1033 | fattr->owner_name = NULL; |
1029 | fattr->group_name = NULL; | 1034 | fattr->group_name = NULL; |
1030 | } | 1035 | } |
1036 | EXPORT_SYMBOL_GPL(nfs_fattr_init); | ||
1031 | 1037 | ||
1032 | struct nfs_fattr *nfs_alloc_fattr(void) | 1038 | struct nfs_fattr *nfs_alloc_fattr(void) |
1033 | { | 1039 | { |
@@ -1038,6 +1044,7 @@ struct nfs_fattr *nfs_alloc_fattr(void) | |||
1038 | nfs_fattr_init(fattr); | 1044 | nfs_fattr_init(fattr); |
1039 | return fattr; | 1045 | return fattr; |
1040 | } | 1046 | } |
1047 | EXPORT_SYMBOL_GPL(nfs_alloc_fattr); | ||
1041 | 1048 | ||
1042 | struct nfs_fh *nfs_alloc_fhandle(void) | 1049 | struct nfs_fh *nfs_alloc_fhandle(void) |
1043 | { | 1050 | { |
@@ -1048,6 +1055,7 @@ struct nfs_fh *nfs_alloc_fhandle(void) | |||
1048 | fh->size = 0; | 1055 | fh->size = 0; |
1049 | return fh; | 1056 | return fh; |
1050 | } | 1057 | } |
1058 | EXPORT_SYMBOL_GPL(nfs_alloc_fhandle); | ||
1051 | 1059 | ||
1052 | #ifdef NFS_DEBUG | 1060 | #ifdef NFS_DEBUG |
1053 | /* | 1061 | /* |
@@ -1168,6 +1176,7 @@ int nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1168 | 1176 | ||
1169 | return status; | 1177 | return status; |
1170 | } | 1178 | } |
1179 | EXPORT_SYMBOL_GPL(nfs_refresh_inode); | ||
1171 | 1180 | ||
1172 | static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr *fattr) | 1181 | static int nfs_post_op_update_inode_locked(struct inode *inode, struct nfs_fattr *fattr) |
1173 | { | 1182 | { |
@@ -1255,6 +1264,7 @@ out_noforce: | |||
1255 | spin_unlock(&inode->i_lock); | 1264 | spin_unlock(&inode->i_lock); |
1256 | return status; | 1265 | return status; |
1257 | } | 1266 | } |
1267 | EXPORT_SYMBOL_GPL(nfs_post_op_update_inode_force_wcc); | ||
1258 | 1268 | ||
1259 | /* | 1269 | /* |
1260 | * Many nfs protocol calls return the new file attributes after | 1270 | * Many nfs protocol calls return the new file attributes after |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index 0f699fefee6e..2a3b170e88e0 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * NFS namespace | 7 | * NFS namespace |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <linux/module.h> | ||
10 | #include <linux/dcache.h> | 11 | #include <linux/dcache.h> |
11 | #include <linux/gfp.h> | 12 | #include <linux/gfp.h> |
12 | #include <linux/mount.h> | 13 | #include <linux/mount.h> |
@@ -255,3 +256,4 @@ struct vfsmount *nfs_submount(struct nfs_server *server, struct dentry *dentry, | |||
255 | 256 | ||
256 | return nfs_do_submount(dentry, fh, fattr, server->client->cl_auth->au_flavor); | 257 | return nfs_do_submount(dentry, fh, fattr, server->client->cl_auth->au_flavor); |
257 | } | 258 | } |
259 | EXPORT_SYMBOL_GPL(nfs_submount); | ||
diff --git a/fs/nfs/nfs.h b/fs/nfs/nfs.h index 9f502a0c1e59..f5d1cf5f5dc7 100644 --- a/fs/nfs/nfs.h +++ b/fs/nfs/nfs.h | |||
@@ -24,20 +24,6 @@ struct nfs_subversion { | |||
24 | int nfs_register_versions(void); | 24 | int nfs_register_versions(void); |
25 | void nfs_unregister_versions(void); | 25 | void nfs_unregister_versions(void); |
26 | 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 | 27 | #ifdef CONFIG_NFS_V3 |
42 | int init_nfs_v3(void); | 28 | int init_nfs_v3(void); |
43 | void exit_nfs_v3(void); | 29 | void exit_nfs_v3(void); |
diff --git a/fs/nfs/nfs2super.c b/fs/nfs/nfs2super.c index a9fb69d72816..0a9782c9171a 100644 --- a/fs/nfs/nfs2super.c +++ b/fs/nfs/nfs2super.c | |||
@@ -14,13 +14,18 @@ static struct nfs_subversion nfs_v2 = { | |||
14 | .sops = &nfs_sops, | 14 | .sops = &nfs_sops, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | int __init init_nfs_v2(void) | 17 | static int __init init_nfs_v2(void) |
18 | { | 18 | { |
19 | register_nfs_version(&nfs_v2); | 19 | register_nfs_version(&nfs_v2); |
20 | return 0; | 20 | return 0; |
21 | } | 21 | } |
22 | 22 | ||
23 | void exit_nfs_v2(void) | 23 | static void __exit exit_nfs_v2(void) |
24 | { | 24 | { |
25 | unregister_nfs_version(&nfs_v2); | 25 | unregister_nfs_version(&nfs_v2); |
26 | } | 26 | } |
27 | |||
28 | MODULE_LICENSE("GPL"); | ||
29 | |||
30 | module_init(init_nfs_v2); | ||
31 | module_exit(exit_nfs_v2); | ||
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 6267b873bbcb..b000e4c0cf83 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -113,6 +113,7 @@ void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, | |||
113 | nfs_pageio_init(pgio, inode, &nfs_pageio_read_ops, compl_ops, | 113 | nfs_pageio_init(pgio, inode, &nfs_pageio_read_ops, compl_ops, |
114 | NFS_SERVER(inode)->rsize, 0); | 114 | NFS_SERVER(inode)->rsize, 0); |
115 | } | 115 | } |
116 | EXPORT_SYMBOL_GPL(nfs_pageio_init_read); | ||
116 | 117 | ||
117 | void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio) | 118 | void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio) |
118 | { | 119 | { |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 8e0da5a6b3c5..999ce7505142 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -289,6 +289,7 @@ struct file_system_type nfs_fs_type = { | |||
289 | .kill_sb = nfs_kill_super, | 289 | .kill_sb = nfs_kill_super, |
290 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, | 290 | .fs_flags = FS_RENAME_DOES_D_MOVE|FS_REVAL_DOT|FS_BINARY_MOUNTDATA, |
291 | }; | 291 | }; |
292 | EXPORT_SYMBOL_GPL(nfs_fs_type); | ||
292 | 293 | ||
293 | struct file_system_type nfs_xdev_fs_type = { | 294 | struct file_system_type nfs_xdev_fs_type = { |
294 | .owner = THIS_MODULE, | 295 | .owner = THIS_MODULE, |
@@ -312,6 +313,7 @@ const struct super_operations nfs_sops = { | |||
312 | .show_stats = nfs_show_stats, | 313 | .show_stats = nfs_show_stats, |
313 | .remount_fs = nfs_remount, | 314 | .remount_fs = nfs_remount, |
314 | }; | 315 | }; |
316 | EXPORT_SYMBOL_GPL(nfs_sops); | ||
315 | 317 | ||
316 | #ifdef CONFIG_NFS_V4 | 318 | #ifdef CONFIG_NFS_V4 |
317 | static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *); | 319 | static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *); |
@@ -1670,6 +1672,7 @@ struct dentry *nfs_try_mount(int flags, const char *dev_name, | |||
1670 | 1672 | ||
1671 | return nfs_fs_mount_common(server, flags, dev_name, mount_info, nfs_mod); | 1673 | return nfs_fs_mount_common(server, flags, dev_name, mount_info, nfs_mod); |
1672 | } | 1674 | } |
1675 | EXPORT_SYMBOL_GPL(nfs_try_mount); | ||
1673 | 1676 | ||
1674 | /* | 1677 | /* |
1675 | * Split "dev_name" into "hostname:export_path". | 1678 | * Split "dev_name" into "hostname:export_path". |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 6ddac54dc67f..1e8d4b043769 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1210,6 +1210,7 @@ void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, | |||
1210 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, compl_ops, | 1210 | nfs_pageio_init(pgio, inode, &nfs_pageio_write_ops, compl_ops, |
1211 | NFS_SERVER(inode)->wsize, ioflags); | 1211 | NFS_SERVER(inode)->wsize, ioflags); |
1212 | } | 1212 | } |
1213 | EXPORT_SYMBOL_GPL(nfs_pageio_init_write); | ||
1213 | 1214 | ||
1214 | void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio) | 1215 | void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio) |
1215 | { | 1216 | { |
@@ -1688,6 +1689,7 @@ int nfs_wb_all(struct inode *inode) | |||
1688 | 1689 | ||
1689 | return sync_inode(inode, &wbc); | 1690 | return sync_inode(inode, &wbc); |
1690 | } | 1691 | } |
1692 | EXPORT_SYMBOL_GPL(nfs_wb_all); | ||
1691 | 1693 | ||
1692 | int nfs_wb_page_cancel(struct inode *inode, struct page *page) | 1694 | int nfs_wb_page_cancel(struct inode *inode, struct page *page) |
1693 | { | 1695 | { |