[PATCH v1 7/7] nfs: Cleanup the nfs_page_create_from_page helper
From: Pranjal Shrivastava
Date: Wed Jun 03 2026 - 01:33:47 EST
Remove the nfs_page_create_from_page() helper and its public export.
Following the migration of the Direct I/O path to folios, this
function no longer has any callers in the NFS client.
Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
---
fs/nfs/pagelist.c | 35 -----------------------------------
include/linux/nfs_page.h | 6 ------
2 files changed, 41 deletions(-)
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 74ae91151f83..be8e4ef998ac 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -427,41 +427,6 @@ static void nfs_page_assign_page(struct nfs_page *req, struct page *page, bool p
}
}
-/**
- * nfs_page_create_from_page - Create an NFS read/write request.
- * @ctx: open context to use
- * @page: page to write
- * @pgbase: starting offset within the page for the write
- * @offset: file offset for the write
- * @count: number of bytes to read/write
- *
- * The page must be locked by the caller. This makes sure we never
- * create two different requests for the same page.
- * User should ensure it is safe to sleep in this function.
- */
-struct nfs_page *nfs_page_create_from_page(struct nfs_open_context *ctx,
- struct page *page,
- bool pinned,
- unsigned int pgbase, loff_t offset,
- unsigned int count)
-{
- struct nfs_lock_context *l_ctx = nfs_get_lock_context(ctx);
- struct nfs_page *ret;
-
- if (IS_ERR(l_ctx))
- return ERR_CAST(l_ctx);
- ret = nfs_page_create(l_ctx, pgbase, offset >> PAGE_SHIFT,
- offset_in_page(offset), count);
- if (!IS_ERR(ret)) {
- nfs_page_assign_page(ret, page, pinned);
- if (pinned)
- ret->wb_nr_pinned = 1;
- nfs_page_group_init(ret, NULL);
- }
- nfs_put_lock_context(l_ctx);
- return ret;
-}
-
/**
* nfs_page_create_from_folio - Create an NFS read/write request.
* @ctx: open context to use
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 14eb5de64d2f..2a3e066cbeb9 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -124,12 +124,6 @@ struct nfs_pageio_descriptor {
/* arbitrarily selected limit to number of mirrors */
#define NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX 16
-extern struct nfs_page *nfs_page_create_from_page(struct nfs_open_context *ctx,
- struct page *page,
- bool pinned,
- unsigned int pgbase,
- loff_t offset,
- unsigned int count);
extern struct nfs_page *nfs_page_create_from_folio(struct nfs_open_context *ctx,
struct folio *folio,
bool pinned,
--
2.54.0.1013.g208068f2d8-goog