summaryrefslogtreecommitdiff
path: root/include/linux/nfs_page.h
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2023-01-19 16:33:37 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2023-02-14 14:22:32 -0500
commit8e0bdc7021f713fdf3b985cda3ce715e41b06698 (patch)
tree240723eda707d43a91b90650e6805f2fac7b44e6 /include/linux/nfs_page.h
parenteb9f2a5a5e85fd24949480d1d02c2a497f26e154 (diff)
NFS: Fix nfs_coalesce_size() to work with folios
Use the helper folio_size() where appropriate. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include/linux/nfs_page.h')
-rw-r--r--include/linux/nfs_page.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index d2ddc9a594c5..192071a6e5f6 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -189,6 +189,21 @@ static inline struct page *nfs_page_to_page(const struct nfs_page *req,
return folio_page(folio, pgbase >> PAGE_SHIFT);
}
+/**
+ * nfs_page_max_length - Retrieve the maximum possible length for a request
+ * @req: pointer to a struct nfs_page
+ *
+ * Returns the maximum possible length of a request
+ */
+static inline size_t nfs_page_max_length(const struct nfs_page *req)
+{
+ struct folio *folio = nfs_page_to_folio(req);
+
+ if (folio == NULL)
+ return PAGE_SIZE;
+ return folio_size(folio);
+}
+
/*
* Lock the page of an asynchronous request
*/