aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4proc.c
diff options
context:
space:
mode:
authorStanislav Kinsbursky <skinsbursky@parallels.com>2012-11-14 10:22:07 -0500
committerJ. Bruce Fields <bfields@redhat.com>2012-11-15 07:40:50 -0500
commit3320fef19b542b8df9606bd8e63990dc2a3fb330 (patch)
treefe68d7d40178040eb8691fffb711d7c413a6ce9e /fs/nfsd/nfs4proc.c
parent73758fed711b847d833b9b0db59137eaeed06485 (diff)
nfsd: use service net instead of hard-coded init_net
This patch replaces init_net by SVC_NET(), where possible and also passes proper context to nested functions where required. 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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index f955176f1b6f..1d2396b79574 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -40,6 +40,7 @@
40#include "xdr4.h" 40#include "xdr4.h"
41#include "vfs.h" 41#include "vfs.h"
42#include "current_stateid.h" 42#include "current_stateid.h"
43#include "netns.h"
43 44
44#define NFSDDBG_FACILITY NFSDDBG_PROC 45#define NFSDDBG_FACILITY NFSDDBG_PROC
45 46
@@ -304,6 +305,8 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
304{ 305{
305 __be32 status; 306 __be32 status;
306 struct nfsd4_compoundres *resp; 307 struct nfsd4_compoundres *resp;
308 struct net *net = SVC_NET(rqstp);
309 struct nfsd_net *nn = net_generic(net, nfsd_net_id);
307 310
308 dprintk("NFSD: nfsd4_open filename %.*s op_openowner %p\n", 311 dprintk("NFSD: nfsd4_open filename %.*s op_openowner %p\n",
309 (int)open->op_fname.len, open->op_fname.data, 312 (int)open->op_fname.len, open->op_fname.data,
@@ -331,7 +334,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
331 334
332 /* check seqid for replay. set nfs4_owner */ 335 /* check seqid for replay. set nfs4_owner */
333 resp = rqstp->rq_resp; 336 resp = rqstp->rq_resp;
334 status = nfsd4_process_open1(&resp->cstate, open); 337 status = nfsd4_process_open1(&resp->cstate, open, nn);
335 if (status == nfserr_replay_me) { 338 if (status == nfserr_replay_me) {
336 struct nfs4_replay *rp = &open->op_openowner->oo_owner.so_replay; 339 struct nfs4_replay *rp = &open->op_openowner->oo_owner.so_replay;
337 fh_put(&cstate->current_fh); 340 fh_put(&cstate->current_fh);
@@ -354,10 +357,10 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
354 /* Openowner is now set, so sequence id will get bumped. Now we need 357 /* Openowner is now set, so sequence id will get bumped. Now we need
355 * these checks before we do any creates: */ 358 * these checks before we do any creates: */
356 status = nfserr_grace; 359 status = nfserr_grace;
357 if (locks_in_grace(SVC_NET(rqstp)) && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) 360 if (locks_in_grace(net) && open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS)
358 goto out; 361 goto out;
359 status = nfserr_no_grace; 362 status = nfserr_no_grace;
360 if (!locks_in_grace(SVC_NET(rqstp)) && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) 363 if (!locks_in_grace(net) && open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS)
361 goto out; 364 goto out;
362 365
363 switch (open->op_claim_type) { 366 switch (open->op_claim_type) {
@@ -370,7 +373,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
370 break; 373 break;
371 case NFS4_OPEN_CLAIM_PREVIOUS: 374 case NFS4_OPEN_CLAIM_PREVIOUS:
372 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED; 375 open->op_openowner->oo_flags |= NFS4_OO_CONFIRMED;
373 status = nfs4_check_open_reclaim(&open->op_clientid, cstate->minorversion); 376 status = nfs4_check_open_reclaim(&open->op_clientid,
377 cstate->minorversion,
378 nn);
374 if (status) 379 if (status)
375 goto out; 380 goto out;
376 case NFS4_OPEN_CLAIM_FH: 381 case NFS4_OPEN_CLAIM_FH: