diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-07-30 16:05:25 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-30 19:06:52 -0400 |
commit | 89d77c8fa8e6d1cb7e2cce95b428be30ddcc6f23 (patch) | |
tree | 37a076ec2675209fd78bc6ac0474dbecee8d11e7 /fs/nfs/client.c | |
parent | 1c606fb74c758beafd98cbad9a9133eadeec2371 (diff) |
NFS: Convert v4 into a module
This patch exports symbols needed by the v4 module. In addition, I also
switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
CONFIG_NFS_V4_MODULE are set.
The module (nfs4.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 v4.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r-- | fs/nfs/client.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 8687b6b6edc1..9fc0d9dfc91b 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -143,24 +143,6 @@ void unregister_nfs_version(struct nfs_subversion *nfs) | |||
143 | EXPORT_SYMBOL_GPL(unregister_nfs_version); | 143 | EXPORT_SYMBOL_GPL(unregister_nfs_version); |
144 | 144 | ||
145 | /* | 145 | /* |
146 | * Preload all configured NFS versions during module init. | ||
147 | * This function should be edited after each protocol is converted, | ||
148 | * and eventually removed. | ||
149 | */ | ||
150 | int __init nfs_register_versions(void) | ||
151 | { | ||
152 | return init_nfs_v4(); | ||
153 | } | ||
154 | |||
155 | /* | ||
156 | * Remove each pre-loaded NFS version | ||
157 | */ | ||
158 | void nfs_unregister_versions(void) | ||
159 | { | ||
160 | exit_nfs_v4(); | ||
161 | } | ||
162 | |||
163 | /* | ||
164 | * Allocate a shared client record | 146 | * Allocate a shared client record |
165 | * | 147 | * |
166 | * Since these are allocated/deallocated very rarely, we don't | 148 | * Since these are allocated/deallocated very rarely, we don't |
@@ -214,7 +196,7 @@ error_0: | |||
214 | } | 196 | } |
215 | EXPORT_SYMBOL_GPL(nfs_alloc_client); | 197 | EXPORT_SYMBOL_GPL(nfs_alloc_client); |
216 | 198 | ||
217 | #ifdef CONFIG_NFS_V4 | 199 | #if IS_ENABLED(CONFIG_NFS_V4) |
218 | /* idr_remove_all is not needed as all id's are removed by nfs_put_client */ | 200 | /* idr_remove_all is not needed as all id's are removed by nfs_put_client */ |
219 | void nfs_cleanup_cb_ident_idr(struct net *net) | 201 | void nfs_cleanup_cb_ident_idr(struct net *net) |
220 | { | 202 | { |
@@ -390,6 +372,7 @@ int nfs_sockaddr_match_ipaddr(const struct sockaddr *sa1, | |||
390 | } | 372 | } |
391 | return 0; | 373 | return 0; |
392 | } | 374 | } |
375 | EXPORT_SYMBOL_GPL(nfs_sockaddr_match_ipaddr); | ||
393 | #endif /* CONFIG_NFS_V4_1 */ | 376 | #endif /* CONFIG_NFS_V4_1 */ |
394 | 377 | ||
395 | /* | 378 | /* |
@@ -456,6 +439,7 @@ int nfs_wait_client_init_complete(const struct nfs_client *clp) | |||
456 | return wait_event_killable(nfs_client_active_wq, | 439 | return wait_event_killable(nfs_client_active_wq, |
457 | nfs_client_init_is_complete(clp)); | 440 | nfs_client_init_is_complete(clp)); |
458 | } | 441 | } |
442 | EXPORT_SYMBOL_GPL(nfs_wait_client_init_complete); | ||
459 | 443 | ||
460 | /* | 444 | /* |
461 | * Found an existing client. Make sure it's ready before returning. | 445 | * Found an existing client. Make sure it's ready before returning. |
@@ -530,6 +514,7 @@ nfs_get_client(const struct nfs_client_initdata *cl_init, | |||
530 | cl_init->hostname ?: "", PTR_ERR(new)); | 514 | cl_init->hostname ?: "", PTR_ERR(new)); |
531 | return new; | 515 | return new; |
532 | } | 516 | } |
517 | EXPORT_SYMBOL_GPL(nfs_get_client); | ||
533 | 518 | ||
534 | /* | 519 | /* |
535 | * Mark a server as ready or failed | 520 | * Mark a server as ready or failed |
@@ -540,6 +525,7 @@ void nfs_mark_client_ready(struct nfs_client *clp, int state) | |||
540 | clp->cl_cons_state = state; | 525 | clp->cl_cons_state = state; |
541 | wake_up_all(&nfs_client_active_wq); | 526 | wake_up_all(&nfs_client_active_wq); |
542 | } | 527 | } |
528 | EXPORT_SYMBOL_GPL(nfs_mark_client_ready); | ||
543 | 529 | ||
544 | /* | 530 | /* |
545 | * Initialise the timeout values for a connection | 531 | * Initialise the timeout values for a connection |
@@ -581,6 +567,7 @@ void nfs_init_timeout_values(struct rpc_timeout *to, int proto, | |||
581 | BUG(); | 567 | BUG(); |
582 | } | 568 | } |
583 | } | 569 | } |
570 | EXPORT_SYMBOL_GPL(nfs_init_timeout_values); | ||
584 | 571 | ||
585 | /* | 572 | /* |
586 | * Create an RPC client handle | 573 | * Create an RPC client handle |
@@ -620,6 +607,7 @@ int nfs_create_rpc_client(struct nfs_client *clp, | |||
620 | clp->cl_rpcclient = clnt; | 607 | clp->cl_rpcclient = clnt; |
621 | return 0; | 608 | return 0; |
622 | } | 609 | } |
610 | EXPORT_SYMBOL_GPL(nfs_create_rpc_client); | ||
623 | 611 | ||
624 | /* | 612 | /* |
625 | * Version 2 or 3 client destruction | 613 | * Version 2 or 3 client destruction |
@@ -706,6 +694,7 @@ int nfs_init_server_rpcclient(struct nfs_server *server, | |||
706 | 694 | ||
707 | return 0; | 695 | return 0; |
708 | } | 696 | } |
697 | EXPORT_SYMBOL_GPL(nfs_init_server_rpcclient); | ||
709 | 698 | ||
710 | /** | 699 | /** |
711 | * nfs_init_client - Initialise an NFS2 or NFS3 client | 700 | * nfs_init_client - Initialise an NFS2 or NFS3 client |
@@ -932,6 +921,7 @@ out_error: | |||
932 | dprintk("nfs_probe_fsinfo: error = %d\n", -error); | 921 | dprintk("nfs_probe_fsinfo: error = %d\n", -error); |
933 | return error; | 922 | return error; |
934 | } | 923 | } |
924 | EXPORT_SYMBOL_GPL(nfs_probe_fsinfo); | ||
935 | 925 | ||
936 | /* | 926 | /* |
937 | * Copy useful information when duplicating a server record | 927 | * Copy useful information when duplicating a server record |
@@ -948,6 +938,7 @@ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *sour | |||
948 | target->caps = source->caps; | 938 | target->caps = source->caps; |
949 | target->options = source->options; | 939 | target->options = source->options; |
950 | } | 940 | } |
941 | EXPORT_SYMBOL_GPL(nfs_server_copy_userdata); | ||
951 | 942 | ||
952 | void nfs_server_insert_lists(struct nfs_server *server) | 943 | void nfs_server_insert_lists(struct nfs_server *server) |
953 | { | 944 | { |
@@ -961,6 +952,7 @@ void nfs_server_insert_lists(struct nfs_server *server) | |||
961 | spin_unlock(&nn->nfs_client_lock); | 952 | spin_unlock(&nn->nfs_client_lock); |
962 | 953 | ||
963 | } | 954 | } |
955 | EXPORT_SYMBOL_GPL(nfs_server_insert_lists); | ||
964 | 956 | ||
965 | static void nfs_server_remove_lists(struct nfs_server *server) | 957 | static void nfs_server_remove_lists(struct nfs_server *server) |
966 | { | 958 | { |
@@ -1020,6 +1012,7 @@ struct nfs_server *nfs_alloc_server(void) | |||
1020 | 1012 | ||
1021 | return server; | 1013 | return server; |
1022 | } | 1014 | } |
1015 | EXPORT_SYMBOL_GPL(nfs_alloc_server); | ||
1023 | 1016 | ||
1024 | /* | 1017 | /* |
1025 | * Free up a server record | 1018 | * Free up a server record |
@@ -1048,6 +1041,7 @@ void nfs_free_server(struct nfs_server *server) | |||
1048 | nfs_release_automount_timer(); | 1041 | nfs_release_automount_timer(); |
1049 | dprintk("<-- nfs_free_server()\n"); | 1042 | dprintk("<-- nfs_free_server()\n"); |
1050 | } | 1043 | } |
1044 | EXPORT_SYMBOL_GPL(nfs_free_server); | ||
1051 | 1045 | ||
1052 | /* | 1046 | /* |
1053 | * Create a version 2 or 3 volume record | 1047 | * Create a version 2 or 3 volume record |
@@ -1193,7 +1187,7 @@ void nfs_clients_init(struct net *net) | |||
1193 | 1187 | ||
1194 | INIT_LIST_HEAD(&nn->nfs_client_list); | 1188 | INIT_LIST_HEAD(&nn->nfs_client_list); |
1195 | INIT_LIST_HEAD(&nn->nfs_volume_list); | 1189 | INIT_LIST_HEAD(&nn->nfs_volume_list); |
1196 | #ifdef CONFIG_NFS_V4 | 1190 | #if IS_ENABLED(CONFIG_NFS_V4) |
1197 | idr_init(&nn->cb_ident_idr); | 1191 | idr_init(&nn->cb_ident_idr); |
1198 | #endif | 1192 | #endif |
1199 | spin_lock_init(&nn->nfs_client_lock); | 1193 | spin_lock_init(&nn->nfs_client_lock); |