mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 19:13:47 +02:00
f2fs: Add f2fs_grab_meta_folio()
Turn f2fs_grab_meta_page() into a wrapper around f2fs_grab_meta_folio(). Saves 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
0d1e687e43
commit
b15ca18571
|
|
@ -38,20 +38,20 @@ void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
|
|||
/*
|
||||
* We guarantee no failure on the returned page.
|
||||
*/
|
||||
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
|
||||
struct folio *f2fs_grab_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index)
|
||||
{
|
||||
struct address_space *mapping = META_MAPPING(sbi);
|
||||
struct page *page;
|
||||
struct folio *folio;
|
||||
repeat:
|
||||
page = f2fs_grab_cache_page(mapping, index, false);
|
||||
if (!page) {
|
||||
folio = f2fs_grab_cache_folio(mapping, index, false);
|
||||
if (IS_ERR(folio)) {
|
||||
cond_resched();
|
||||
goto repeat;
|
||||
}
|
||||
f2fs_wait_on_page_writeback(page, META, true, true);
|
||||
if (!PageUptodate(page))
|
||||
SetPageUptodate(page);
|
||||
return page;
|
||||
f2fs_folio_wait_writeback(folio, META, true, true);
|
||||
if (!folio_test_uptodate(folio))
|
||||
folio_mark_uptodate(folio);
|
||||
return folio;
|
||||
}
|
||||
|
||||
static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
|
||||
|
|
|
|||
|
|
@ -3893,7 +3893,7 @@ static inline bool f2fs_need_rand_seg(struct f2fs_sb_info *sbi)
|
|||
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
|
||||
unsigned char reason);
|
||||
void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi);
|
||||
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct folio *f2fs_grab_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_tmp_page(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
|
|
@ -3936,6 +3936,12 @@ int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi);
|
|||
void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi);
|
||||
void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi);
|
||||
|
||||
static inline
|
||||
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
|
||||
{
|
||||
return &f2fs_grab_meta_folio(sbi, index)->page;
|
||||
}
|
||||
|
||||
/*
|
||||
* data.c
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user