nfsd: pass nfsd_net instead of net to grace enders

Passing net context looks as overkill.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
Stanislav Kinsbursky
2012-11-14 18:22:12 +03:00
committed by J. Bruce Fields
parent 3320fef19b
commit 12760c6685
3 changed files with 10 additions and 14 deletions

View File

@@ -58,7 +58,7 @@ struct nfsd4_client_tracking_ops {
void (*create)(struct nfs4_client *); void (*create)(struct nfs4_client *);
void (*remove)(struct nfs4_client *); void (*remove)(struct nfs4_client *);
int (*check)(struct nfs4_client *); int (*check)(struct nfs4_client *);
void (*grace_done)(struct net *, time_t); void (*grace_done)(struct nfsd_net *, time_t);
}; };
/* Globals */ /* Globals */
@@ -391,10 +391,9 @@ purge_old(struct dentry *parent, struct dentry *child, struct nfsd_net *nn)
} }
static void static void
nfsd4_recdir_purge_old(struct net *net, time_t boot_time) nfsd4_recdir_purge_old(struct nfsd_net *nn, time_t boot_time)
{ {
int status; int status;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
in_grace = false; in_grace = false;
if (!rec_file) if (!rec_file)
@@ -1017,11 +1016,10 @@ nfsd4_cld_check(struct nfs4_client *clp)
} }
static void static void
nfsd4_cld_grace_done(struct net *net, time_t boot_time) nfsd4_cld_grace_done(struct nfsd_net *nn, time_t boot_time)
{ {
int ret; int ret;
struct cld_upcall *cup; struct cld_upcall *cup;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
struct cld_net *cn = nn->cld_net; struct cld_net *cn = nn->cld_net;
cup = alloc_cld_upcall(cn); cup = alloc_cld_upcall(cn);
@@ -1241,7 +1239,7 @@ nfsd4_umh_cltrack_check(struct nfs4_client *clp)
} }
static void static void
nfsd4_umh_cltrack_grace_done(struct net __attribute__((unused)) *net, nfsd4_umh_cltrack_grace_done(struct nfsd_net __attribute__((unused)) *nn,
time_t boot_time) time_t boot_time)
{ {
char *legacy; char *legacy;
@@ -1343,10 +1341,10 @@ nfsd4_client_record_check(struct nfs4_client *clp)
} }
void void
nfsd4_record_grace_done(struct net *net, time_t boot_time) nfsd4_record_grace_done(struct nfsd_net *nn, time_t boot_time)
{ {
if (client_tracking_ops) if (client_tracking_ops)
client_tracking_ops->grace_done(net, boot_time); client_tracking_ops->grace_done(nn, boot_time);
} }
static int static int

View File

@@ -3157,17 +3157,15 @@ out:
} }
static void static void
nfsd4_end_grace(struct net *net) nfsd4_end_grace(struct nfsd_net *nn)
{ {
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 (nn->grace_ended) if (nn->grace_ended)
return; return;
dprintk("NFSD: end of grace period\n"); dprintk("NFSD: end of grace period\n");
nn->grace_ended = true; nn->grace_ended = true;
nfsd4_record_grace_done(net, nn->boot_time); nfsd4_record_grace_done(nn, nn->boot_time);
locks_end_grace(&nn->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
@@ -3192,7 +3190,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(&init_net); nfsd4_end_grace(nn);
INIT_LIST_HEAD(&reaplist); INIT_LIST_HEAD(&reaplist);
spin_lock(&client_lock); spin_lock(&client_lock);
list_for_each_safe(pos, next, &nn->client_lru) { list_for_each_safe(pos, next, &nn->client_lru) {

View File

@@ -495,5 +495,5 @@ extern void nfsd4_client_tracking_exit(struct net *net);
extern void nfsd4_client_record_create(struct nfs4_client *clp); extern void nfsd4_client_record_create(struct nfs4_client *clp);
extern void nfsd4_client_record_remove(struct nfs4_client *clp); extern void nfsd4_client_record_remove(struct nfs4_client *clp);
extern int nfsd4_client_record_check(struct nfs4_client *clp); extern int nfsd4_client_record_check(struct nfs4_client *clp);
extern void nfsd4_record_grace_done(struct net *net, time_t boot_time); extern void nfsd4_record_grace_done(struct nfsd_net *nn, time_t boot_time);
#endif /* NFSD4_STATE_H */ #endif /* NFSD4_STATE_H */