File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1523,7 +1523,6 @@ struct f2fs_sb_info {
15231523
15241524#ifdef CONFIG_BLK_DEV_ZONED
15251525 unsigned int blocks_per_blkz ; /* F2FS blocks per zone */
1526- unsigned int log_blocks_per_blkz ; /* log2 F2FS blocks per zone */
15271526#endif
15281527
15291528 /* for node-related operations */
@@ -4390,7 +4389,7 @@ F2FS_FEATURE_FUNCS(readonly, RO);
43904389static inline bool f2fs_blkz_is_seq (struct f2fs_sb_info * sbi , int devi ,
43914390 block_t blkaddr )
43924391{
4393- unsigned int zno = blkaddr >> sbi -> log_blocks_per_blkz ;
4392+ unsigned int zno = blkaddr / sbi -> blocks_per_blkz ;
43944393
43954394 return test_bit (zno , FDEV (devi ).blkz_seq );
43964395}
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)
20932093 FDEV (last_dev ).end_blk =
20942094 (long long )FDEV (last_dev ).end_blk + blks ;
20952095#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 );
20982098#endif
20992099 }
21002100}
Original file line number Diff line number Diff line change @@ -2075,7 +2075,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
20752075
20762076 if (force && start >= cpc -> trim_start &&
20772077 (end - 1 ) <= cpc -> trim_end )
2078- continue ;
2078+ continue ;
20792079
20802080 /* Should cover 2MB zoned device for zone-based reset */
20812081 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)
38063806 SECTOR_TO_BLOCK (zone_sectors ))
38073807 return - EINVAL ;
38083808 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 );
38153811 if (nr_sectors & (zone_sectors - 1 ))
38163812 FDEV (devi ).nr_blkz ++ ;
38173813
You can’t perform that action at this time.
0 commit comments