NFSd: make nfsd4_manager allocated per network namespace context.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
08d44a35a9
commit
5e1533c788
@ -34,6 +34,8 @@ struct nfsd_net {
|
|||||||
|
|
||||||
struct cache_detail *idtoname_cache;
|
struct cache_detail *idtoname_cache;
|
||||||
struct cache_detail *nametoid_cache;
|
struct cache_detail *nametoid_cache;
|
||||||
|
|
||||||
|
struct lock_manager nfsd4_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int nfsd_net_id;
|
extern int nfsd_net_id;
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
#include "current_stateid.h"
|
#include "current_stateid.h"
|
||||||
#include "fault_inject.h"
|
#include "fault_inject.h"
|
||||||
|
|
||||||
|
#include "netns.h"
|
||||||
|
|
||||||
#define NFSDDBG_FACILITY NFSDDBG_PROC
|
#define NFSDDBG_FACILITY NFSDDBG_PROC
|
||||||
|
|
||||||
/* Globals */
|
/* Globals */
|
||||||
@ -3116,22 +3118,21 @@ nfsd4_renew(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct lock_manager nfsd4_manager = {
|
|
||||||
};
|
|
||||||
|
|
||||||
static bool grace_ended;
|
static bool grace_ended;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nfsd4_end_grace(void)
|
nfsd4_end_grace(struct net *net)
|
||||||
{
|
{
|
||||||
|
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
|
||||||
|
|
||||||
/* do nothing if grace period already ended */
|
/* do nothing if grace period already ended */
|
||||||
if (grace_ended)
|
if (grace_ended)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dprintk("NFSD: end of grace period\n");
|
dprintk("NFSD: end of grace period\n");
|
||||||
grace_ended = true;
|
grace_ended = true;
|
||||||
nfsd4_record_grace_done(&init_net, boot_time);
|
nfsd4_record_grace_done(net, boot_time);
|
||||||
locks_end_grace(&nfsd4_manager);
|
locks_end_grace(&nn->nfsd4_manager);
|
||||||
/*
|
/*
|
||||||
* Now that every NFSv4 client has had the chance to recover and
|
* Now that every NFSv4 client has had the chance to recover and
|
||||||
* to see the (possibly new, possibly shorter) lease time, we
|
* to see the (possibly new, possibly shorter) lease time, we
|
||||||
@ -3154,7 +3155,7 @@ nfs4_laundromat(void)
|
|||||||
nfs4_lock_state();
|
nfs4_lock_state();
|
||||||
|
|
||||||
dprintk("NFSD: laundromat service - starting\n");
|
dprintk("NFSD: laundromat service - starting\n");
|
||||||
nfsd4_end_grace();
|
nfsd4_end_grace(&init_net);
|
||||||
INIT_LIST_HEAD(&reaplist);
|
INIT_LIST_HEAD(&reaplist);
|
||||||
spin_lock(&client_lock);
|
spin_lock(&client_lock);
|
||||||
list_for_each_safe(pos, next, &client_lru) {
|
list_for_each_safe(pos, next, &client_lru) {
|
||||||
@ -4688,6 +4689,8 @@ set_max_delegations(void)
|
|||||||
int
|
int
|
||||||
nfs4_state_start(void)
|
nfs4_state_start(void)
|
||||||
{
|
{
|
||||||
|
struct net *net = &init_net;
|
||||||
|
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -4697,10 +4700,10 @@ nfs4_state_start(void)
|
|||||||
* to that instead and then do most of the rest of this on a per-net
|
* to that instead and then do most of the rest of this on a per-net
|
||||||
* basis.
|
* basis.
|
||||||
*/
|
*/
|
||||||
get_net(&init_net);
|
get_net(net);
|
||||||
nfsd4_client_tracking_init(&init_net);
|
nfsd4_client_tracking_init(net);
|
||||||
boot_time = get_seconds();
|
boot_time = get_seconds();
|
||||||
locks_start_grace(&nfsd4_manager);
|
locks_start_grace(&nn->nfsd4_manager);
|
||||||
grace_ended = false;
|
grace_ended = false;
|
||||||
printk(KERN_INFO "NFSD: starting %ld-second grace period\n",
|
printk(KERN_INFO "NFSD: starting %ld-second grace period\n",
|
||||||
nfsd4_grace);
|
nfsd4_grace);
|
||||||
@ -4723,8 +4726,8 @@ nfs4_state_start(void)
|
|||||||
out_free_laundry:
|
out_free_laundry:
|
||||||
destroy_workqueue(laundry_wq);
|
destroy_workqueue(laundry_wq);
|
||||||
out_recovery:
|
out_recovery:
|
||||||
nfsd4_client_tracking_exit(&init_net);
|
nfsd4_client_tracking_exit(net);
|
||||||
put_net(&init_net);
|
put_net(net);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4765,9 +4768,12 @@ __nfs4_state_shutdown(void)
|
|||||||
void
|
void
|
||||||
nfs4_state_shutdown(void)
|
nfs4_state_shutdown(void)
|
||||||
{
|
{
|
||||||
|
struct net *net = &init_net;
|
||||||
|
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
|
||||||
|
|
||||||
cancel_delayed_work_sync(&laundromat_work);
|
cancel_delayed_work_sync(&laundromat_work);
|
||||||
destroy_workqueue(laundry_wq);
|
destroy_workqueue(laundry_wq);
|
||||||
locks_end_grace(&nfsd4_manager);
|
locks_end_grace(&nn->nfsd4_manager);
|
||||||
nfs4_lock_state();
|
nfs4_lock_state();
|
||||||
__nfs4_state_shutdown();
|
__nfs4_state_shutdown();
|
||||||
nfs4_unlock_state();
|
nfs4_unlock_state();
|
||||||
|
Loading…
Reference in New Issue
Block a user