diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-11-14 17:44:18 +0900 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-12-10 17:21:26 -0800 |
commit | 50196f0081caef71090dc11eeb2b0793ff9449bc (patch) | |
tree | d878d554def5f094d782dbbe7970ca9b117ed89e /fs/nilfs2 | |
parent | 8f46eaf6fd8454b0621b4ce07df50b2aa471c880 (diff) | |
download | linux-50196f0081caef71090dc11eeb2b0793ff9449bc.tar.gz linux-50196f0081caef71090dc11eeb2b0793ff9449bc.tar.bz2 linux-50196f0081caef71090dc11eeb2b0793ff9449bc.zip |
nilfs2: convert nilfs_abort_logs to use folios
Use the new folio APIs, saving five hidden calls to compound_head().
Link: https://lkml.kernel.org/r/20231114084436.2755-3-konishi.ryusuke@gmail.com
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/segment.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 1df03d0895be..730062e79bfc 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -1788,7 +1788,7 @@ static void nilfs_end_page_io(struct page *page, int err) static void nilfs_abort_logs(struct list_head *logs, int err) { struct nilfs_segment_buffer *segbuf; - struct page *bd_page = NULL, *fs_page = NULL; + struct folio *bd_folio = NULL, *fs_folio = NULL; struct buffer_head *bh; if (list_empty(logs)) @@ -1798,10 +1798,10 @@ static void nilfs_abort_logs(struct list_head *logs, int err) list_for_each_entry(bh, &segbuf->sb_segsum_buffers, b_assoc_buffers) { clear_buffer_uptodate(bh); - if (bh->b_page != bd_page) { - if (bd_page) - end_page_writeback(bd_page); - bd_page = bh->b_page; + if (bh->b_folio != bd_folio) { + if (bd_folio) + folio_end_writeback(bd_folio); + bd_folio = bh->b_folio; } } @@ -1810,22 +1810,22 @@ static void nilfs_abort_logs(struct list_head *logs, int err) clear_buffer_async_write(bh); if (bh == segbuf->sb_super_root) { clear_buffer_uptodate(bh); - if (bh->b_page != bd_page) { - end_page_writeback(bd_page); - bd_page = bh->b_page; + if (bh->b_folio != bd_folio) { + folio_end_writeback(bd_folio); + bd_folio = bh->b_folio; } break; } - if (bh->b_page != fs_page) { - nilfs_end_page_io(fs_page, err); - fs_page = bh->b_page; + if (bh->b_folio != fs_folio) { + nilfs_end_folio_io(fs_folio, err); + fs_folio = bh->b_folio; } } } - if (bd_page) - end_page_writeback(bd_page); + if (bd_folio) + folio_end_writeback(bd_folio); - nilfs_end_page_io(fs_page, err); + nilfs_end_folio_io(fs_folio, err); } static void nilfs_segctor_abort_construction(struct nilfs_sc_info *sci, |