f2fs: use F2FS_BLKSIZE to judge bloksize and page_cache_size
authormajianpeng <majianpeng@gmail.com>
Fri, 1 Feb 2013 11:07:57 +0000 (19:07 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 11 Feb 2013 22:15:01 +0000 (07:15 +0900)
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>
fs/f2fs/super.c

index 0b18aee2ed25bc5640e928119f7ffec185316105..1d7fe11fea307897652423fcd875b616e5a986df 100644 (file)
@@ -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");
This page took 0.026458 seconds and 5 git commands to generate.