Message ID | 20221202183943.22640-9-jack@suse.cz |
---|---|
State | Superseded |
Headers | show |
Series | ext4: Stop using ext4_writepage() for writeout of ordered data | expand |
> +static int __writepage(struct page *page, struct writeback_control *wbc, > + void *data) Can we give this a somewhat more descriptive name, e.g. ext4_writepage_cb or so? Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@lst.de>
On Sat 03-12-22 22:58:10, Christoph Hellwig wrote: > > +static int __writepage(struct page *page, struct writeback_control *wbc, > > + void *data) > > Can we give this a somewhat more descriptive name, e.g. > ext4_writepage_cb or so? OK, done. Thanks for review! Honza
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 88772e1ddd3b..d14c6d44bdf1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -2705,6 +2705,12 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd) return err; } +static int __writepage(struct page *page, struct writeback_control *wbc, + void *data) +{ + return ext4_writepage(page, wbc); +} + static int ext4_do_writepages(struct mpage_da_data *mpd) { struct writeback_control *wbc = mpd->wbc; @@ -2731,7 +2737,9 @@ static int ext4_do_writepages(struct mpage_da_data *mpd) goto out_writepages; if (ext4_should_journal_data(inode)) { - ret = generic_writepages(mapping, wbc); + blk_start_plug(&plug); + ret = write_cache_pages(mapping, wbc, __writepage, mapping); + blk_finish_plug(&plug); goto out_writepages; }
Instead of using generic_writepages(), let's use write_cache_pages() for writeout of journalled data. It will allow us to stop providing .writepage callback. Our data=journal writeback path would benefit from a larger cleanup and refactoring but that's for a separate cleanup series. Signed-off-by: Jan Kara <jack@suse.cz> --- fs/ext4/inode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)