diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-12-06 06:23:19 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-12-10 16:25:38 -0500 |
commit | b9c0ef8571c6ae33465dcf41d496ce2ad783c49d (patch) | |
tree | 5216e0d3be135d6b73bb7f2acc539bcf6fffadba /fs/nfsd/nfs4proc.c | |
parent | 2c2fe2909e124c32a34dbbb3ac129112524fc540 (diff) |
nfsd: make NFSd service boot time per-net
This is simple: an NFSd service can be started at different times in
different network environments. So, its "boot time" has to be assigned
per net.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 1a0b1fdb5ad3..bd67f4d6dfc6 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -497,12 +497,13 @@ nfsd4_access(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
497 | &access->ac_supported); | 497 | &access->ac_supported); |
498 | } | 498 | } |
499 | 499 | ||
500 | static void gen_boot_verifier(nfs4_verifier *verifier) | 500 | static void gen_boot_verifier(nfs4_verifier *verifier, struct net *net) |
501 | { | 501 | { |
502 | __be32 verf[2]; | 502 | __be32 verf[2]; |
503 | struct nfsd_net *nn = net_generic(net, nfsd_net_id); | ||
503 | 504 | ||
504 | verf[0] = (__be32)nfssvc_boot.tv_sec; | 505 | verf[0] = (__be32)nn->nfssvc_boot.tv_sec; |
505 | verf[1] = (__be32)nfssvc_boot.tv_usec; | 506 | verf[1] = (__be32)nn->nfssvc_boot.tv_usec; |
506 | memcpy(verifier->data, verf, sizeof(verifier->data)); | 507 | memcpy(verifier->data, verf, sizeof(verifier->data)); |
507 | } | 508 | } |
508 | 509 | ||
@@ -510,7 +511,7 @@ static __be32 | |||
510 | nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 511 | nfsd4_commit(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
511 | struct nfsd4_commit *commit) | 512 | struct nfsd4_commit *commit) |
512 | { | 513 | { |
513 | gen_boot_verifier(&commit->co_verf); | 514 | gen_boot_verifier(&commit->co_verf, SVC_NET(rqstp)); |
514 | return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, | 515 | return nfsd_commit(rqstp, &cstate->current_fh, commit->co_offset, |
515 | commit->co_count); | 516 | commit->co_count); |
516 | } | 517 | } |
@@ -930,7 +931,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
930 | 931 | ||
931 | cnt = write->wr_buflen; | 932 | cnt = write->wr_buflen; |
932 | write->wr_how_written = write->wr_stable_how; | 933 | write->wr_how_written = write->wr_stable_how; |
933 | gen_boot_verifier(&write->wr_verifier); | 934 | gen_boot_verifier(&write->wr_verifier, SVC_NET(rqstp)); |
934 | 935 | ||
935 | nvecs = fill_in_write_vector(rqstp->rq_vec, write); | 936 | nvecs = fill_in_write_vector(rqstp->rq_vec, write); |
936 | WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec)); | 937 | WARN_ON_ONCE(nvecs > ARRAY_SIZE(rqstp->rq_vec)); |