Linux NFS development
 help / color / mirror / Atom feed
* [PATCH v1 0/2] pNFS/filelayout: Enable partial layout support
@ 2024-03-20 21:11 Anna Schumaker
  2024-03-20 21:11 ` [PATCH v1 1/2] pNFS/filelayout: Remove the whole file layout requirement Anna Schumaker
  2024-03-20 21:11 ` [PATCH v1 2/2] pNFS/filelayout: Specify the layout segment range in LAYOUTGET Anna Schumaker
  0 siblings, 2 replies; 3+ messages in thread
From: Anna Schumaker @ 2024-03-20 21:11 UTC (permalink / raw)
  To: linux-nfs, trond.myklebust; +Cc: anna

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

These patches are heavily based on Trond's patches from April 2020 that
added partial layout support to the flexfile layout. As far as I can
tell, the pieces are already there we just need to change the filelayout
code to be okay with partial layouts.

Thanks,
Anna

Anna Schumaker (2):
  pNFS/filelayout: Remove the whole file layout requirement
  pNFS/filelayout: Specify the layout segment range in LAYOUTGET

 fs/nfs/filelayout/filelayout.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v1 1/2] pNFS/filelayout: Remove the whole file layout requirement
  2024-03-20 21:11 [PATCH v1 0/2] pNFS/filelayout: Enable partial layout support Anna Schumaker
@ 2024-03-20 21:11 ` Anna Schumaker
  2024-03-20 21:11 ` [PATCH v1 2/2] pNFS/filelayout: Specify the layout segment range in LAYOUTGET Anna Schumaker
  1 sibling, 0 replies; 3+ messages in thread
From: Anna Schumaker @ 2024-03-20 21:11 UTC (permalink / raw)
  To: linux-nfs, trond.myklebust; +Cc: anna

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

Layout segments have been supported in pNFS for years, so remove the
requirement that the server always sends whole file layouts.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/filelayout/filelayout.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index ce8f8934bca5..3fb18b16a5b4 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -605,14 +605,6 @@ filelayout_check_layout(struct pnfs_layout_hdr *lo,
 
 	dprintk("--> %s\n", __func__);
 
-	/* FIXME: remove this check when layout segment support is added */
-	if (lgr->range.offset != 0 ||
-	    lgr->range.length != NFS4_MAX_UINT64) {
-		dprintk("%s Only whole file layouts supported. Use MDS i/o\n",
-			__func__);
-		goto out;
-	}
-
 	if (fl->pattern_offset > lgr->range.offset) {
 		dprintk("%s pattern_offset %lld too large\n",
 				__func__, fl->pattern_offset);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] pNFS/filelayout: Specify the layout segment range in LAYOUTGET
  2024-03-20 21:11 [PATCH v1 0/2] pNFS/filelayout: Enable partial layout support Anna Schumaker
  2024-03-20 21:11 ` [PATCH v1 1/2] pNFS/filelayout: Remove the whole file layout requirement Anna Schumaker
@ 2024-03-20 21:11 ` Anna Schumaker
  1 sibling, 0 replies; 3+ messages in thread
From: Anna Schumaker @ 2024-03-20 21:11 UTC (permalink / raw)
  To: linux-nfs, trond.myklebust; +Cc: anna

From: Anna Schumaker <Anna.Schumaker@Netapp.com>

Move from only requesting 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 if it wants, but partial layouts will no
longer cause an error.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/filelayout/filelayout.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
index 3fb18b16a5b4..cc2ed4b5a4fd 100644
--- a/fs/nfs/filelayout/filelayout.c
+++ b/fs/nfs/filelayout/filelayout.c
@@ -871,8 +871,8 @@ filelayout_pg_init_read(struct nfs_pageio_descriptor *pgio,
 	if (!pgio->pg_lseg) {
 		pgio->pg_lseg = fl_pnfs_update_layout(pgio->pg_inode,
 						      nfs_req_openctx(req),
-						      0,
-						      NFS4_MAX_UINT64,
+						      req_offset(req),
+						      req->wb_bytes,
 						      IOMODE_READ,
 						      false,
 						      GFP_KERNEL);
@@ -895,8 +895,8 @@ filelayout_pg_init_write(struct nfs_pageio_descriptor *pgio,
 	if (!pgio->pg_lseg) {
 		pgio->pg_lseg = fl_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);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-20 21:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 21:11 [PATCH v1 0/2] pNFS/filelayout: Enable partial layout support Anna Schumaker
2024-03-20 21:11 ` [PATCH v1 1/2] pNFS/filelayout: Remove the whole file layout requirement Anna Schumaker
2024-03-20 21:11 ` [PATCH v1 2/2] pNFS/filelayout: Specify the layout segment range in LAYOUTGET Anna Schumaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox