Skip to content

Commit ebf55c8

Browse files
author
Matthew Wilcox (Oracle)
committed
btrfs: Convert extent_range_redirty_for_io() to use folios
This removes a call to __set_page_dirty_nobuffers(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Tested-by: Damien Le Moal <[email protected]> Acked-by: Damien Le Moal <[email protected]> Tested-by: Mike Marshall <[email protected]> # orangefs Tested-by: David Howells <[email protected]> # afs
1 parent 187c82c commit ebf55c8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/btrfs/extent_io.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,17 +1507,17 @@ void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
15071507

15081508
void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
15091509
{
1510+
struct address_space *mapping = inode->i_mapping;
15101511
unsigned long index = start >> PAGE_SHIFT;
15111512
unsigned long end_index = end >> PAGE_SHIFT;
1512-
struct page *page;
1513+
struct folio *folio;
15131514

15141515
while (index <= end_index) {
1515-
page = find_get_page(inode->i_mapping, index);
1516-
BUG_ON(!page); /* Pages should be in the extent_io_tree */
1517-
__set_page_dirty_nobuffers(page);
1518-
account_page_redirty(page);
1519-
put_page(page);
1520-
index++;
1516+
folio = filemap_get_folio(mapping, index);
1517+
filemap_dirty_folio(mapping, folio);
1518+
folio_account_redirty(folio);
1519+
index += folio_nr_pages(folio);
1520+
folio_put(folio);
15211521
}
15221522
}
15231523

0 commit comments

Comments
 (0)