Skip to content

Commit d6b8894

Browse files
josefbacikkdave
authored andcommitted
btrfs: convert extent_range_clear_dirty_for_io to use a folio
Instead of getting a page and using that to clear dirty for io, use the folio helper and use the appropriate folio functions. Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
1 parent c7b4077 commit d6b8894

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

fs/btrfs/inode.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -877,19 +877,19 @@ static inline void inode_should_defrag(struct btrfs_inode *inode,
877877
static int extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
878878
{
879879
unsigned long end_index = end >> PAGE_SHIFT;
880-
struct page *page;
880+
struct folio *folio;
881881
int ret = 0;
882882

883883
for (unsigned long index = start >> PAGE_SHIFT;
884884
index <= end_index; index++) {
885-
page = find_get_page(inode->i_mapping, index);
886-
if (unlikely(!page)) {
885+
folio = __filemap_get_folio(inode->i_mapping, index, 0, 0);
886+
if (unlikely(IS_ERR(folio))) {
887887
if (!ret)
888-
ret = -ENOENT;
888+
ret = PTR_ERR(folio);
889889
continue;
890890
}
891-
clear_page_dirty_for_io(page);
892-
put_page(page);
891+
folio_clear_dirty_for_io(folio);
892+
folio_put(folio);
893893
}
894894
return ret;
895895
}

0 commit comments

Comments
 (0)