diff mbox series

[05/23] nilfs2: Use a folio in nilfs_recover_dsync_blocks()

Message ID 20240717154716.237943-6-willy@infradead.org (mailing list archive)
State New
Headers show
Series Convert write_begin / write_end to take a folio | expand

Commit Message

Matthew Wilcox July 17, 2024, 3:46 p.m. UTC
Replaces four hidden calls to compound_head() with one.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/nilfs2/recovery.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Ryusuke Konishi July 18, 2024, 5:14 p.m. UTC | #1
On Thu, Jul 18, 2024 at 12:54 AM Matthew Wilcox (Oracle) wrote:
>
> Replaces four hidden calls to compound_head() with one.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  fs/nilfs2/recovery.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>

I've checked this patch (and the big-bang patches as well, mainly for
the nilfs2 related parts).
The conversion was straightforward and I didn't find any issues.

Feel free to add

Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>

to this.  Thanks.

Ryusuke Konishi

> diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
> index b638dc06df2f..15653701b1c8 100644
> --- a/fs/nilfs2/recovery.c
> +++ b/fs/nilfs2/recovery.c
> @@ -499,6 +499,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
>         struct nilfs_recovery_block *rb, *n;
>         unsigned int blocksize = nilfs->ns_blocksize;
>         struct page *page;
> +       struct folio *folio;
>         loff_t pos;
>         int err = 0, err2 = 0;
>
> @@ -522,6 +523,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
>                         goto failed_inode;
>                 }
>
> +               folio = page_folio(page);
>                 err = nilfs_recovery_copy_block(nilfs, rb, pos, page);
>                 if (unlikely(err))
>                         goto failed_page;
> @@ -533,15 +535,15 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
>                 block_write_end(NULL, inode->i_mapping, pos, blocksize,
>                                 blocksize, page, NULL);
>
> -               unlock_page(page);
> -               put_page(page);
> +               folio_unlock(folio);
> +               folio_put(folio);
>
>                 (*nr_salvaged_blocks)++;
>                 goto next;
>
>   failed_page:
> -               unlock_page(page);
> -               put_page(page);
> +               folio_unlock(folio);
> +               folio_put(folio);
>
>   failed_inode:
>                 nilfs_warn(sb,
> --
> 2.43.0
>
>
diff mbox series

Patch

diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index b638dc06df2f..15653701b1c8 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -499,6 +499,7 @@  static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
 	struct nilfs_recovery_block *rb, *n;
 	unsigned int blocksize = nilfs->ns_blocksize;
 	struct page *page;
+	struct folio *folio;
 	loff_t pos;
 	int err = 0, err2 = 0;
 
@@ -522,6 +523,7 @@  static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
 			goto failed_inode;
 		}
 
+		folio = page_folio(page);
 		err = nilfs_recovery_copy_block(nilfs, rb, pos, page);
 		if (unlikely(err))
 			goto failed_page;
@@ -533,15 +535,15 @@  static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
 		block_write_end(NULL, inode->i_mapping, pos, blocksize,
 				blocksize, page, NULL);
 
-		unlock_page(page);
-		put_page(page);
+		folio_unlock(folio);
+		folio_put(folio);
 
 		(*nr_salvaged_blocks)++;
 		goto next;
 
  failed_page:
-		unlock_page(page);
-		put_page(page);
+		folio_unlock(folio);
+		folio_put(folio);
 
  failed_inode:
 		nilfs_warn(sb,