aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.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/nfs4xdr.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/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 4e28242360d6..3cbdd0c80a2d 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -1787,7 +1787,6 @@ encode_layoutget(struct xdr_stream *xdr,
1787 const struct nfs4_layoutget_args *args, 1787 const struct nfs4_layoutget_args *args,
1788 struct compound_hdr *hdr) 1788 struct compound_hdr *hdr)
1789{ 1789{
1790 nfs4_stateid stateid;
1791 __be32 *p; 1790 __be32 *p;
1792 1791
1793 p = reserve_space(xdr, 44 + NFS4_STATEID_SIZE); 1792 p = reserve_space(xdr, 44 + NFS4_STATEID_SIZE);
@@ -1798,9 +1797,7 @@ encode_layoutget(struct xdr_stream *xdr,
1798 p = xdr_encode_hyper(p, args->range.offset); 1797 p = xdr_encode_hyper(p, args->range.offset);
1799 p = xdr_encode_hyper(p, args->range.length); 1798 p = xdr_encode_hyper(p, args->range.length);
1800 p = xdr_encode_hyper(p, args->minlength); 1799 p = xdr_encode_hyper(p, args->minlength);
1801 pnfs_choose_layoutget_stateid(&stateid, NFS_I(args->inode)->layout, 1800 p = xdr_encode_opaque_fixed(p, &args->stateid.data, NFS4_STATEID_SIZE);
1802 args->ctx->state);
1803 p = xdr_encode_opaque_fixed(p, &stateid.data, NFS4_STATEID_SIZE);
1804 *p = cpu_to_be32(args->maxcount); 1801 *p = cpu_to_be32(args->maxcount);
1805 1802
1806 dprintk("%s: 1st type:0x%x iomode:%d off:%lu len:%lu mc:%d\n", 1803 dprintk("%s: 1st type:0x%x iomode:%d off:%lu len:%lu mc:%d\n",