Skip to content

Commit

Permalink
Merge pull request #45 from nicktehrany/fix_segmap_zone_count
Browse files Browse the repository at this point in the history
Fix segmap zone count
  • Loading branch information
nicktehrany authored Nov 14, 2022
2 parents dacfa07 + 0456ef6 commit aaef7b5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/libzns-tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,13 @@ void increase_file_segment_counter(char *file, unsigned int num_segments,
}
}

uint32_t zone = get_zone_number(cur_segment >> ctrl.segment_shift);
uint32_t zone = get_zone_number(cur_segment << ctrl.segment_shift);
if (file_counter_map->file[i].last_zone != zone) {
file_counter_map->file[i].zone_ctr += (num_segments / zone_cap) + 1;
file_counter_map->file[i].last_segment_id = cur_segment;
file_counter_map->file[i].zone_ctr +=
(num_segments * F2FS_SEGMENT_BYTES >> ctrl.sector_shift) /
zone_cap +
1;
file_counter_map->file[i].last_zone = zone;
}
}

Expand Down

0 comments on commit aaef7b5

Please sign in to comment.