diff options
author | Chao Yu <chao2.yu@samsung.com> | 2014-09-15 14:01:10 +0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-09-23 22:10:20 +0400 |
commit | 55cf9cb63f0e5439f208d78ed944de9a8df65011 (patch) | |
tree | 2b15d8458854f0da153d958afe4a339f43bbd996 /fs/f2fs/segment.h | |
parent | 09db6a2ef8d9ca6da71b5de56097e8b769bef299 (diff) | |
download | linux-55cf9cb63f0e5439f208d78ed944de9a8df65011.tar.xz |
f2fs: support large sector size
Block size in f2fs is 4096 bytes, so theoretically, f2fs can support 4096 bytes
sector device at maximum. But now f2fs only support 512 bytes size sector, so
block device such as zRAM which uses page cache as its block storage space will
not be mounted successfully as mismatch between sector size of zRAM and sector
size of f2fs supported.
In this patch we support large sector size in f2fs, so block device with sector
size of 512/1024/2048/4096 bytes can be supported in f2fs.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 848ac519958f..032c0905a12b 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -89,10 +89,10 @@ #define TOTAL_SECS(sbi) (sbi->total_sections) #define TOTAL_BLKS(sbi) (SM_I(sbi)->segment_count << sbi->log_blocks_per_seg) -#define SECTOR_FROM_BLOCK(sbi, blk_addr) \ - (((sector_t)blk_addr) << (sbi)->log_sectors_per_block) -#define SECTOR_TO_BLOCK(sbi, sectors) \ - (sectors >> (sbi)->log_sectors_per_block) +#define SECTOR_FROM_BLOCK(blk_addr) \ + (((sector_t)blk_addr) << F2FS_LOG_SECTORS_PER_BLOCK) +#define SECTOR_TO_BLOCK(sectors) \ + (sectors >> F2FS_LOG_SECTORS_PER_BLOCK) #define MAX_BIO_BLOCKS(sbi) \ ((int)min((int)max_hw_blocks(sbi), BIO_MAX_PAGES)) @@ -711,7 +711,7 @@ static inline unsigned int max_hw_blocks(struct f2fs_sb_info *sbi) { struct block_device *bdev = sbi->sb->s_bdev; struct request_queue *q = bdev_get_queue(bdev); - return SECTOR_TO_BLOCK(sbi, queue_max_sectors(q)); + return SECTOR_TO_BLOCK(queue_max_sectors(q)); } /* |