f2fs: remove rewrite_node_page
I think we need to let the dirty node pages remain in the page cache instead of rewriting them in their places. So, after done with successful recovery, write_checkpoint will flush all of them through the normal write path. Through this, we can avoid potential error cases in terms of block allocation. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -1103,55 +1103,6 @@ void recover_data_page(struct f2fs_sb_info *sbi,
|
||||
mutex_unlock(&curseg->curseg_mutex);
|
||||
}
|
||||
|
||||
void rewrite_node_page(struct f2fs_sb_info *sbi,
|
||||
struct page *page, struct f2fs_summary *sum,
|
||||
block_t old_blkaddr, block_t new_blkaddr)
|
||||
{
|
||||
struct sit_info *sit_i = SIT_I(sbi);
|
||||
int type = CURSEG_WARM_NODE;
|
||||
struct curseg_info *curseg;
|
||||
unsigned int segno, old_cursegno;
|
||||
block_t next_blkaddr = next_blkaddr_of_node(page);
|
||||
unsigned int next_segno = GET_SEGNO(sbi, next_blkaddr);
|
||||
struct f2fs_io_info fio = {
|
||||
.type = NODE,
|
||||
.rw = WRITE_SYNC,
|
||||
};
|
||||
|
||||
curseg = CURSEG_I(sbi, type);
|
||||
|
||||
mutex_lock(&curseg->curseg_mutex);
|
||||
mutex_lock(&sit_i->sentry_lock);
|
||||
|
||||
segno = GET_SEGNO(sbi, new_blkaddr);
|
||||
old_cursegno = curseg->segno;
|
||||
|
||||
/* change the current segment */
|
||||
if (segno != curseg->segno) {
|
||||
curseg->next_segno = segno;
|
||||
change_curseg(sbi, type, true);
|
||||
}
|
||||
curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, new_blkaddr);
|
||||
__add_sum_entry(sbi, type, sum);
|
||||
|
||||
/* change the current log to the next block addr in advance */
|
||||
if (next_segno != segno) {
|
||||
curseg->next_segno = next_segno;
|
||||
change_curseg(sbi, type, true);
|
||||
}
|
||||
curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, next_blkaddr);
|
||||
|
||||
/* rewrite node page */
|
||||
set_page_writeback(page);
|
||||
f2fs_submit_page_mbio(sbi, page, new_blkaddr, &fio);
|
||||
f2fs_submit_merged_bio(sbi, NODE, WRITE);
|
||||
refresh_sit_entry(sbi, old_blkaddr, new_blkaddr);
|
||||
locate_dirty_segment(sbi, old_cursegno);
|
||||
|
||||
mutex_unlock(&sit_i->sentry_lock);
|
||||
mutex_unlock(&curseg->curseg_mutex);
|
||||
}
|
||||
|
||||
static inline bool is_merged_page(struct f2fs_sb_info *sbi,
|
||||
struct page *page, enum page_type type)
|
||||
{
|
||||
|
Reference in New Issue
Block a user