Commit b38ec94a authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: convert btrfs_cleanup_ordered_extents() to use folios

We walk through pages in this function and clear ordered, and the
function for this uses folios. Update the function to use a folio for
this whole operation.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 42a5947b
...@@ -399,7 +399,7 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode, ...@@ -399,7 +399,7 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode,
unsigned long index = offset >> PAGE_SHIFT; unsigned long index = offset >> PAGE_SHIFT;
unsigned long end_index = (offset + bytes - 1) >> PAGE_SHIFT; unsigned long end_index = (offset + bytes - 1) >> PAGE_SHIFT;
u64 page_start = 0, page_end = 0; u64 page_start = 0, page_end = 0;
struct page *page; struct folio *folio;
if (locked_page) { if (locked_page) {
page_start = page_offset(locked_page); page_start = page_offset(locked_page);
...@@ -421,9 +421,9 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode, ...@@ -421,9 +421,9 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode,
index++; index++;
continue; continue;
} }
page = find_get_page(inode->vfs_inode.i_mapping, index); folio = __filemap_get_folio(inode->vfs_inode.i_mapping, index, 0, 0);
index++; index++;
if (!page) if (IS_ERR(folio))
continue; continue;
/* /*
...@@ -431,9 +431,9 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode, ...@@ -431,9 +431,9 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode,
* range, then btrfs_mark_ordered_io_finished() will handle * range, then btrfs_mark_ordered_io_finished() will handle
* the ordered extent accounting for the range. * the ordered extent accounting for the range.
*/ */
btrfs_folio_clamp_clear_ordered(inode->root->fs_info, btrfs_folio_clamp_clear_ordered(inode->root->fs_info, folio,
page_folio(page), offset, bytes); offset, bytes);
put_page(page); folio_put(folio);
} }
if (locked_page) { if (locked_page) {
......
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