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) <willy@infradead.org> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Tested-by: Mike Marshall <hubcap@omnibond.com> # orangefs Tested-by: David Howells <dhowells@redhat.com> # afs
This commit is contained in:
@@ -1507,17 +1507,17 @@ void extent_range_clear_dirty_for_io(struct inode *inode, u64 start, u64 end)
|
|||||||
|
|
||||||
void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
|
void extent_range_redirty_for_io(struct inode *inode, u64 start, u64 end)
|
||||||
{
|
{
|
||||||
|
struct address_space *mapping = inode->i_mapping;
|
||||||
unsigned long index = start >> PAGE_SHIFT;
|
unsigned long index = start >> PAGE_SHIFT;
|
||||||
unsigned long end_index = end >> PAGE_SHIFT;
|
unsigned long end_index = end >> PAGE_SHIFT;
|
||||||
struct page *page;
|
struct folio *folio;
|
||||||
|
|
||||||
while (index <= end_index) {
|
while (index <= end_index) {
|
||||||
page = find_get_page(inode->i_mapping, index);
|
folio = filemap_get_folio(mapping, index);
|
||||||
BUG_ON(!page); /* Pages should be in the extent_io_tree */
|
filemap_dirty_folio(mapping, folio);
|
||||||
__set_page_dirty_nobuffers(page);
|
folio_account_redirty(folio);
|
||||||
account_page_redirty(page);
|
index += folio_nr_pages(folio);
|
||||||
put_page(page);
|
folio_put(folio);
|
||||||
index++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user