Skip to content

Commit c7b4077

Browse files
josefbacikkdave
authored andcommitted
btrfs: convert insert_inline_extent to use a folio
We only use a page to copy in the data for the inline extent. Use a folio for this instead. Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
1 parent bc897a2 commit c7b4077

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

fs/btrfs/inode.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans,
495495
{
496496
struct btrfs_root *root = inode->root;
497497
struct extent_buffer *leaf;
498-
struct page *page = NULL;
499498
const u32 sectorsize = trans->fs_info->sectorsize;
500499
char *kaddr;
501500
unsigned long ptr;
@@ -555,12 +554,16 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans,
555554
btrfs_set_file_extent_compression(leaf, ei,
556555
compress_type);
557556
} else {
558-
page = find_get_page(inode->vfs_inode.i_mapping, 0);
557+
struct folio *folio;
558+
559+
folio = __filemap_get_folio(inode->vfs_inode.i_mapping,
560+
0, 0, 0);
561+
ASSERT(!IS_ERR(folio));
559562
btrfs_set_file_extent_compression(leaf, ei, 0);
560-
kaddr = kmap_local_page(page);
563+
kaddr = kmap_local_folio(folio, 0);
561564
write_extent_buffer(leaf, kaddr, ptr, size);
562565
kunmap_local(kaddr);
563-
put_page(page);
566+
folio_put(folio);
564567
}
565568
btrfs_mark_buffer_dirty(trans, leaf);
566569
btrfs_release_path(path);

0 commit comments

Comments
 (0)