mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
f2fs: Convert f2fs_move_node_page() to f2fs_move_node_folio()
Pass the folio in from the one caller and use it throughout. Removes eight hidden calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
c528defa64
commit
c795d9dbe0
|
|
@ -3749,7 +3749,7 @@ struct folio *f2fs_get_inode_folio(struct f2fs_sb_info *sbi, pgoff_t ino);
|
|||
struct page *f2fs_get_inode_page(struct f2fs_sb_info *sbi, pgoff_t ino);
|
||||
struct folio *f2fs_get_xnode_folio(struct f2fs_sb_info *sbi, pgoff_t xnid);
|
||||
struct page *f2fs_get_xnode_page(struct f2fs_sb_info *sbi, pgoff_t xnid);
|
||||
int f2fs_move_node_page(struct page *node_page, int gc_type);
|
||||
int f2fs_move_node_folio(struct folio *node_folio, int gc_type);
|
||||
void f2fs_flush_inline_data(struct f2fs_sb_info *sbi);
|
||||
int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
|
||||
struct writeback_control *wbc, bool atomic,
|
||||
|
|
|
|||
|
|
@ -1088,7 +1088,7 @@ static int gc_node_segment(struct f2fs_sb_info *sbi,
|
|||
continue;
|
||||
}
|
||||
|
||||
err = f2fs_move_node_page(&node_folio->page, gc_type);
|
||||
err = f2fs_move_node_folio(node_folio, gc_type);
|
||||
if (!err && gc_type == FG_GC)
|
||||
submitted++;
|
||||
stat_inc_node_blk_count(sbi, 1, gc_type);
|
||||
|
|
|
|||
|
|
@ -1787,7 +1787,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
|
|||
return AOP_WRITEPAGE_ACTIVATE;
|
||||
}
|
||||
|
||||
int f2fs_move_node_page(struct page *node_page, int gc_type)
|
||||
int f2fs_move_node_folio(struct folio *node_folio, int gc_type)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
|
|
@ -1798,30 +1798,30 @@ int f2fs_move_node_page(struct page *node_page, int gc_type)
|
|||
.for_reclaim = 0,
|
||||
};
|
||||
|
||||
f2fs_wait_on_page_writeback(node_page, NODE, true, true);
|
||||
f2fs_folio_wait_writeback(node_folio, NODE, true, true);
|
||||
|
||||
set_page_dirty(node_page);
|
||||
folio_mark_dirty(node_folio);
|
||||
|
||||
if (!clear_page_dirty_for_io(node_page)) {
|
||||
if (!folio_clear_dirty_for_io(node_folio)) {
|
||||
err = -EAGAIN;
|
||||
goto out_page;
|
||||
}
|
||||
|
||||
if (__write_node_page(node_page, false, NULL,
|
||||
if (__write_node_page(&node_folio->page, false, NULL,
|
||||
&wbc, false, FS_GC_NODE_IO, NULL)) {
|
||||
err = -EAGAIN;
|
||||
unlock_page(node_page);
|
||||
folio_unlock(node_folio);
|
||||
}
|
||||
goto release_page;
|
||||
} else {
|
||||
/* set page dirty and write it */
|
||||
if (!folio_test_writeback(page_folio(node_page)))
|
||||
set_page_dirty(node_page);
|
||||
if (!folio_test_writeback(node_folio))
|
||||
folio_mark_dirty(node_folio);
|
||||
}
|
||||
out_page:
|
||||
unlock_page(node_page);
|
||||
folio_unlock(node_folio);
|
||||
release_page:
|
||||
f2fs_put_page(node_page, 0);
|
||||
f2fs_folio_put(node_folio, false);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user