mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
f2fs: Convert f2fs_get_meta_page_retry() to f2fs_get_meta_folio_retry()
Also convert get_current_nat_page() to get_current_nat_folio(). Removes three 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
657b31b2d7
commit
350b8441c0
|
|
@ -112,7 +112,7 @@ struct folio *f2fs_get_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index)
|
|||
return __get_meta_folio(sbi, index, true);
|
||||
}
|
||||
|
||||
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index)
|
||||
struct folio *f2fs_get_meta_folio_retry(struct f2fs_sb_info *sbi, pgoff_t index)
|
||||
{
|
||||
struct folio *folio;
|
||||
int count = 0;
|
||||
|
|
@ -125,7 +125,7 @@ struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index)
|
|||
goto retry;
|
||||
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_META_PAGE);
|
||||
}
|
||||
return &folio->page;
|
||||
return folio;
|
||||
}
|
||||
|
||||
/* for POR only */
|
||||
|
|
|
|||
|
|
@ -3895,7 +3895,7 @@ void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
|
|||
void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi);
|
||||
struct folio *f2fs_grab_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct folio *f2fs_get_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct folio *f2fs_get_meta_folio_retry(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct folio *f2fs_get_tmp_folio(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
|
||||
block_t blkaddr, int type);
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ static void clear_node_page_dirty(struct page *page)
|
|||
ClearPageUptodate(page);
|
||||
}
|
||||
|
||||
static struct page *get_current_nat_page(struct f2fs_sb_info *sbi, nid_t nid)
|
||||
static struct folio *get_current_nat_folio(struct f2fs_sb_info *sbi, nid_t nid)
|
||||
{
|
||||
return f2fs_get_meta_page_retry(sbi, current_nat_addr(sbi, nid));
|
||||
return f2fs_get_meta_folio_retry(sbi, current_nat_addr(sbi, nid));
|
||||
}
|
||||
|
||||
static struct page *get_next_nat_page(struct f2fs_sb_info *sbi, nid_t nid)
|
||||
{
|
||||
struct page *src_page;
|
||||
struct folio *src_folio;
|
||||
struct folio *dst_folio;
|
||||
pgoff_t dst_off;
|
||||
void *src_addr;
|
||||
|
|
@ -147,17 +147,17 @@ static struct page *get_next_nat_page(struct f2fs_sb_info *sbi, nid_t nid)
|
|||
dst_off = next_nat_addr(sbi, current_nat_addr(sbi, nid));
|
||||
|
||||
/* get current nat block page with lock */
|
||||
src_page = get_current_nat_page(sbi, nid);
|
||||
if (IS_ERR(src_page))
|
||||
return src_page;
|
||||
src_folio = get_current_nat_folio(sbi, nid);
|
||||
if (IS_ERR(src_folio))
|
||||
return &src_folio->page;
|
||||
dst_folio = f2fs_grab_meta_folio(sbi, dst_off);
|
||||
f2fs_bug_on(sbi, PageDirty(src_page));
|
||||
f2fs_bug_on(sbi, folio_test_dirty(src_folio));
|
||||
|
||||
src_addr = page_address(src_page);
|
||||
src_addr = folio_address(src_folio);
|
||||
dst_addr = folio_address(dst_folio);
|
||||
memcpy(dst_addr, src_addr, PAGE_SIZE);
|
||||
folio_mark_dirty(dst_folio);
|
||||
f2fs_put_page(src_page, 1);
|
||||
f2fs_folio_put(src_folio, true);
|
||||
|
||||
set_to_next_nat(nm_i, nid);
|
||||
|
||||
|
|
@ -2544,13 +2544,13 @@ static int __f2fs_build_free_nids(struct f2fs_sb_info *sbi,
|
|||
while (1) {
|
||||
if (!test_bit_le(NAT_BLOCK_OFFSET(nid),
|
||||
nm_i->nat_block_bitmap)) {
|
||||
struct page *page = get_current_nat_page(sbi, nid);
|
||||
struct folio *folio = get_current_nat_folio(sbi, nid);
|
||||
|
||||
if (IS_ERR(page)) {
|
||||
ret = PTR_ERR(page);
|
||||
if (IS_ERR(folio)) {
|
||||
ret = PTR_ERR(folio);
|
||||
} else {
|
||||
ret = scan_nat_page(sbi, page, nid);
|
||||
f2fs_put_page(page, 1);
|
||||
ret = scan_nat_page(sbi, &folio->page, nid);
|
||||
f2fs_folio_put(folio, true);
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
|
|
|
|||
|
|
@ -2687,7 +2687,7 @@ struct page *f2fs_get_sum_page(struct f2fs_sb_info *sbi, unsigned int segno)
|
|||
{
|
||||
if (unlikely(f2fs_cp_error(sbi)))
|
||||
return ERR_PTR(-EIO);
|
||||
return f2fs_get_meta_page_retry(sbi, GET_SUM_BLOCK(sbi, segno));
|
||||
return &f2fs_get_meta_folio_retry(sbi, GET_SUM_BLOCK(sbi, segno))->page;
|
||||
}
|
||||
|
||||
void f2fs_update_meta_page(struct f2fs_sb_info *sbi,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user