Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68774
b: refs/heads/master
c: e8ff2a8
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Oct 9, 2007
1 parent 3462637 commit 2585279
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b47eece1fa519a81c8b802af77a8b8aa44baa10
refs/heads/master: e8ff2a8453cedf38d6d7a0528cb9c308066a3e3e
22 changes: 10 additions & 12 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ nfsd4_free_slab(struct kmem_cache **slab)
*slab = NULL;
}

static void
void
nfsd4_free_slabs(void)
{
nfsd4_free_slab(&stateowner_slab);
Expand Down Expand Up @@ -3152,11 +3152,14 @@ nfs4_check_open_reclaim(clientid_t *clid)

/* initialization to perform at module load time: */

void
int
nfs4_state_init(void)
{
int i;
int i, status;

status = nfsd4_init_slabs();
if (status)
return status;
for (i = 0; i < CLIENT_HASH_SIZE; i++) {
INIT_LIST_HEAD(&conf_id_hashtbl[i]);
INIT_LIST_HEAD(&conf_str_hashtbl[i]);
Expand Down Expand Up @@ -3185,6 +3188,7 @@ nfs4_state_init(void)
for (i = 0; i < CLIENT_HASH_SIZE; i++)
INIT_LIST_HEAD(&reclaim_str_hashtbl[i]);
reclaim_str_hashtbl_size = 0;
return 0;
}

static void
Expand Down Expand Up @@ -3245,20 +3249,15 @@ __nfs4_state_start(void)
set_max_delegations();
}

int
void
nfs4_state_start(void)
{
int status;

if (nfs4_init)
return 0;
status = nfsd4_init_slabs();
if (status)
return status;
return;
nfsd4_load_reboot_recovery_data();
__nfs4_state_start();
nfs4_init = 1;
return 0;
return;
}

int
Expand Down Expand Up @@ -3316,7 +3315,6 @@ nfs4_state_shutdown(void)
nfs4_lock_state();
nfs4_release_reclaim();
__nfs4_state_shutdown();
nfsd4_free_slabs();
nfs4_unlock_state();
}

Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/nfsd/nfsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,13 @@ static int __init init_nfsd(void)
int retval;
printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n");

retval = nfs4_state_init(); /* nfs4 locking state */
if (retval)
return retval;
nfsd_stat_init(); /* Statistics */
nfsd_cache_init(); /* RPC reply cache */
nfsd_export_init(); /* Exports table */
nfsd_lockd_init(); /* lockd->nfsd callbacks */
nfs4_state_init(); /* NFSv4 locking state */
nfsd_idmap_init(); /* Name to ID mapping */
if (proc_mkdir("fs/nfs", NULL)) {
struct proc_dir_entry *entry;
Expand Down Expand Up @@ -712,6 +714,7 @@ static void __exit exit_nfsd(void)
nfsd_stat_shutdown();
nfsd_lockd_shutdown();
nfsd_idmap_shutdown();
nfsd4_free_slabs();
unregister_filesystem(&nfsd_fs_type);
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,7 @@ nfsd_svc(unsigned short port, int nrservs)
error = nfsd_racache_init(2*nrservs);
if (error<0)
goto out;
error = nfs4_state_start();
if (error<0)
goto out;
nfs4_state_start();

nfsd_reset_versions();

Expand Down
18 changes: 10 additions & 8 deletions trunk/include/linux/nfsd/nfsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,19 +153,21 @@ extern int nfsd_max_blksize;
*/
#ifdef CONFIG_NFSD_V4
extern unsigned int max_delegations;
void nfs4_state_init(void);
int nfs4_state_start(void);
int nfs4_state_init(void);
void nfsd4_free_slabs(void);
void nfs4_state_start(void);
void nfs4_state_shutdown(void);
time_t nfs4_lease_time(void);
void nfs4_reset_lease(time_t leasetime);
int nfs4_reset_recoverydir(char *recdir);
#else
static inline void nfs4_state_init(void){};
static inline int nfs4_state_start(void){return 0;}
static inline void nfs4_state_shutdown(void){}
static inline time_t nfs4_lease_time(void){return 0;}
static inline void nfs4_reset_lease(time_t leasetime){}
static inline int nfs4_reset_recoverydir(char *recdir) {return 0;}
static inline int nfs4_state_init(void) { return 0; }
static inline void nfsd4_free_slabs(void) { }
static inline void nfs4_state_start(void) { }
static inline void nfs4_state_shutdown(void) { }
static inline time_t nfs4_lease_time(void) { return 0; }
static inline void nfs4_reset_lease(time_t leasetime) { }
static inline int nfs4_reset_recoverydir(char *recdir) { return 0; }
#endif

/*
Expand Down

0 comments on commit 2585279

Please sign in to comment.