Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

f2fs: wrap all unusable_blocks_per_sec code in CONFIG_BLK_DEV_ZONED

The usage of unusable_blocks_per_sec is already wrapped by
CONFIG_BLK_DEV_ZONED, except for its declaration and the definitions of
CAP_BLKS_PER_SEC and CAP_SEGS_PER_SEC. This patch ensures that all code
related to unusable_blocks_per_sec is properly wrapped under the
CONFIG_BLK_DEV_ZONED option.

Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Yongpeng Yang and committed by
Jaegeuk Kim
581251e0 24fd7f00

+6 -1
+1 -1
fs/f2fs/f2fs.h
··· 1669 1669 1670 1670 #ifdef CONFIG_BLK_DEV_ZONED 1671 1671 unsigned int blocks_per_blkz; /* F2FS blocks per zone */ 1672 + unsigned int unusable_blocks_per_sec; /* unusable blocks per section */ 1672 1673 unsigned int max_open_zones; /* max open zone resources of the zoned device */ 1673 1674 /* For adjust the priority writing position of data in zone UFS */ 1674 1675 unsigned int blkzone_alloc_policy; ··· 1742 1741 unsigned int meta_ino_num; /* meta inode number*/ 1743 1742 unsigned int log_blocks_per_seg; /* log2 blocks per segment */ 1744 1743 unsigned int blocks_per_seg; /* blocks per segment */ 1745 - unsigned int unusable_blocks_per_sec; /* unusable blocks per section */ 1746 1744 unsigned int segs_per_sec; /* segments per section */ 1747 1745 unsigned int secs_per_zone; /* sections per zone */ 1748 1746 unsigned int total_sections; /* total section count */
+5
fs/f2fs/segment.h
··· 69 69 ((!__is_valid_data_blkaddr(blk_addr)) ? \ 70 70 NULL_SEGNO : GET_L2R_SEGNO(FREE_I(sbi), \ 71 71 GET_SEGNO_FROM_SEG0(sbi, blk_addr))) 72 + #ifdef CONFIG_BLK_DEV_ZONED 72 73 #define CAP_BLKS_PER_SEC(sbi) \ 73 74 (BLKS_PER_SEC(sbi) - (sbi)->unusable_blocks_per_sec) 74 75 #define CAP_SEGS_PER_SEC(sbi) \ 75 76 (SEGS_PER_SEC(sbi) - \ 76 77 BLKS_TO_SEGS(sbi, (sbi)->unusable_blocks_per_sec)) 78 + #else 79 + #define CAP_BLKS_PER_SEC(sbi) BLKS_PER_SEC(sbi) 80 + #define CAP_SEGS_PER_SEC(sbi) SEGS_PER_SEC(sbi) 81 + #endif 77 82 #define GET_START_SEG_FROM_SEC(sbi, segno) \ 78 83 (rounddown(segno, SEGS_PER_SEC(sbi))) 79 84 #define GET_SEC_FROM_SEG(sbi, segno) \