]> www.infradead.org Git - users/hch/misc.git/commitdiff
nfs: fold nfs_page_async_flush into nfs_do_writepage
authorChristoph Hellwig <hch@lst.de>
Thu, 24 Apr 2025 04:28:31 +0000 (06:28 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 14 May 2025 04:51:22 +0000 (06:51 +0200)
Fold nfs_page_async_flush into its only caller to clean up the code a
bit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/nfs/write.c

index 23df8b214474f4e142b14c86c1c96427c8cd2107..148e773c3665082bd380d9fab2ac2d85dca675c5 100644 (file)
@@ -632,13 +632,14 @@ static void nfs_write_error(struct nfs_page *req, int error)
  * Find an associated nfs write request, and prepare to flush it out
  * May return an error if the user signalled nfs_wait_on_request().
  */
-static int nfs_page_async_flush(struct folio *folio,
-                               struct writeback_control *wbc,
-                               struct nfs_pageio_descriptor *pgio)
+static int nfs_do_writepage(struct folio *folio, struct writeback_control *wbc,
+               struct nfs_pageio_descriptor *pgio)
 {
        struct nfs_page *req;
        int ret = 0;
 
+       nfs_pageio_cond_complete(pgio, folio->index);
+
        req = nfs_lock_and_join_requests(folio);
        if (!req)
                goto out;
@@ -677,13 +678,6 @@ out_launder:
        return 0;
 }
 
-static int nfs_do_writepage(struct folio *folio, struct writeback_control *wbc,
-                           struct nfs_pageio_descriptor *pgio)
-{
-       nfs_pageio_cond_complete(pgio, folio->index);
-       return nfs_page_async_flush(folio, wbc, pgio);
-}
-
 /*
  * Write an mmapped page to the server.
  */