* [PATCH 2/3] mke2fs: add get_uint_from_profile to mke2fs.c
@ 2014-06-11 8:37 Akira Fujita
2014-07-06 2:35 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Akira Fujita @ 2014-06-11 8:37 UTC (permalink / raw)
To: Theodore Tso; +Cc: Ext4 Developers List
We can set flex_bg count only up to 2^30 with profile
because get_int_from_profile can handle it to 2^31-1.
Add get_uint_from_profile to read unsigned int value
so that mke2fs with profile can handle up to 2^31 flex_bg same as -G option.
Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
---
misc/mke2fs.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index b9145d1..88dc76c 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1343,6 +1343,18 @@ int get_int_from_profile(char **types, const char *opt, int def_val)
return ret;
}
+static unsigned int get_uint_from_profile(char **types, const char *opt,
+ unsigned int def_val)
+{
+ unsigned int ret;
+ char **cpp;
+
+ profile_get_uint(profile, "defaults", opt, 0, def_val, &ret);
+ for (cpp = types; *cpp; cpp++)
+ profile_get_uint(profile, "fs_types", *cpp, opt, ret, &ret);
+ return ret;
+}
+
static double get_double_from_profile(char **types, const char *opt,
double def_val)
{
@@ -2278,7 +2290,7 @@ profile_error:
inode_size = get_int_from_profile(fs_types, "inode_size", 0);
if (!flex_bg_size && (fs_param.s_feature_incompat &
EXT4_FEATURE_INCOMPAT_FLEX_BG))
- flex_bg_size = get_int_from_profile(fs_types,
+ flex_bg_size = get_uint_from_profile(fs_types,
"flex_bg_size", 16);
if (flex_bg_size) {
if (!(fs_param.s_feature_incompat &
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] mke2fs: add get_uint_from_profile to mke2fs.c
2014-06-11 8:37 [PATCH 2/3] mke2fs: add get_uint_from_profile to mke2fs.c Akira Fujita
@ 2014-07-06 2:35 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-07-06 2:35 UTC (permalink / raw)
To: Akira Fujita; +Cc: Ext4 Developers List
On Wed, Jun 11, 2014 at 08:37:54AM +0000, Akira Fujita wrote:
> We can set flex_bg count only up to 2^30 with profile
> because get_int_from_profile can handle it to 2^31-1.
> Add get_uint_from_profile to read unsigned int value
> so that mke2fs with profile can handle up to 2^31 flex_bg same as -G option.
>
> Signed-off-by: Akira Fujita <a-fujita@rs.jp.nec.com>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-06 2:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-11 8:37 [PATCH 2/3] mke2fs: add get_uint_from_profile to mke2fs.c Akira Fujita
2014-07-06 2:35 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).