diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2011-11-01 15:24:59 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-11-07 21:10:47 -0500 |
commit | 72083396074035ffa5cf81b6bb3e55f1d615badf (patch) | |
tree | 65f9092a08828ae068a3950e40f1de1e7d25452d | |
parent | 114a0a08d46cfb0eefb1a882f7866b7f57bfc5ba (diff) |
NFSD: Call nfsd4_init_slabs() from init_nfsd()
init_nfsd() was calling free_slabs() during cleanup code, but the call
to init_slabs() was hidden in nfsd4_state_init(). This could be
confusing to people unfamiliar with the code.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4state.c | 10 | ||||
-rw-r--r-- | fs/nfsd/nfsctl.c | 3 | ||||
-rw-r--r-- | fs/nfsd/nfsd.h | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a511eff05698..1d6812db5099 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2301,7 +2301,7 @@ nfsd4_free_slabs(void) | |||
2301 | nfsd4_free_slab(&deleg_slab); | 2301 | nfsd4_free_slab(&deleg_slab); |
2302 | } | 2302 | } |
2303 | 2303 | ||
2304 | static int | 2304 | int |
2305 | nfsd4_init_slabs(void) | 2305 | nfsd4_init_slabs(void) |
2306 | { | 2306 | { |
2307 | openowner_slab = kmem_cache_create("nfsd4_openowners", | 2307 | openowner_slab = kmem_cache_create("nfsd4_openowners", |
@@ -4546,14 +4546,11 @@ void nfsd_recall_delegations(u64 num) | |||
4546 | 4546 | ||
4547 | /* initialization to perform at module load time: */ | 4547 | /* initialization to perform at module load time: */ |
4548 | 4548 | ||
4549 | int | 4549 | void |
4550 | nfs4_state_init(void) | 4550 | nfs4_state_init(void) |
4551 | { | 4551 | { |
4552 | int i, status; | 4552 | int i; |
4553 | 4553 | ||
4554 | status = nfsd4_init_slabs(); | ||
4555 | if (status) | ||
4556 | return status; | ||
4557 | for (i = 0; i < CLIENT_HASH_SIZE; i++) { | 4554 | for (i = 0; i < CLIENT_HASH_SIZE; i++) { |
4558 | INIT_LIST_HEAD(&conf_id_hashtbl[i]); | 4555 | INIT_LIST_HEAD(&conf_id_hashtbl[i]); |
4559 | INIT_LIST_HEAD(&conf_str_hashtbl[i]); | 4556 | INIT_LIST_HEAD(&conf_str_hashtbl[i]); |
@@ -4577,7 +4574,6 @@ nfs4_state_init(void) | |||
4577 | INIT_LIST_HEAD(&client_lru); | 4574 | INIT_LIST_HEAD(&client_lru); |
4578 | INIT_LIST_HEAD(&del_recall_lru); | 4575 | INIT_LIST_HEAD(&del_recall_lru); |
4579 | reclaim_str_hashtbl_size = 0; | 4576 | reclaim_str_hashtbl_size = 0; |
4580 | return 0; | ||
4581 | } | 4577 | } |
4582 | 4578 | ||
4583 | static void | 4579 | static void |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index b2e8093ebc21..8daa935f329f 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -1129,9 +1129,10 @@ static int __init init_nfsd(void) | |||
1129 | int retval; | 1129 | int retval; |
1130 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); | 1130 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); |
1131 | 1131 | ||
1132 | retval = nfs4_state_init(); /* nfs4 locking state */ | 1132 | retval = nfsd4_init_slabs(); |
1133 | if (retval) | 1133 | if (retval) |
1134 | return retval; | 1134 | return retval; |
1135 | nfs4_state_init(); | ||
1135 | retval = nfsd_fault_inject_init(); /* nfsd fault injection controls */ | 1136 | retval = nfsd_fault_inject_init(); /* nfsd fault injection controls */ |
1136 | if (retval) | 1137 | if (retval) |
1137 | goto out_free_slabs; | 1138 | goto out_free_slabs; |
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 58134a23fdfb..4e2ee29f2cf9 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h | |||
@@ -104,14 +104,16 @@ static inline int nfsd_v4client(struct svc_rqst *rq) | |||
104 | */ | 104 | */ |
105 | #ifdef CONFIG_NFSD_V4 | 105 | #ifdef CONFIG_NFSD_V4 |
106 | extern unsigned int max_delegations; | 106 | extern unsigned int max_delegations; |
107 | int nfs4_state_init(void); | 107 | void nfs4_state_init(void); |
108 | int nfsd4_init_slabs(void); | ||
108 | void nfsd4_free_slabs(void); | 109 | void nfsd4_free_slabs(void); |
109 | int nfs4_state_start(void); | 110 | int nfs4_state_start(void); |
110 | void nfs4_state_shutdown(void); | 111 | void nfs4_state_shutdown(void); |
111 | void nfs4_reset_lease(time_t leasetime); | 112 | void nfs4_reset_lease(time_t leasetime); |
112 | int nfs4_reset_recoverydir(char *recdir); | 113 | int nfs4_reset_recoverydir(char *recdir); |
113 | #else | 114 | #else |
114 | static inline int nfs4_state_init(void) { return 0; } | 115 | static inline void nfs4_state_init(void) { } |
116 | static inline int nfsd4_init_slabs(void) { return 0; } | ||
115 | static inline void nfsd4_free_slabs(void) { } | 117 | static inline void nfsd4_free_slabs(void) { } |
116 | static inline int nfs4_state_start(void) { return 0; } | 118 | static inline int nfs4_state_start(void) { return 0; } |
117 | static inline void nfs4_state_shutdown(void) { } | 119 | static inline void nfs4_state_shutdown(void) { } |