mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
Merge "f2fs: handle errors of f2fs_get_meta_page_nofail"
This commit is contained in:
commit
ccbf386326
4 changed files with 12 additions and 6 deletions
|
|
@ -107,7 +107,7 @@ struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
|
|||
return __get_meta_page(sbi, index, true);
|
||||
}
|
||||
|
||||
struct page *f2fs_get_meta_page_nofail(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 *page;
|
||||
int count = 0;
|
||||
|
|
|
|||
|
|
@ -3384,7 +3384,7 @@ enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
|
|||
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io);
|
||||
struct page *f2fs_grab_meta_page(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_nofail(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);
|
||||
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
|
||||
block_t blkaddr, int type);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ static void clear_node_page_dirty(struct page *page)
|
|||
|
||||
static struct page *get_current_nat_page(struct f2fs_sb_info *sbi, nid_t nid)
|
||||
{
|
||||
return f2fs_get_meta_page_nofail(sbi, current_nat_addr(sbi, nid));
|
||||
return f2fs_get_meta_page(sbi, current_nat_addr(sbi, nid));
|
||||
}
|
||||
|
||||
static struct page *get_next_nat_page(struct f2fs_sb_info *sbi, nid_t nid)
|
||||
|
|
|
|||
|
|
@ -2318,7 +2318,9 @@ int f2fs_npages_for_summary_flush(struct f2fs_sb_info *sbi, bool for_ra)
|
|||
*/
|
||||
struct page *f2fs_get_sum_page(struct f2fs_sb_info *sbi, unsigned int segno)
|
||||
{
|
||||
return f2fs_get_meta_page_nofail(sbi, GET_SUM_BLOCK(sbi, segno));
|
||||
if (unlikely(f2fs_cp_error(sbi)))
|
||||
return ERR_PTR(-EIO);
|
||||
return f2fs_get_meta_page_retry(sbi, GET_SUM_BLOCK(sbi, segno));
|
||||
}
|
||||
|
||||
void f2fs_update_meta_page(struct f2fs_sb_info *sbi,
|
||||
|
|
@ -2590,7 +2592,11 @@ static void change_curseg(struct f2fs_sb_info *sbi, int type)
|
|||
__next_free_blkoff(sbi, curseg, 0);
|
||||
|
||||
sum_page = f2fs_get_sum_page(sbi, new_segno);
|
||||
f2fs_bug_on(sbi, IS_ERR(sum_page));
|
||||
if (IS_ERR(sum_page)) {
|
||||
/* GC won't be able to use stale summary pages by cp_error */
|
||||
memset(curseg->sum_blk, 0, SUM_ENTRY_SIZE);
|
||||
return;
|
||||
}
|
||||
sum_node = (struct f2fs_summary_block *)page_address(sum_page);
|
||||
memcpy(curseg->sum_blk, sum_node, SUM_ENTRY_SIZE);
|
||||
f2fs_put_page(sum_page, 1);
|
||||
|
|
@ -3759,7 +3765,7 @@ int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
|
|||
static struct page *get_current_sit_page(struct f2fs_sb_info *sbi,
|
||||
unsigned int segno)
|
||||
{
|
||||
return f2fs_get_meta_page_nofail(sbi, current_sit_addr(sbi, segno));
|
||||
return f2fs_get_meta_page(sbi, current_sit_addr(sbi, segno));
|
||||
}
|
||||
|
||||
static struct page *get_next_sit_page(struct f2fs_sb_info *sbi,
|
||||
|
|
|
|||
Loading…
Reference in a new issue