diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2025-03-31 21:11:02 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2025-04-28 15:26:31 +0000 |
commit | 0e1073f850fce4d26817e4288c230dcd50b42118 (patch) | |
tree | 90e302acced470300c945836d35a8e402a4d8b8b | |
parent | b536cd889ea83f393c1ebc2f6a87de8c9daf7a73 (diff) |
f2fs: Use a folio in change_curseg()
Get a folio and use it. Saves a call 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>
-rw-r--r-- | fs/f2fs/segment.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 329cc39da18a..059dacbca2d0 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3003,7 +3003,7 @@ static int change_curseg(struct f2fs_sb_info *sbi, int type) struct curseg_info *curseg = CURSEG_I(sbi, type); unsigned int new_segno = curseg->next_segno; struct f2fs_summary_block *sum_node; - struct page *sum_page; + struct folio *sum_folio; if (curseg->inited) write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno)); @@ -3019,15 +3019,15 @@ static int change_curseg(struct f2fs_sb_info *sbi, int type) curseg->alloc_type = SSR; curseg->next_blkoff = __next_free_blkoff(sbi, curseg->segno, 0); - sum_page = f2fs_get_sum_page(sbi, new_segno); - if (IS_ERR(sum_page)) { + sum_folio = f2fs_get_sum_folio(sbi, new_segno); + if (IS_ERR(sum_folio)) { /* GC won't be able to use stale summary pages by cp_error */ memset(curseg->sum_blk, 0, SUM_ENTRY_SIZE); - return PTR_ERR(sum_page); + return PTR_ERR(sum_folio); } - sum_node = (struct f2fs_summary_block *)page_address(sum_page); + sum_node = folio_address(sum_folio); memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE); - f2fs_put_page(sum_page, 1); + f2fs_folio_put(sum_folio, true); return 0; } |