From: Dave Chinner <dchinner@xxxxxxxxxx> Signed-Off-By: Dave Chinner <dchinner@xxxxxxxxxx> --- mkfs/xfs_mkfs.c | 61 ++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 8e42fe0301fb..7b967ffe6893 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1659,6 +1659,30 @@ meta_opts_parser( char *value, struct cli_params *cli) { + switch (subopt) { + case M_CRC: + cli->sb_feat.crcs_enabled = getnum(value, &mopts, M_CRC); + if (cli->sb_feat.crcs_enabled) + cli->sb_feat.dirftype = true; + break; + case M_FINOBT: + cli->sb_feat.finobt = getnum(value, &mopts, M_FINOBT); + break; + case M_UUID: + if (!value || *value == '\0') + reqval('m', opts->subopts, M_UUID); + if (platform_uuid_parse(value, &cli->uuid)) + illegal(value, "m uuid"); + break; + case M_RMAPBT: + cli->sb_feat.rmapbt = getnum(value, &mopts, M_RMAPBT); + break; + case M_REFLINK: + cli->sb_feat.reflink = getnum(value, &mopts, M_REFLINK); + break; + default: + return -EINVAL; + } return 0; } @@ -1984,40 +2008,11 @@ main( label = optarg; break; case 'm': - p = optarg; - while (*p != '\0') { - char **subopts = (char **)mopts.subopts; - char *value; + parse_subopts(c, optarg, &cli); - switch (getsubopt(&p, subopts, &value)) { - case M_CRC: - sb_feat.crcs_enabled = - getnum(value, &mopts, M_CRC); - if (sb_feat.crcs_enabled) - sb_feat.dirftype = true; - break; - case M_FINOBT: - sb_feat.finobt = getnum( - value, &mopts, M_FINOBT); - break; - case M_UUID: - if (!value || *value == '\0') - reqval('m', (const char **)subopts, M_UUID); - if (platform_uuid_parse(value, &uuid)) - illegal(optarg, "m uuid"); - break; - case M_RMAPBT: - sb_feat.rmapbt = getnum( - value, &mopts, M_RMAPBT); - break; - case M_REFLINK: - sb_feat.reflink = getnum( - value, &mopts, M_REFLINK); - break; - default: - unknown('m', value); - } - } + /* temp don't break code */ + platform_uuid_copy(&uuid, &cli.uuid); + /* end temp don't break code */ break; case 'n': p = optarg; -- 2.13.3 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html