Commit 50196f00 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

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.comSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarRyusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 8f46eaf6
...@@ -1788,7 +1788,7 @@ static void nilfs_end_page_io(struct page *page, int err) ...@@ -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) static void nilfs_abort_logs(struct list_head *logs, int err)
{ {
struct nilfs_segment_buffer *segbuf; 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; struct buffer_head *bh;
if (list_empty(logs)) if (list_empty(logs))
...@@ -1798,10 +1798,10 @@ static void nilfs_abort_logs(struct list_head *logs, int err) ...@@ -1798,10 +1798,10 @@ static void nilfs_abort_logs(struct list_head *logs, int err)
list_for_each_entry(bh, &segbuf->sb_segsum_buffers, list_for_each_entry(bh, &segbuf->sb_segsum_buffers,
b_assoc_buffers) { b_assoc_buffers) {
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
if (bh->b_page != bd_page) { if (bh->b_folio != bd_folio) {
if (bd_page) if (bd_folio)
end_page_writeback(bd_page); folio_end_writeback(bd_folio);
bd_page = bh->b_page; bd_folio = bh->b_folio;
} }
} }
...@@ -1810,22 +1810,22 @@ static void nilfs_abort_logs(struct list_head *logs, int err) ...@@ -1810,22 +1810,22 @@ static void nilfs_abort_logs(struct list_head *logs, int err)
clear_buffer_async_write(bh); clear_buffer_async_write(bh);
if (bh == segbuf->sb_super_root) { if (bh == segbuf->sb_super_root) {
clear_buffer_uptodate(bh); clear_buffer_uptodate(bh);
if (bh->b_page != bd_page) { if (bh->b_folio != bd_folio) {
end_page_writeback(bd_page); folio_end_writeback(bd_folio);
bd_page = bh->b_page; bd_folio = bh->b_folio;
} }
break; break;
} }
if (bh->b_page != fs_page) { if (bh->b_folio != fs_folio) {
nilfs_end_page_io(fs_page, err); nilfs_end_folio_io(fs_folio, err);
fs_page = bh->b_page; fs_folio = bh->b_folio;
} }
} }
} }
if (bd_page) if (bd_folio)
end_page_writeback(bd_page); 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, static void nilfs_segctor_abort_construction(struct nilfs_sc_info *sci,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment