summaryrefslogtreecommitdiff
path: root/fs/nfs/blocklayout/blocklayout.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-09-10 17:36:30 -0700
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-09-12 13:22:45 -0400
commit34dc93c2fc04da0d01acf8a1660b4ab276208af7 (patch)
tree89c6c0dbc294682703f7172e1285a8bf5245ce52 /fs/nfs/blocklayout/blocklayout.c
parentd4b18c3e00b8d18fbd316abe9639b91ad416e1f3 (diff)
downloadlwn-34dc93c2fc04da0d01acf8a1660b4ab276208af7.tar.gz
lwn-34dc93c2fc04da0d01acf8a1660b4ab276208af7.zip
pnfs/blocklayout: allocate separate pages for the layoutcommit payload
Instead of overflowing the XDR send buffer with our extent list allocate pages and pre-encode the layoutupdate payload into them. We optimistically allocate a single page use alloc_page and only switch to vmalloc when we have more extents outstanding. Currently there is only a single testcase (xfstests generic/113) which can reproduce large enough extent lists for this to occur. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.c')
-rw-r--r--fs/nfs/blocklayout/blocklayout.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 3e1f1afc6db4..cf10a6e291e4 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -500,21 +500,16 @@ bl_return_range(struct pnfs_layout_hdr *lo,
err = ext_tree_remove(bl, range->iomode & IOMODE_RW, offset, end);
}
-static void
-bl_encode_layoutcommit(struct pnfs_layout_hdr *lo, struct xdr_stream *xdr,
- const struct nfs4_layoutcommit_args *arg)
+static int
+bl_prepare_layoutcommit(struct nfs4_layoutcommit_args *arg)
{
- dprintk("%s enter\n", __func__);
- ext_tree_encode_commit(BLK_LO2EXT(lo), xdr);
+ return ext_tree_prepare_commit(arg);
}
static void
bl_cleanup_layoutcommit(struct nfs4_layoutcommit_data *lcdata)
{
- struct pnfs_layout_hdr *lo = NFS_I(lcdata->args.inode)->layout;
-
- dprintk("%s enter\n", __func__);
- ext_tree_mark_committed(BLK_LO2EXT(lo), lcdata->res.status);
+ ext_tree_mark_committed(&lcdata->args, lcdata->res.status);
}
static int
@@ -670,7 +665,7 @@ static struct pnfs_layoutdriver_type blocklayout_type = {
.alloc_lseg = bl_alloc_lseg,
.free_lseg = bl_free_lseg,
.return_range = bl_return_range,
- .encode_layoutcommit = bl_encode_layoutcommit,
+ .prepare_layoutcommit = bl_prepare_layoutcommit,
.cleanup_layoutcommit = bl_cleanup_layoutcommit,
.set_layoutdriver = bl_set_layoutdriver,
.alloc_deviceid_node = bl_alloc_deviceid_node,