File tree Expand file tree Collapse file tree 4 files changed +6
-11
lines changed Expand file tree Collapse file tree 4 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -1523,7 +1523,6 @@ struct f2fs_sb_info {
1523
1523
1524
1524
#ifdef CONFIG_BLK_DEV_ZONED
1525
1525
unsigned int blocks_per_blkz ; /* F2FS blocks per zone */
1526
- unsigned int log_blocks_per_blkz ; /* log2 F2FS blocks per zone */
1527
1526
#endif
1528
1527
1529
1528
/* for node-related operations */
@@ -4390,7 +4389,7 @@ F2FS_FEATURE_FUNCS(readonly, RO);
4390
4389
static inline bool f2fs_blkz_is_seq (struct f2fs_sb_info * sbi , int devi ,
4391
4390
block_t blkaddr )
4392
4391
{
4393
- unsigned int zno = blkaddr >> sbi -> log_blocks_per_blkz ;
4392
+ unsigned int zno = blkaddr / sbi -> blocks_per_blkz ;
4394
4393
4395
4394
return test_bit (zno , FDEV (devi ).blkz_seq );
4396
4395
}
Original file line number Diff line number Diff line change @@ -2093,8 +2093,8 @@ static void update_fs_metadata(struct f2fs_sb_info *sbi, int secs)
2093
2093
FDEV (last_dev ).end_blk =
2094
2094
(long long )FDEV (last_dev ).end_blk + blks ;
2095
2095
#ifdef CONFIG_BLK_DEV_ZONED
2096
- FDEV (last_dev ).nr_blkz = ( int ) FDEV (last_dev ).nr_blkz +
2097
- ( int )( blks >> sbi -> log_blocks_per_blkz );
2096
+ FDEV (last_dev ).nr_blkz = FDEV (last_dev ).nr_blkz +
2097
+ div_u64 ( blks , sbi -> blocks_per_blkz );
2098
2098
#endif
2099
2099
}
2100
2100
}
Original file line number Diff line number Diff line change @@ -2075,7 +2075,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
2075
2075
2076
2076
if (force && start >= cpc -> trim_start &&
2077
2077
(end - 1 ) <= cpc -> trim_end )
2078
- continue ;
2078
+ continue ;
2079
2079
2080
2080
/* Should cover 2MB zoned device for zone-based reset */
2081
2081
if (!f2fs_sb_has_blkzoned (sbi ) &&
Original file line number Diff line number Diff line change @@ -3806,12 +3806,8 @@ static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
3806
3806
SECTOR_TO_BLOCK (zone_sectors ))
3807
3807
return - EINVAL ;
3808
3808
sbi -> blocks_per_blkz = SECTOR_TO_BLOCK (zone_sectors );
3809
- if (sbi -> log_blocks_per_blkz && sbi -> log_blocks_per_blkz !=
3810
- __ilog2_u32 (sbi -> blocks_per_blkz ))
3811
- return - EINVAL ;
3812
- sbi -> log_blocks_per_blkz = __ilog2_u32 (sbi -> blocks_per_blkz );
3813
- FDEV (devi ).nr_blkz = SECTOR_TO_BLOCK (nr_sectors ) >>
3814
- sbi -> log_blocks_per_blkz ;
3809
+ FDEV (devi ).nr_blkz = div_u64 (SECTOR_TO_BLOCK (nr_sectors ),
3810
+ sbi -> blocks_per_blkz );
3815
3811
if (nr_sectors & (zone_sectors - 1 ))
3816
3812
FDEV (devi ).nr_blkz ++ ;
3817
3813
You can’t perform that action at this time.
0 commit comments