diff options
author | Chao Yu <chao2.yu@samsung.com> | 2015-02-05 17:36:39 +0800 |
---|---|---|
committer | JP Abgrall <jpa@google.com> | 2015-03-23 10:10:26 -0700 |
commit | 29ab4d8788d204edb362f01879e1d3d4f516e967 (patch) | |
tree | eeb0299b8f7a98bcc8ec9bacd8d4621dc013cf21 /lib | |
parent | 8bcdc5fdb206196241dc6fc535e6d285d4985201 (diff) | |
download | android_external_f2fs-tools-29ab4d8788d204edb362f01879e1d3d4f516e967.tar.gz android_external_f2fs-tools-29ab4d8788d204edb362f01879e1d3d4f516e967.tar.bz2 android_external_f2fs-tools-29ab4d8788d204edb362f01879e1d3d4f516e967.zip |
mkfs.f2fs: support large sector size
Since f2fs support large sector size in commit 55cf9cb63f0e "f2fs: support large
sector size", block device with sector size of 512/1024/2048/4096 bytes can be
supported.
But mkfs.f2fs still use default sector size: 512 bytes as sector size, let's fix
this issue in this patch.
v2:
o remove unneeded printed message when sector size is large than 512 bytes
suggested by Kinglong.
o show correct sector size in printed message.
o use config.sectors_per_blk instead of DEFAULT_SECTORS_PER_BLOCK suggested by
Kinglong.
v3:
o remove another unneeded printed message when sector size is large than 512
bytes suggested by Kinglong.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Reviewed-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libf2fs.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libf2fs.c b/lib/libf2fs.c index 8123528..9e19e9b 100644 --- a/lib/libf2fs.c +++ b/lib/libf2fs.c @@ -463,10 +463,6 @@ int f2fs_get_device_info(struct f2fs_configuration *c) MSG(0, "\tError: Using the default sector size\n"); } else { if (c->sector_size < sector_size) { - MSG(0, "\tError: Cannot set the sector size to:" - " %d as the device does not support" - "\nSetting the sector size to : %d\n", - c->sector_size, sector_size); c->sector_size = sector_size; c->sectors_per_blk = PAGE_SIZE / sector_size; } @@ -495,16 +491,16 @@ int f2fs_get_device_info(struct f2fs_configuration *c) return -1; } if (wanted_total_sectors && wanted_total_sectors < c->total_sectors) { - MSG(0, "Info: total device sectors = %"PRIu64" (in 512bytes)\n", - c->total_sectors); + MSG(0, "Info: total device sectors = %"PRIu64" (in %u bytes)\n", + c->total_sectors, c->sector_size); c->total_sectors = wanted_total_sectors; } MSG(0, "Info: sector size = %u\n", c->sector_size); - MSG(0, "Info: total sectors = %"PRIu64" (in 512bytes)\n", - c->total_sectors); + MSG(0, "Info: total sectors = %"PRIu64" (in %u bytes)\n", + c->total_sectors, c->sector_size); if (c->total_sectors < - (F2FS_MIN_VOLUME_SIZE / DEFAULT_SECTOR_SIZE)) { + (F2FS_MIN_VOLUME_SIZE / c->sector_size)) { MSG(0, "Error: Min volume size supported is %d\n", F2FS_MIN_VOLUME_SIZE); return -1; |