Skip to content

Commit

Permalink
f2fs: use F2FS_BLKSIZE to judge bloksize and page_cache_size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
majianpeng authored and Jaegeuk Kim committed Feb 11, 2013
1 parent f83759e commit 5c9b469
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion fs/f2fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,23 @@ static int sanity_check_raw_super(struct super_block *sb,
return 1;
}

/* Currently, support only 4KB page cache size */
if (F2FS_BLKSIZE != PAGE_CACHE_SIZE) {
f2fs_msg(sb, KERN_INFO,
"Invalid page_cache_size (%u), supports only 4KB\n",
PAGE_CACHE_SIZE);
return 1;
}

/* Currently, support only 4KB block size */
blocksize = 1 << le32_to_cpu(raw_super->log_blocksize);
if (blocksize != PAGE_CACHE_SIZE) {
if (blocksize != F2FS_BLKSIZE) {
f2fs_msg(sb, KERN_INFO,
"Invalid blocksize (%u), supports only 4KB\n",
blocksize);
return 1;
}

if (le32_to_cpu(raw_super->log_sectorsize) !=
F2FS_LOG_SECTOR_SIZE) {
f2fs_msg(sb, KERN_INFO, "Invalid log sectorsize");
Expand Down

0 comments on commit 5c9b469

Please sign in to comment.