Skip to content

Commit 3a3bae5

Browse files
author
Matthew Wilcox (Oracle)
committed
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) <[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 51cdea7 commit 3a3bae5

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

fs/ecryptfs/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ const struct address_space_operations ecryptfs_aops = {
540540
* XXX: This is pretty broken for multiple reasons: ecryptfs does not
541541
* actually use buffer_heads, and ecryptfs will crash without
542542
* CONFIG_BLOCK. But it matches the behavior before the default for
543-
* address_space_operations without the ->set_page_dirty method was
543+
* address_space_operations without the ->dirty_folio method was
544544
* cleaned up, so this is the best we can do without maintainer
545545
* feedback.
546546
*/

include/linux/fs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ struct address_space_operations {
367367
/* Write back some dirty pages from this mapping. */
368368
int (*writepages)(struct address_space *, struct writeback_control *);
369369

370-
/* Set a page dirty. Return true if this dirtied it */
371-
int (*set_page_dirty)(struct page *page);
370+
/* Mark a folio dirty. Return true if this dirtied it */
372371
bool (*dirty_folio)(struct address_space *, struct folio *);
373372

374373
/*

mm/page-writeback.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,15 +2641,10 @@ bool folio_mark_dirty(struct folio *folio)
26412641
*/
26422642
if (folio_test_reclaim(folio))
26432643
folio_clear_reclaim(folio);
2644-
if (mapping->a_ops->dirty_folio)
2645-
return mapping->a_ops->dirty_folio(mapping, folio);
2646-
return mapping->a_ops->set_page_dirty(&folio->page);
2644+
return mapping->a_ops->dirty_folio(mapping, folio);
26472645
}
2648-
if (!folio_test_dirty(folio)) {
2649-
if (!folio_test_set_dirty(folio))
2650-
return true;
2651-
}
2652-
return false;
2646+
2647+
return noop_dirty_folio(mapping, folio);
26532648
}
26542649
EXPORT_SYMBOL(folio_mark_dirty);
26552650

mm/page_io.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,7 @@ bool swap_dirty_folio(struct address_space *mapping, struct folio *folio)
449449
aops = mapping->a_ops;
450450

451451
VM_BUG_ON_FOLIO(!folio_test_swapcache(folio), folio);
452-
if (aops->dirty_folio)
453-
return aops->dirty_folio(mapping, folio);
454-
return aops->set_page_dirty(&folio->page);
452+
return aops->dirty_folio(mapping, folio);
455453
} else {
456454
return noop_dirty_folio(mapping, folio);
457455
}

0 commit comments

Comments
 (0)