Commit 8d6e5f9a authored by Goldwyn Rodrigues's avatar Goldwyn Rodrigues Committed by David Sterba

btrfs: page to folio conversion: prealloc_file_extent_cluster()

Convert usage of page to folio in prealloc_file_extent_cluster()
Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Signed-off-by: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 70f1e5b6
...@@ -2859,7 +2859,7 @@ static noinline_for_stack int prealloc_file_extent_cluster( ...@@ -2859,7 +2859,7 @@ static noinline_for_stack int prealloc_file_extent_cluster(
struct address_space *mapping = inode->vfs_inode.i_mapping; struct address_space *mapping = inode->vfs_inode.i_mapping;
struct btrfs_fs_info *fs_info = inode->root->fs_info; struct btrfs_fs_info *fs_info = inode->root->fs_info;
const u32 sectorsize = fs_info->sectorsize; const u32 sectorsize = fs_info->sectorsize;
struct page *page; struct folio *folio;
ASSERT(sectorsize < PAGE_SIZE); ASSERT(sectorsize < PAGE_SIZE);
ASSERT(IS_ALIGNED(i_size, sectorsize)); ASSERT(IS_ALIGNED(i_size, sectorsize));
...@@ -2890,16 +2890,16 @@ static noinline_for_stack int prealloc_file_extent_cluster( ...@@ -2890,16 +2890,16 @@ static noinline_for_stack int prealloc_file_extent_cluster(
clear_extent_bits(&inode->io_tree, i_size, clear_extent_bits(&inode->io_tree, i_size,
round_up(i_size, PAGE_SIZE) - 1, round_up(i_size, PAGE_SIZE) - 1,
EXTENT_UPTODATE); EXTENT_UPTODATE);
page = find_lock_page(mapping, i_size >> PAGE_SHIFT); folio = filemap_lock_folio(mapping, i_size >> PAGE_SHIFT);
/* /*
* If page is freed we don't need to do anything then, as we * If page is freed we don't need to do anything then, as we
* will re-read the whole page anyway. * will re-read the whole page anyway.
*/ */
if (page) { if (!IS_ERR(folio)) {
btrfs_subpage_clear_uptodate(fs_info, page_folio(page), i_size, btrfs_subpage_clear_uptodate(fs_info, folio, i_size,
round_up(i_size, PAGE_SIZE) - i_size); round_up(i_size, PAGE_SIZE) - i_size);
unlock_page(page); folio_unlock(folio);
put_page(page); folio_put(folio);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment