Loading fs/f2fs/segment.c +8 −11 Original line number Diff line number Diff line Loading @@ -3087,13 +3087,6 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) return err; } static bool __has_curseg_space(struct f2fs_sb_info *sbi, struct curseg_info *curseg) { return curseg->next_blkoff < f2fs_usable_blks_in_seg(sbi, curseg->segno); } int f2fs_rw_hint_to_seg_type(enum rw_hint hint) { switch (hint) { Loading Loading @@ -3235,6 +3228,7 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, unsigned long long old_mtime; bool from_gc = (type == CURSEG_ALL_DATA_ATGC); struct seg_entry *se = NULL; bool segment_full = false; f2fs_down_read(&SM_I(sbi)->curseg_lock); Loading @@ -3261,6 +3255,8 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, if (F2FS_OPTION(sbi).fs_mode == FS_MODE_FRAGMENT_BLK) f2fs_randomize_chunk(sbi, curseg); } if (curseg->next_blkoff >= f2fs_usable_blks_in_seg(sbi, curseg->segno)) segment_full = true; stat_inc_block_count(sbi, curseg); if (from_gc) { Loading @@ -3279,10 +3275,11 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, if (GET_SEGNO(sbi, old_blkaddr) != NULL_SEGNO) update_sit_entry(sbi, old_blkaddr, -1); if (!__has_curseg_space(sbi, curseg)) { /* * Flush out current segment and replace it with new segment. * If the current segment is full, flush it out and replace it with a * new segment. */ if (segment_full) { if (from_gc) { get_atssr_segment(sbi, type, se->type, AT_SSR, se->mtime); Loading Loading
fs/f2fs/segment.c +8 −11 Original line number Diff line number Diff line Loading @@ -3087,13 +3087,6 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) return err; } static bool __has_curseg_space(struct f2fs_sb_info *sbi, struct curseg_info *curseg) { return curseg->next_blkoff < f2fs_usable_blks_in_seg(sbi, curseg->segno); } int f2fs_rw_hint_to_seg_type(enum rw_hint hint) { switch (hint) { Loading Loading @@ -3235,6 +3228,7 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, unsigned long long old_mtime; bool from_gc = (type == CURSEG_ALL_DATA_ATGC); struct seg_entry *se = NULL; bool segment_full = false; f2fs_down_read(&SM_I(sbi)->curseg_lock); Loading @@ -3261,6 +3255,8 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, if (F2FS_OPTION(sbi).fs_mode == FS_MODE_FRAGMENT_BLK) f2fs_randomize_chunk(sbi, curseg); } if (curseg->next_blkoff >= f2fs_usable_blks_in_seg(sbi, curseg->segno)) segment_full = true; stat_inc_block_count(sbi, curseg); if (from_gc) { Loading @@ -3279,10 +3275,11 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, if (GET_SEGNO(sbi, old_blkaddr) != NULL_SEGNO) update_sit_entry(sbi, old_blkaddr, -1); if (!__has_curseg_space(sbi, curseg)) { /* * Flush out current segment and replace it with new segment. * If the current segment is full, flush it out and replace it with a * new segment. */ if (segment_full) { if (from_gc) { get_atssr_segment(sbi, type, se->type, AT_SSR, se->mtime); Loading