Unverified Commit 663459c8 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Christian Brauner
Browse files

nilfs2: Use a folio in nilfs_recover_dsync_blocks()



Replaces four hidden calls to compound_head() with one.

Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Acked-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 696876d0
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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,