Skip to contentSkip to conversation

In mke2fs, accept a human readable size as input to the 'bytes-per-inode' argument.

PATCH Applied Matthieu Dupont 2 participants 2 messages Nov 15, 2015 – Nov 16, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 In mke2fs, accept a human readable size as input to the 'bytes-per-inode' argument.

---
 misc/mke2fs.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
misc/mke2fs.c +2 -3
index 179a4d1..8d61212 100644
@@ -1646,10 +1646,9 @@ profile_error:
 			}
 			break;
 		case 'i':
-			inode_ratio = strtoul(optarg, &tmp, 0);
+			inode_ratio = parse_num_blocks(optarg, -1);
 			if (inode_ratio < EXT2_MIN_BLOCK_SIZE ||
-			    inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024 ||
-			    *tmp) {
+			    inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024) {
 				com_err(program_name, 0,
 					_("invalid inode ratio %s (min %d/max %d)"),
 					optarg, EXT2_MIN_BLOCK_SIZE,
Signature · 1 line
1.9.1