diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2011-12-07 04:57:56 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-12-07 15:27:46 -0500 |
commit | f5c8593b94190aabdcf207a544f082c7816c4fe6 (patch) | |
tree | e0f4d5bd999cba6ec806216aeffd3953c480f295 /fs | |
parent | bd4620ddf6d6eb3d9e7d073ad601fa4299d46ba9 (diff) |
NFSd: use network-namespace-aware cache registering routines
v2: cache_register_net() and cache_unregister_net() GPL exports added
This is a cleanup patch. Hope, some day generic cache_register() and
cache_unregister() will be removed.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/export.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 5f312abf1247..cf8a6bd062fa 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -1226,12 +1226,12 @@ nfsd_export_init(void) | |||
1226 | int rv; | 1226 | int rv; |
1227 | dprintk("nfsd: initializing export module.\n"); | 1227 | dprintk("nfsd: initializing export module.\n"); |
1228 | 1228 | ||
1229 | rv = cache_register(&svc_export_cache); | 1229 | rv = cache_register_net(&svc_export_cache, &init_net); |
1230 | if (rv) | 1230 | if (rv) |
1231 | return rv; | 1231 | return rv; |
1232 | rv = cache_register(&svc_expkey_cache); | 1232 | rv = cache_register_net(&svc_expkey_cache, &init_net); |
1233 | if (rv) | 1233 | if (rv) |
1234 | cache_unregister(&svc_export_cache); | 1234 | cache_unregister_net(&svc_export_cache, &init_net); |
1235 | return rv; | 1235 | return rv; |
1236 | 1236 | ||
1237 | } | 1237 | } |
@@ -1255,8 +1255,8 @@ nfsd_export_shutdown(void) | |||
1255 | 1255 | ||
1256 | dprintk("nfsd: shutting down export module.\n"); | 1256 | dprintk("nfsd: shutting down export module.\n"); |
1257 | 1257 | ||
1258 | cache_unregister(&svc_expkey_cache); | 1258 | cache_unregister_net(&svc_expkey_cache, &init_net); |
1259 | cache_unregister(&svc_export_cache); | 1259 | cache_unregister_net(&svc_export_cache, &init_net); |
1260 | svcauth_unix_purge(); | 1260 | svcauth_unix_purge(); |
1261 | 1261 | ||
1262 | dprintk("nfsd: export shutdown complete.\n"); | 1262 | dprintk("nfsd: export shutdown complete.\n"); |
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 55780a22fdbd..94096273cd6c 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
37 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <net/net_namespace.h> | ||
39 | #include "idmap.h" | 40 | #include "idmap.h" |
40 | #include "nfsd.h" | 41 | #include "nfsd.h" |
41 | 42 | ||
@@ -466,20 +467,20 @@ nfsd_idmap_init(void) | |||
466 | { | 467 | { |
467 | int rv; | 468 | int rv; |
468 | 469 | ||
469 | rv = cache_register(&idtoname_cache); | 470 | rv = cache_register_net(&idtoname_cache, &init_net); |
470 | if (rv) | 471 | if (rv) |
471 | return rv; | 472 | return rv; |
472 | rv = cache_register(&nametoid_cache); | 473 | rv = cache_register_net(&nametoid_cache, &init_net); |
473 | if (rv) | 474 | if (rv) |
474 | cache_unregister(&idtoname_cache); | 475 | cache_unregister_net(&idtoname_cache, &init_net); |
475 | return rv; | 476 | return rv; |
476 | } | 477 | } |
477 | 478 | ||
478 | void | 479 | void |
479 | nfsd_idmap_shutdown(void) | 480 | nfsd_idmap_shutdown(void) |
480 | { | 481 | { |
481 | cache_unregister(&idtoname_cache); | 482 | cache_unregister_net(&idtoname_cache, &init_net); |
482 | cache_unregister(&nametoid_cache); | 483 | cache_unregister_net(&nametoid_cache, &init_net); |
483 | } | 484 | } |
484 | 485 | ||
485 | static int | 486 | static int |