aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-01-06 06:36:25 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-01-06 14:46:31 -0500
commitcf7d63f1f9895713551df2e6d18b006f8af26e91 (patch)
treefc3dbfc12332878a832c11b5ae47ff259bb1bc32 /fs/nfs/nfs4proc.c
parentc31663d4a1fac5ce1954d656cbcf80eb883b814a (diff)
pnfs: serialize LAYOUTGET(openstateid)
We shouldn't send a LAYOUTGET(openstateid) unless all outstanding RPCs using the previous stateid are completed. This requires choosing the stateid to encode earlier, so we can abort if one is not available (we want to use the open stateid, but a LAYOUTGET is already out using it), and adding a count of the number of outstanding rpc calls using layout state (which for now consist solely of LAYOUTGETs). Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 5bee453d36d6..a3549ce72ab2 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5304,6 +5304,12 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
5304 if (nfs4_setup_sequence(server, &lgp->args.seq_args, 5304 if (nfs4_setup_sequence(server, &lgp->args.seq_args,
5305 &lgp->res.seq_res, 0, task)) 5305 &lgp->res.seq_res, 0, task))
5306 return; 5306 return;
5307 if (pnfs_choose_layoutget_stateid(&lgp->args.stateid,
5308 NFS_I(lgp->args.inode)->layout,
5309 lgp->args.ctx->state)) {
5310 rpc_exit(task, NFS4_OK);
5311 return;
5312 }
5307 rpc_call_start(task); 5313 rpc_call_start(task);
5308} 5314}
5309 5315
@@ -5338,7 +5344,6 @@ static void nfs4_layoutget_release(void *calldata)
5338 struct nfs4_layoutget *lgp = calldata; 5344 struct nfs4_layoutget *lgp = calldata;
5339 5345
5340 dprintk("--> %s\n", __func__); 5346 dprintk("--> %s\n", __func__);
5341 put_layout_hdr(lgp->args.inode);
5342 if (lgp->res.layout.buf != NULL) 5347 if (lgp->res.layout.buf != NULL)
5343 free_page((unsigned long) lgp->res.layout.buf); 5348 free_page((unsigned long) lgp->res.layout.buf);
5344 put_nfs_open_context(lgp->args.ctx); 5349 put_nfs_open_context(lgp->args.ctx);