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>
This commit is contained in:
Bryan Schumaker 2011-11-01 15:24:59 -04:00 committed by J. Bruce Fields
parent 114a0a08d4
commit 7208339607
3 changed files with 9 additions and 10 deletions

View file

@ -2301,7 +2301,7 @@ nfsd4_free_slabs(void)
nfsd4_free_slab(&deleg_slab); nfsd4_free_slab(&deleg_slab);
} }
static int int
nfsd4_init_slabs(void) nfsd4_init_slabs(void)
{ {
openowner_slab = kmem_cache_create("nfsd4_openowners", openowner_slab = kmem_cache_create("nfsd4_openowners",
@ -4546,14 +4546,11 @@ void nfsd_recall_delegations(u64 num)
/* initialization to perform at module load time: */ /* initialization to perform at module load time: */
int void
nfs4_state_init(void) nfs4_state_init(void)
{ {
int i, status; int i;
status = nfsd4_init_slabs();
if (status)
return status;
for (i = 0; i < CLIENT_HASH_SIZE; i++) { for (i = 0; i < CLIENT_HASH_SIZE; i++) {
INIT_LIST_HEAD(&conf_id_hashtbl[i]); INIT_LIST_HEAD(&conf_id_hashtbl[i]);
INIT_LIST_HEAD(&conf_str_hashtbl[i]); INIT_LIST_HEAD(&conf_str_hashtbl[i]);
@ -4577,7 +4574,6 @@ nfs4_state_init(void)
INIT_LIST_HEAD(&client_lru); INIT_LIST_HEAD(&client_lru);
INIT_LIST_HEAD(&del_recall_lru); INIT_LIST_HEAD(&del_recall_lru);
reclaim_str_hashtbl_size = 0; reclaim_str_hashtbl_size = 0;
return 0;
} }
static void static void

View file

@ -1129,9 +1129,10 @@ static int __init init_nfsd(void)
int retval; int retval;
printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");
retval = nfs4_state_init(); /* nfs4 locking state */ retval = nfsd4_init_slabs();
if (retval) if (retval)
return retval; return retval;
nfs4_state_init();
retval = nfsd_fault_inject_init(); /* nfsd fault injection controls */ retval = nfsd_fault_inject_init(); /* nfsd fault injection controls */
if (retval) if (retval)
goto out_free_slabs; goto out_free_slabs;

View file

@ -104,14 +104,16 @@ static inline int nfsd_v4client(struct svc_rqst *rq)
*/ */
#ifdef CONFIG_NFSD_V4 #ifdef CONFIG_NFSD_V4
extern unsigned int max_delegations; extern unsigned int max_delegations;
int nfs4_state_init(void); void nfs4_state_init(void);
int nfsd4_init_slabs(void);
void nfsd4_free_slabs(void); void nfsd4_free_slabs(void);
int nfs4_state_start(void); int nfs4_state_start(void);
void nfs4_state_shutdown(void); void nfs4_state_shutdown(void);
void nfs4_reset_lease(time_t leasetime); void nfs4_reset_lease(time_t leasetime);
int nfs4_reset_recoverydir(char *recdir); int nfs4_reset_recoverydir(char *recdir);
#else #else
static inline int nfs4_state_init(void) { return 0; } static inline void nfs4_state_init(void) { }
static inline int nfsd4_init_slabs(void) { return 0; }
static inline void nfsd4_free_slabs(void) { } static inline void nfsd4_free_slabs(void) { }
static inline int nfs4_state_start(void) { return 0; } static inline int nfs4_state_start(void) { return 0; }
static inline void nfs4_state_shutdown(void) { } static inline void nfs4_state_shutdown(void) { }