am 400a8406: fsck.f2fs: support large sector size
* commit '400a84068b47b92a45c30a756669062e7d81077c':
fsck.f2fs: support large sector size
diff --git a/fsck/mount.c b/fsck/mount.c
index 73eba6b..6d96db8 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -221,12 +221,15 @@
return -1;
}
- if (F2FS_LOG_SECTOR_SIZE != le32_to_cpu(raw_super->log_sectorsize)) {
+ if (le32_to_cpu(raw_super->log_sectorsize) > F2FS_MAX_LOG_SECTOR_SIZE ||
+ le32_to_cpu(raw_super->log_sectorsize) <
+ F2FS_MIN_LOG_SECTOR_SIZE) {
return -1;
}
- if (F2FS_LOG_SECTORS_PER_BLOCK !=
- le32_to_cpu(raw_super->log_sectors_per_block)) {
+ if (le32_to_cpu(raw_super->log_sectors_per_block) +
+ le32_to_cpu(raw_super->log_sectorsize) !=
+ F2FS_MAX_LOG_SECTOR_SIZE) {
return -1;
}
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index e7fb8fa..6ce58c2 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -289,8 +289,8 @@
* Copied from include/linux/f2fs_sb.h
*/
#define F2FS_SUPER_OFFSET 1024 /* byte-size offset */
-#define F2FS_LOG_SECTOR_SIZE 9 /* 9 bits for 512 byte */
-#define F2FS_LOG_SECTORS_PER_BLOCK 3 /* 4KB: F2FS_BLKSIZE */
+#define F2FS_MIN_LOG_SECTOR_SIZE 9 /* 9 bits for 512 bytes */
+#define F2FS_MAX_LOG_SECTOR_SIZE 12 /* 12 bits for 4096 bytes */
#define F2FS_BLKSIZE 4096 /* support only 4KB block */
#define F2FS_MAX_EXTENSION 64 /* # of extension entries */
#define F2FS_BLK_ALIGN(x) (((x) + F2FS_BLKSIZE - 1) / F2FS_BLKSIZE)