pNFS/flexfiles: Specify the layout segment range in LAYOUTGET
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 23 Mar 2020 19:18:12 +0000 (15:18 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 27 Mar 2020 20:34:35 +0000 (16:34 -0400)
Move from requesting only full file layout segments, to requesting
layout segments that match our I/O size. This means the server is
still free to return a full file layout, but we will no longer
error out if it does not.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index 42f581e..7d399f7 100644 (file)
@@ -798,8 +798,8 @@ ff_layout_pg_get_read(struct nfs_pageio_descriptor *pgio,
        pnfs_put_lseg(pgio->pg_lseg);
        pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
                                           nfs_req_openctx(req),
-                                          0,
-                                          NFS4_MAX_UINT64,
+                                          req_offset(req),
+                                          req->wb_bytes,
                                           IOMODE_READ,
                                           strict_iomode,
                                           GFP_KERNEL);
@@ -891,8 +891,8 @@ retry:
        if (!pgio->pg_lseg) {
                pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
                                                   nfs_req_openctx(req),
-                                                  0,
-                                                  NFS4_MAX_UINT64,
+                                                  req_offset(req),
+                                                  req->wb_bytes,
                                                   IOMODE_RW,
                                                   false,
                                                   GFP_NOFS);