return 1;
}
-static inline int IS_CUR_SEGNO(struct f2fs_sb_info *sbi, u32 segno, int type)
+static inline int IS_CUR_SEGNO(struct f2fs_sb_info *sbi, u32 segno)
{
int i;
for (i = 0; i < NO_CHECK_TYPE; i++) {
struct curseg_info *curseg = CURSEG_I(sbi, i);
- if (type == i)
- continue;
-
if (segno == curseg->segno)
return 1;
}
se = get_seg_entry(sbi, i);
if (se->valid_blocks != 0)
sit_valid_segs++;
- else if (IS_CUR_SEGNO(sbi, i, NO_CHECK_TYPE)) {
+ else if (IS_CUR_SEGNO(sbi, i)) {
/* curseg has not been written back to device */
MSG(1, "\tInfo: curseg %u is counted in valid segs\n", i);
sit_valid_segs++;
for (i = 0; i < TOTAL_SEGS(sbi); i++) {
struct seg_entry *se = get_seg_entry(sbi, i);
- if (se->valid_blocks == 0x0 &&
- !IS_CUR_SEGNO(sbi, i, NO_CHECK_TYPE))
+ if (se->valid_blocks == 0x0 && !IS_CUR_SEGNO(sbi, i))
free_segs++;
}
return free_segs;
se->valid_blocks);
rewrite_current_sit_page(sbi, segno, sit_blk);
- if (se->valid_blocks == 0x0 &&
- !IS_CUR_SEGNO(sbi, segno, NO_CHECK_TYPE))
+ if (se->valid_blocks == 0x0 && !IS_CUR_SEGNO(sbi, segno))
free_segs++;
}
se = get_seg_entry(sbi, segno);
if (se->valid_blocks == sbi->blocks_per_seg ||
- IS_CUR_SEGNO(sbi, segno, type)) {
+ IS_CUR_SEGNO(sbi, segno)) {
*to = left ? START_BLOCK(sbi, segno) - 1:
START_BLOCK(sbi, segno + 1);
continue;