Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: convert btrfs_mark_ordered_io_finished() to take a folio

We only need a folio now, make it take a folio as an argument and update
all of the callers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Josef Bacik and committed by
David Sterba
a7922801 aef665d6

+14 -14
+4 -4
fs/btrfs/extent_io.c
··· 1428 1428 u32 iosize; 1429 1429 1430 1430 if (cur >= i_size) { 1431 - btrfs_mark_ordered_io_finished(inode, &folio->page, cur, 1432 - len, true); 1431 + btrfs_mark_ordered_io_finished(inode, folio, cur, len, 1432 + true); 1433 1433 /* 1434 1434 * This range is beyond i_size, thus we don't need to 1435 1435 * bother writing back. ··· 1568 1568 folio_end_writeback(folio); 1569 1569 } 1570 1570 if (ret) { 1571 - btrfs_mark_ordered_io_finished(BTRFS_I(inode), &folio->page, 1571 + btrfs_mark_ordered_io_finished(BTRFS_I(inode), folio, 1572 1572 page_start, PAGE_SIZE, !ret); 1573 1573 mapping_set_error(folio->mapping, ret); 1574 1574 } ··· 2330 2330 btrfs_folio_clear_writeback(fs_info, folio, cur, cur_len); 2331 2331 } 2332 2332 if (ret) { 2333 - btrfs_mark_ordered_io_finished(BTRFS_I(inode), &folio->page, 2333 + btrfs_mark_ordered_io_finished(BTRFS_I(inode), folio, 2334 2334 cur, cur_len, !ret); 2335 2335 mapping_set_error(mapping, ret); 2336 2336 }
+4 -3
fs/btrfs/inode.c
··· 1144 1144 1145 1145 set_page_writeback(locked_page); 1146 1146 end_page_writeback(locked_page); 1147 - btrfs_mark_ordered_io_finished(inode, locked_page, 1147 + btrfs_mark_ordered_io_finished(inode, 1148 + page_folio(locked_page), 1148 1149 page_start, PAGE_SIZE, 1149 1150 !ret); 1150 1151 mapping_set_error(locked_page->mapping, ret); ··· 2803 2802 * to reflect the errors and clean the page. 2804 2803 */ 2805 2804 mapping_set_error(page->mapping, ret); 2806 - btrfs_mark_ordered_io_finished(inode, page, page_start, 2807 - PAGE_SIZE, !ret); 2805 + btrfs_mark_ordered_io_finished(inode, page_folio(page), 2806 + page_start, PAGE_SIZE, !ret); 2808 2807 clear_page_dirty_for_io(page); 2809 2808 } 2810 2809 btrfs_folio_clear_checked(fs_info, page_folio(page), page_start, PAGE_SIZE);
+4 -5
fs/btrfs/ordered-data.c
··· 449 449 /* 450 450 * Mark all ordered extents io inside the specified range finished. 451 451 * 452 - * @page: The involved page for the operation. 453 - * For uncompressed buffered IO, the page status also needs to be 452 + * @folio: The involved folio for the operation. 453 + * For uncompressed buffered IO, the folio status also needs to be 454 454 * updated to indicate whether the pending ordered io is finished. 455 455 * Can be NULL for direct IO and compressed write. 456 456 * For these cases, callers are ensured they won't execute the ··· 460 460 * extent(s) covering it. 461 461 */ 462 462 void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode, 463 - struct page *page, u64 file_offset, 463 + struct folio *folio, u64 file_offset, 464 464 u64 num_bytes, bool uptodate) 465 465 { 466 466 struct rb_node *node; ··· 524 524 ASSERT(end + 1 - cur < U32_MAX); 525 525 len = end + 1 - cur; 526 526 527 - if (can_finish_ordered_extent(entry, page_folio(page), cur, len, 528 - uptodate)) { 527 + if (can_finish_ordered_extent(entry, folio, cur, len, uptodate)) { 529 528 spin_unlock_irqrestore(&inode->ordered_tree_lock, flags); 530 529 btrfs_queue_ordered_fn(entry); 531 530 spin_lock_irqsave(&inode->ordered_tree_lock, flags);
+2 -2
fs/btrfs/ordered-data.h
··· 166 166 struct folio *folio, u64 file_offset, u64 len, 167 167 bool uptodate); 168 168 void btrfs_mark_ordered_io_finished(struct btrfs_inode *inode, 169 - struct page *page, u64 file_offset, 170 - u64 num_bytes, bool uptodate); 169 + struct folio *folio, u64 file_offset, 170 + u64 num_bytes, bool uptodate); 171 171 bool btrfs_dec_test_ordered_pending(struct btrfs_inode *inode, 172 172 struct btrfs_ordered_extent **cached, 173 173 u64 file_offset, u64 io_size);