diff options
| author | Kelvin Zhang <zhangxp1998@gmail.com> | 2026-09-03 16:56:20 -0700 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2026-09-14 15:21:47 +0000 |
| commit | b32d4bdbae616dec768252b86845d9358c770a15 (patch) | |
| tree | 016cdbbddf33942c621db14d9843573d518b7882 /include/linux | |
| parent | 48747bfe30c6a67dc9f8df87042154f204611f5f (diff) | |
| download | linux-next-b32d4bdbae616dec768252b86845d9358c770a15.tar.gz linux-next-b32d4bdbae616dec768252b86845d9358c770a15.zip | |
f2fs: parameterize sector conversion macros
Sector-to-block and block-to-sector conversion helpers previously
assumed a fixed sector count per block derived from 4KB pages.
Parameterize F2FS_LOG_SECTORS_PER_BLOCK, SECTOR_FROM_BLOCK, and
SECTOR_TO_BLOCK with struct f2fs_sb_info *sbi, using
sbi->log_sectors_per_block.
Update all call sites across metadata I/O, data mapping, discard
operations, and zoned block device reporting.
Signed-off-by: Kelvin Zhang <zhangxp1998@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/f2fs_fs.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h index e98bff846b23..33995cd3dd6d 100644 --- a/include/linux/f2fs_fs.h +++ b/include/linux/f2fs_fs.h @@ -14,7 +14,7 @@ #define F2FS_SUPER_OFFSET 1024 /* byte-size offset */ #define F2FS_MIN_LOG_SECTOR_SIZE 9 /* 9 bits for 512 bytes */ #define F2FS_MAX_LOG_SECTOR_SIZE PAGE_SHIFT /* Max is Block Size */ -#define F2FS_LOG_SECTORS_PER_BLOCK (PAGE_SHIFT - 9) /* log number for sector/blk */ +#define F2FS_LOG_SECTORS_PER_BLOCK(sbi) ((sbi)->log_blocksize - 9) /* log number for sector/blk */ #define F2FS_MIN_LOG_BLOCKSIZE 12 #define F2FS_MIN_BLKSIZE 4096UL #define F2FS_BLKSIZE PAGE_SIZE /* support only block == page */ |
