diff options
-rw-r--r-- | fs/nfs/Kconfig | 2 | ||||
-rw-r--r-- | fs/nfs/Makefile | 6 | ||||
-rw-r--r-- | fs/nfs/client.c | 5 | ||||
-rw-r--r-- | fs/nfs/dir.c | 1 | ||||
-rw-r--r-- | fs/nfs/direct.c | 2 | ||||
-rw-r--r-- | fs/nfs/inode.c | 3 | ||||
-rw-r--r-- | fs/nfs/internal.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs.h | 14 | ||||
-rw-r--r-- | fs/nfs/nfs3super.c | 9 | ||||
-rw-r--r-- | fs/nfs/super.c | 6 | ||||
-rw-r--r-- | fs/nfs/write.c | 8 |
11 files changed, 25 insertions, 33 deletions
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index 6764dbf66d05..f81a729c00e9 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig | |||
@@ -40,7 +40,7 @@ config NFS_V2 | |||
40 | If unsure, say Y. | 40 | If unsure, say Y. |
41 | 41 | ||
42 | config NFS_V3 | 42 | config NFS_V3 |
43 | bool "NFS client support for NFS version 3" | 43 | tristate "NFS client support for NFS version 3" |
44 | depends on NFS_FS | 44 | depends on NFS_FS |
45 | default y | 45 | default y |
46 | help | 46 | help |
diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index df61db41bfa8..01846edc5c94 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile | |||
@@ -9,8 +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_V3) += nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o | ||
13 | nfs-$(CONFIG_NFS_V3_ACL) += nfs3acl.o | ||
14 | nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ | 12 | nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ |
15 | nfs4super.o nfs4file.o delegation.o idmap.o \ | 13 | nfs4super.o nfs4file.o delegation.o idmap.o \ |
16 | callback.o callback_xdr.o callback_proc.o \ | 14 | callback.o callback_xdr.o callback_proc.o \ |
@@ -27,6 +25,10 @@ nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o | |||
27 | obj-$(CONFIG_NFS_V2) += nfs2.o | 25 | obj-$(CONFIG_NFS_V2) += nfs2.o |
28 | nfs2-y := nfs2super.o proc.o nfs2xdr.o | 26 | nfs2-y := nfs2super.o proc.o nfs2xdr.o |
29 | 27 | ||
28 | obj-$(CONFIG_NFS_V3) += nfs3.o | ||
29 | nfs3-y := nfs3super.o nfs3client.o nfs3proc.o nfs3xdr.o | ||
30 | nfs3-$(CONFIG_NFS_V3_ACL) += nfs3acl.o | ||
31 | |||
30 | obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o | 32 | obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o |
31 | nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o | 33 | nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o |
32 | 34 | ||
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index fa8acf510333..8687b6b6edc1 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -149,10 +149,6 @@ 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_v3(); | ||
153 | if (err) | ||
154 | return err; | ||
155 | |||
156 | return init_nfs_v4(); | 152 | return init_nfs_v4(); |
157 | } | 153 | } |
158 | 154 | ||
@@ -161,7 +157,6 @@ int __init nfs_register_versions(void) | |||
161 | */ | 157 | */ |
162 | void nfs_unregister_versions(void) | 158 | void nfs_unregister_versions(void) |
163 | { | 159 | { |
164 | exit_nfs_v3(); | ||
165 | exit_nfs_v4(); | 160 | exit_nfs_v4(); |
166 | } | 161 | } |
167 | 162 | ||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c382a6d5e177..55438c970cbf 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1981,6 +1981,7 @@ void nfs_access_zap_cache(struct inode *inode) | |||
1981 | spin_unlock(&nfs_access_lru_lock); | 1981 | spin_unlock(&nfs_access_lru_lock); |
1982 | nfs_access_free_list(&head); | 1982 | nfs_access_free_list(&head); |
1983 | } | 1983 | } |
1984 | EXPORT_SYMBOL_GPL(nfs_access_zap_cache); | ||
1984 | 1985 | ||
1985 | static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, struct rpc_cred *cred) | 1986 | static struct nfs_access_entry *nfs_access_search_rbtree(struct inode *inode, struct rpc_cred *cred) |
1986 | { | 1987 | { |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 42dce909ec70..899238156b11 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -460,7 +460,7 @@ static void nfs_inode_dio_write_done(struct inode *inode) | |||
460 | inode_dio_done(inode); | 460 | inode_dio_done(inode); |
461 | } | 461 | } |
462 | 462 | ||
463 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 463 | #if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
464 | static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) | 464 | static void nfs_direct_write_reschedule(struct nfs_direct_req *dreq) |
465 | { | 465 | { |
466 | struct nfs_pageio_descriptor desc; | 466 | struct nfs_pageio_descriptor desc; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index f358b976e9e6..78dfc3e895ec 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -186,6 +186,7 @@ void nfs_zap_acl_cache(struct inode *inode) | |||
186 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; | 186 | NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ACL; |
187 | spin_unlock(&inode->i_lock); | 187 | spin_unlock(&inode->i_lock); |
188 | } | 188 | } |
189 | EXPORT_SYMBOL_GPL(nfs_zap_acl_cache); | ||
189 | 190 | ||
190 | void nfs_invalidate_atime(struct inode *inode) | 191 | void nfs_invalidate_atime(struct inode *inode) |
191 | { | 192 | { |
@@ -847,6 +848,7 @@ int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
847 | return NFS_STALE(inode) ? -ESTALE : 0; | 848 | return NFS_STALE(inode) ? -ESTALE : 0; |
848 | return __nfs_revalidate_inode(server, inode); | 849 | return __nfs_revalidate_inode(server, inode); |
849 | } | 850 | } |
851 | EXPORT_SYMBOL_GPL(nfs_revalidate_inode); | ||
850 | 852 | ||
851 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) | 853 | static int nfs_invalidate_mapping(struct inode *inode, struct address_space *mapping) |
852 | { | 854 | { |
@@ -1213,6 +1215,7 @@ int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1213 | spin_unlock(&inode->i_lock); | 1215 | spin_unlock(&inode->i_lock); |
1214 | return status; | 1216 | return status; |
1215 | } | 1217 | } |
1218 | EXPORT_SYMBOL_GPL(nfs_post_op_update_inode); | ||
1216 | 1219 | ||
1217 | /** | 1220 | /** |
1218 | * nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache | 1221 | * nfs_post_op_update_inode_force_wcc - try to update the inode attribute cache |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 4174faf73ec1..64f0dc41a9b7 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -224,7 +224,7 @@ int nfs_sockaddr_match_ipaddr(const struct sockaddr *, const struct sockaddr *); | |||
224 | #endif | 224 | #endif |
225 | 225 | ||
226 | /* nfs3client.c */ | 226 | /* nfs3client.c */ |
227 | #ifdef CONFIG_NFS_V3 | 227 | #if IS_ENABLED(CONFIG_NFS_V3) |
228 | struct nfs_server *nfs3_create_server(struct nfs_mount_info *, struct nfs_subversion *); | 228 | struct nfs_server *nfs3_create_server(struct nfs_mount_info *, struct nfs_subversion *); |
229 | struct nfs_server *nfs3_clone_server(struct nfs_server *, struct nfs_fh *, | 229 | struct nfs_server *nfs3_clone_server(struct nfs_server *, struct nfs_fh *, |
230 | struct nfs_fattr *, rpc_authflavor_t); | 230 | struct nfs_fattr *, rpc_authflavor_t); |
diff --git a/fs/nfs/nfs.h b/fs/nfs/nfs.h index f5d1cf5f5dc7..3e1b84baa57f 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_V3 | ||
28 | int init_nfs_v3(void); | ||
29 | void exit_nfs_v3(void); | ||
30 | #else /* CONFIG_NFS_V3 */ | ||
31 | static inline int __init init_nfs_v3(void) | ||
32 | { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | static inline void exit_nfs_v3(void) | ||
37 | { | ||
38 | } | ||
39 | #endif /* CONFIG_NFS_V3 */ | ||
40 | |||
41 | #ifdef CONFIG_NFS_V4 | 27 | #ifdef CONFIG_NFS_V4 |
42 | int init_nfs_v4(void); | 28 | int init_nfs_v4(void); |
43 | void exit_nfs_v4(void); | 29 | void exit_nfs_v4(void); |
diff --git a/fs/nfs/nfs3super.c b/fs/nfs/nfs3super.c index 8378090b8104..cc471c725230 100644 --- a/fs/nfs/nfs3super.c +++ b/fs/nfs/nfs3super.c | |||
@@ -14,13 +14,18 @@ static struct nfs_subversion nfs_v3 = { | |||
14 | .sops = &nfs_sops, | 14 | .sops = &nfs_sops, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | int __init init_nfs_v3(void) | 17 | static int __init init_nfs_v3(void) |
18 | { | 18 | { |
19 | register_nfs_version(&nfs_v3); | 19 | register_nfs_version(&nfs_v3); |
20 | return 0; | 20 | return 0; |
21 | } | 21 | } |
22 | 22 | ||
23 | void exit_nfs_v3(void) | 23 | static void __exit exit_nfs_v3(void) |
24 | { | 24 | { |
25 | unregister_nfs_version(&nfs_v3); | 25 | unregister_nfs_version(&nfs_v3); |
26 | } | 26 | } |
27 | |||
28 | MODULE_LICENSE("GPL"); | ||
29 | |||
30 | module_init(init_nfs_v3); | ||
31 | module_exit(exit_nfs_v3); | ||
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 999ce7505142..558a85c9594a 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -69,7 +69,7 @@ | |||
69 | #define NFSDBG_FACILITY NFSDBG_VFS | 69 | #define NFSDBG_FACILITY NFSDBG_VFS |
70 | #define NFS_TEXT_DATA 1 | 70 | #define NFS_TEXT_DATA 1 |
71 | 71 | ||
72 | #ifdef CONFIG_NFS_V3 | 72 | #if IS_ENABLED(CONFIG_NFS_V3) |
73 | #define NFS_DEFAULT_VERSION 3 | 73 | #define NFS_DEFAULT_VERSION 3 |
74 | #else | 74 | #else |
75 | #define NFS_DEFAULT_VERSION 2 | 75 | #define NFS_DEFAULT_VERSION 2 |
@@ -1876,7 +1876,7 @@ static int nfs23_validate_mount_data(void *options, | |||
1876 | return NFS_TEXT_DATA; | 1876 | return NFS_TEXT_DATA; |
1877 | } | 1877 | } |
1878 | 1878 | ||
1879 | #ifndef CONFIG_NFS_V3 | 1879 | #if !IS_ENABLED(CONFIG_NFS_V3) |
1880 | if (args->version == 3) | 1880 | if (args->version == 3) |
1881 | goto out_v3_not_compiled; | 1881 | goto out_v3_not_compiled; |
1882 | #endif /* !CONFIG_NFS_V3 */ | 1882 | #endif /* !CONFIG_NFS_V3 */ |
@@ -1896,7 +1896,7 @@ out_no_sec: | |||
1896 | dfprintk(MOUNT, "NFS: nfs_mount_data version supports only AUTH_SYS\n"); | 1896 | dfprintk(MOUNT, "NFS: nfs_mount_data version supports only AUTH_SYS\n"); |
1897 | return -EINVAL; | 1897 | return -EINVAL; |
1898 | 1898 | ||
1899 | #ifndef CONFIG_NFS_V3 | 1899 | #if !IS_ENABLED(CONFIG_NFS_V3) |
1900 | out_v3_not_compiled: | 1900 | out_v3_not_compiled: |
1901 | dfprintk(MOUNT, "NFS: NFSv3 is not compiled into kernel\n"); | 1901 | dfprintk(MOUNT, "NFS: NFSv3 is not compiled into kernel\n"); |
1902 | return -EPROTONOSUPPORT; | 1902 | return -EPROTONOSUPPORT; |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 1e8d4b043769..f268fe4f2785 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -446,7 +446,7 @@ nfs_mark_request_dirty(struct nfs_page *req) | |||
446 | __set_page_dirty_nobuffers(req->wb_page); | 446 | __set_page_dirty_nobuffers(req->wb_page); |
447 | } | 447 | } |
448 | 448 | ||
449 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 449 | #if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
450 | /** | 450 | /** |
451 | * nfs_request_add_commit_list - add request to a commit list | 451 | * nfs_request_add_commit_list - add request to a commit list |
452 | * @req: pointer to a struct nfs_page | 452 | * @req: pointer to a struct nfs_page |
@@ -636,7 +636,7 @@ out: | |||
636 | hdr->release(hdr); | 636 | hdr->release(hdr); |
637 | } | 637 | } |
638 | 638 | ||
639 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 639 | #if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
640 | static unsigned long | 640 | static unsigned long |
641 | nfs_reqs_to_commit(struct nfs_commit_info *cinfo) | 641 | nfs_reqs_to_commit(struct nfs_commit_info *cinfo) |
642 | { | 642 | { |
@@ -1298,7 +1298,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) | |||
1298 | return; | 1298 | return; |
1299 | nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); | 1299 | nfs_add_stats(inode, NFSIOS_SERVERWRITTENBYTES, resp->count); |
1300 | 1300 | ||
1301 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1301 | #if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
1302 | if (resp->verf->committed < argp->stable && task->tk_status >= 0) { | 1302 | if (resp->verf->committed < argp->stable && task->tk_status >= 0) { |
1303 | /* We tried a write call, but the server did not | 1303 | /* We tried a write call, but the server did not |
1304 | * commit data to stable storage even though we | 1304 | * commit data to stable storage even though we |
@@ -1358,7 +1358,7 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) | |||
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | 1360 | ||
1361 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1361 | #if IS_ENABLED(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
1362 | static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) | 1362 | static int nfs_commit_set_lock(struct nfs_inode *nfsi, int may_wait) |
1363 | { | 1363 | { |
1364 | int ret; | 1364 | int ret; |