[PATCH v2 3/3] mm/swap_io.c: rename swap_writepage_* to swap_write_folio_*

Barry Song posted 3 patches 5 days, 6 hours ago
[PATCH v2 3/3] mm/swap_io.c: rename swap_writepage_* to swap_write_folio_*
Posted by Barry Song 5 days, 6 hours ago
From: Baoquan He <bhe@redhat.com>

All these swap_writepage_* functions are hanlding passed in folio, but
not page. And this renaming make them consistent with the their
counterpart swap_read_folio_* functions.

Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Barry Song <baohua@kernel.org>
---
 mm/swap_io.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/swap_io.c b/mm/swap_io.c
index ad0895af6ed8..063cd005ca0d 100644
--- a/mm/swap_io.c
+++ b/mm/swap_io.c
@@ -375,7 +375,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret)
 	mempool_free(sio, sio_pool);
 }
 
-static void swap_writepage_fs(struct swap_info_struct *sis,
+static void swap_write_folio_fs(struct swap_info_struct *sis,
 			      struct folio *folio,
 			      struct swap_iocb **swap_plug)
 {
@@ -412,7 +412,7 @@ static void swap_writepage_fs(struct swap_info_struct *sis,
 		*swap_plug = sio;
 }
 
-static void swap_writepage_bdev_sync(struct swap_info_struct *sis,
+static void swap_write_folio_bdev_sync(struct swap_info_struct *sis,
 				     struct folio *folio,
 				     struct swap_iocb **plug)
 {
@@ -433,7 +433,7 @@ static void swap_writepage_bdev_sync(struct swap_info_struct *sis,
 	__end_swap_bio_write(&bio);
 }
 
-static void swap_writepage_bdev_async(struct swap_info_struct *sis,
+static void swap_write_folio_bdev_async(struct swap_info_struct *sis,
 				      struct folio *folio,
 				      struct swap_iocb **plug)
 {
@@ -595,17 +595,17 @@ static void swap_read_folio_bdev_async(struct swap_info_struct *sis,
 
 static const struct swap_ops bdev_fs_swap_ops = {
 	.read_folio = swap_read_folio_fs,
-	.write_folio = swap_writepage_fs,
+	.write_folio = swap_write_folio_fs,
 };
 
 static const struct swap_ops bdev_sync_swap_ops = {
 	.read_folio = swap_read_folio_bdev_sync,
-	.write_folio = swap_writepage_bdev_sync,
+	.write_folio = swap_write_folio_bdev_sync,
 };
 
 static const struct swap_ops bdev_async_swap_ops = {
 	.read_folio = swap_read_folio_bdev_async,
-	.write_folio = swap_writepage_bdev_async,
+	.write_folio = swap_write_folio_bdev_async,
 };
 
 void setup_swap_ops(struct swap_info_struct *sis)
-- 
2.39.3 (Apple Git-146)
Re: [PATCH v2 3/3] mm/swap_io.c: rename swap_writepage_* to swap_write_folio_*
Posted by Chris Li 3 days, 23 hours ago
Acked-by: Chris Li <chrisl@kernel.org>

Chris

On Sat, Mar 28, 2026 at 12:58 AM Barry Song <21cnbao@gmail.com> wrote:
>
> From: Baoquan He <bhe@redhat.com>
>
> All these swap_writepage_* functions are hanlding passed in folio, but
> not page. And this renaming make them consistent with the their
> counterpart swap_read_folio_* functions.
>
> Reviewed-by: Barry Song <baohua@kernel.org>
> Reviewed-by: Nhat Pham <nphamcs@gmail.com>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> Signed-off-by: Barry Song <baohua@kernel.org>
> ---
>  mm/swap_io.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/mm/swap_io.c b/mm/swap_io.c
> index ad0895af6ed8..063cd005ca0d 100644
> --- a/mm/swap_io.c
> +++ b/mm/swap_io.c
> @@ -375,7 +375,7 @@ static void sio_write_complete(struct kiocb *iocb, long ret)
>         mempool_free(sio, sio_pool);
>  }
>
> -static void swap_writepage_fs(struct swap_info_struct *sis,
> +static void swap_write_folio_fs(struct swap_info_struct *sis,
>                               struct folio *folio,
>                               struct swap_iocb **swap_plug)
>  {
> @@ -412,7 +412,7 @@ static void swap_writepage_fs(struct swap_info_struct *sis,
>                 *swap_plug = sio;
>  }
>
> -static void swap_writepage_bdev_sync(struct swap_info_struct *sis,
> +static void swap_write_folio_bdev_sync(struct swap_info_struct *sis,
>                                      struct folio *folio,
>                                      struct swap_iocb **plug)
>  {
> @@ -433,7 +433,7 @@ static void swap_writepage_bdev_sync(struct swap_info_struct *sis,
>         __end_swap_bio_write(&bio);
>  }
>
> -static void swap_writepage_bdev_async(struct swap_info_struct *sis,
> +static void swap_write_folio_bdev_async(struct swap_info_struct *sis,
>                                       struct folio *folio,
>                                       struct swap_iocb **plug)
>  {
> @@ -595,17 +595,17 @@ static void swap_read_folio_bdev_async(struct swap_info_struct *sis,
>
>  static const struct swap_ops bdev_fs_swap_ops = {
>         .read_folio = swap_read_folio_fs,
> -       .write_folio = swap_writepage_fs,
> +       .write_folio = swap_write_folio_fs,
>  };
>
>  static const struct swap_ops bdev_sync_swap_ops = {
>         .read_folio = swap_read_folio_bdev_sync,
> -       .write_folio = swap_writepage_bdev_sync,
> +       .write_folio = swap_write_folio_bdev_sync,
>  };
>
>  static const struct swap_ops bdev_async_swap_ops = {
>         .read_folio = swap_read_folio_bdev_async,
> -       .write_folio = swap_writepage_bdev_async,
> +       .write_folio = swap_write_folio_bdev_async,
>  };
>
>  void setup_swap_ops(struct swap_info_struct *sis)
> --
> 2.39.3 (Apple Git-146)
>