diff options
author | majianpeng <majianpeng@gmail.com> | 2013-02-01 06:07:57 -0500 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-02-11 17:15:01 -0500 |
commit | 5c9b469295fb6b10d98923eab5e79c4edb80ed20 (patch) | |
tree | 581672ee6731fc81b6e9a2e7a6b1e0f3a0b03c82 /fs/f2fs/super.c | |
parent | f83759e28372e593879f4dd20eb6c5ba6c4f393a (diff) |
f2fs: use F2FS_BLKSIZE to judge bloksize and page_cache_size
In some system PAGE_CACHE_SIZE isn't 4K. So using F2FS_BLKSIZE to judge.
By Jaegeuk Kim:
o f2fs does not support no other 4KB page cache size.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 0b18aee2ed25..1d7fe11fea30 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c | |||
@@ -384,14 +384,23 @@ static int sanity_check_raw_super(struct super_block *sb, | |||
384 | return 1; | 384 | return 1; |
385 | } | 385 | } |
386 | 386 | ||
387 | /* Currently, support only 4KB page cache size */ | ||
388 | if (F2FS_BLKSIZE != PAGE_CACHE_SIZE) { | ||
389 | f2fs_msg(sb, KERN_INFO, | ||
390 | "Invalid page_cache_size (%u), supports only 4KB\n", | ||
391 | PAGE_CACHE_SIZE); | ||
392 | return 1; | ||
393 | } | ||
394 | |||
387 | /* Currently, support only 4KB block size */ | 395 | /* Currently, support only 4KB block size */ |
388 | blocksize = 1 << le32_to_cpu(raw_super->log_blocksize); | 396 | blocksize = 1 << le32_to_cpu(raw_super->log_blocksize); |
389 | if (blocksize != PAGE_CACHE_SIZE) { | 397 | if (blocksize != F2FS_BLKSIZE) { |
390 | f2fs_msg(sb, KERN_INFO, | 398 | f2fs_msg(sb, KERN_INFO, |
391 | "Invalid blocksize (%u), supports only 4KB\n", | 399 | "Invalid blocksize (%u), supports only 4KB\n", |
392 | blocksize); | 400 | blocksize); |
393 | return 1; | 401 | return 1; |
394 | } | 402 | } |
403 | |||
395 | if (le32_to_cpu(raw_super->log_sectorsize) != | 404 | if (le32_to_cpu(raw_super->log_sectorsize) != |
396 | F2FS_LOG_SECTOR_SIZE) { | 405 | F2FS_LOG_SECTOR_SIZE) { |
397 | f2fs_msg(sb, KERN_INFO, "Invalid log sectorsize"); | 406 | f2fs_msg(sb, KERN_INFO, "Invalid log sectorsize"); |