summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2023-01-19 16:33:40 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2023-02-14 14:22:32 -0500
commit4b27232a6e064f3d779cfa76cd251d6023949d22 (patch)
treeb7dd713f19824f0cfa2e0695f64d1a270d7174fb /fs/nfs
parentcbefa53cb1fe30ae4467be863afc3cf60238fd08 (diff)
NFS: Add a helper nfs_wb_folio()
...and use it in nfs_launder_folio(). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c2
-rw-r--r--fs/nfs/write.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index d8ec889a4b3f..8704bd071d3a 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -469,7 +469,7 @@ static int nfs_launder_folio(struct folio *folio)
inode->i_ino, folio_pos(folio));
folio_wait_fscache(folio);
- return nfs_wb_page(inode, &folio->page);
+ return nfs_wb_folio(inode, folio);
}
static int nfs_swap_activate(struct swap_info_struct *sis, struct file *file,
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 1cbb92824791..c80a57801b2e 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -2106,6 +2106,19 @@ out_error:
return ret;
}
+/**
+ * nfs_wb_folio - Write back all requests on one page
+ * @inode: pointer to page
+ * @folio: pointer to folio
+ *
+ * Assumes that the folio has been locked by the caller, and will
+ * not unlock it.
+ */
+int nfs_wb_folio(struct inode *inode, struct folio *folio)
+{
+ return nfs_wb_page(inode, &folio->page);
+}
+
#ifdef CONFIG_MIGRATION
int nfs_migrate_folio(struct address_space *mapping, struct folio *dst,
struct folio *src, enum migrate_mode mode)