fs: Remove aops ->set_page_dirty
With all implementations converted to ->dirty_folio, we can stop calling this fallback method and remove it entirely. 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:
@@ -540,7 +540,7 @@ const struct address_space_operations ecryptfs_aops = {
|
|||||||
* XXX: This is pretty broken for multiple reasons: ecryptfs does not
|
* XXX: This is pretty broken for multiple reasons: ecryptfs does not
|
||||||
* actually use buffer_heads, and ecryptfs will crash without
|
* actually use buffer_heads, and ecryptfs will crash without
|
||||||
* CONFIG_BLOCK. But it matches the behavior before the default for
|
* CONFIG_BLOCK. But it matches the behavior before the default for
|
||||||
* address_space_operations without the ->set_page_dirty method was
|
* address_space_operations without the ->dirty_folio method was
|
||||||
* cleaned up, so this is the best we can do without maintainer
|
* cleaned up, so this is the best we can do without maintainer
|
||||||
* feedback.
|
* feedback.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -367,8 +367,7 @@ struct address_space_operations {
|
|||||||
/* Write back some dirty pages from this mapping. */
|
/* Write back some dirty pages from this mapping. */
|
||||||
int (*writepages)(struct address_space *, struct writeback_control *);
|
int (*writepages)(struct address_space *, struct writeback_control *);
|
||||||
|
|
||||||
/* Set a page dirty. Return true if this dirtied it */
|
/* Mark a folio dirty. Return true if this dirtied it */
|
||||||
int (*set_page_dirty)(struct page *page);
|
|
||||||
bool (*dirty_folio)(struct address_space *, struct folio *);
|
bool (*dirty_folio)(struct address_space *, struct folio *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -2641,15 +2641,10 @@ bool folio_mark_dirty(struct folio *folio)
|
|||||||
*/
|
*/
|
||||||
if (folio_test_reclaim(folio))
|
if (folio_test_reclaim(folio))
|
||||||
folio_clear_reclaim(folio);
|
folio_clear_reclaim(folio);
|
||||||
if (mapping->a_ops->dirty_folio)
|
return mapping->a_ops->dirty_folio(mapping, folio);
|
||||||
return mapping->a_ops->dirty_folio(mapping, folio);
|
|
||||||
return mapping->a_ops->set_page_dirty(&folio->page);
|
|
||||||
}
|
}
|
||||||
if (!folio_test_dirty(folio)) {
|
|
||||||
if (!folio_test_set_dirty(folio))
|
return noop_dirty_folio(mapping, folio);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(folio_mark_dirty);
|
EXPORT_SYMBOL(folio_mark_dirty);
|
||||||
|
|
||||||
|
|||||||
@@ -449,9 +449,7 @@ bool swap_dirty_folio(struct address_space *mapping, struct folio *folio)
|
|||||||
aops = mapping->a_ops;
|
aops = mapping->a_ops;
|
||||||
|
|
||||||
VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
|
VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
|
||||||
if (aops->dirty_folio)
|
return aops->dirty_folio(mapping, folio);
|
||||||
return aops->dirty_folio(mapping, folio);
|
|
||||||
return aops->set_page_dirty(&folio->page);
|
|
||||||
} else {
|
} else {
|
||||||
return noop_dirty_folio(mapping, folio);
|
return noop_dirty_folio(mapping, folio);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user