From patchwork Wed Mar 15 16:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 9626043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 47C02604CC for ; Wed, 15 Mar 2017 16:02:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 385E328452 for ; Wed, 15 Mar 2017 16:02:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AC89285AA; Wed, 15 Mar 2017 16:02:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E947A28452 for ; Wed, 15 Mar 2017 16:02:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753910AbdCOQBd (ORCPT ); Wed, 15 Mar 2017 12:01:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59854 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754055AbdCOQBA (ORCPT ); Wed, 15 Mar 2017 12:01:00 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32F388124B for ; Wed, 15 Mar 2017 16:01:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 32F388124B Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jtulak@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 32F388124B Received: from honza-mbp.redhat.com (ovpn-204-198.brq.redhat.com [10.40.204.198]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v2FG0b8d031509; Wed, 15 Mar 2017 12:00:59 -0400 From: Jan Tulak To: linux-xfs@vger.kernel.org Cc: Jan Tulak Subject: [PATCH 19/22] mkfs: subopt flags should be saved as bool Date: Wed, 15 Mar 2017 17:00:14 +0100 Message-Id: <20170315160017.27805-20-jtulak@redhat.com> In-Reply-To: <20170315160017.27805-1-jtulak@redhat.com> References: <20170315160017.27805-1-jtulak@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 15 Mar 2017 16:01:00 +0000 (UTC) Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Flag suboptions are not united in what data type they use internally. Unify them as boolean. Signed-off-by: Jan Tulak --- mkfs/xfs_mkfs.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 767aeeea..914af9d3 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -664,10 +664,10 @@ struct opt_params { }, { .index = D_RTINHERIT, .conflicts = { {LAST_CONFLICT} }, - .minval.u = 1, - .maxval.u = 1, - .flagval.u = 1, - .type = UINT, + .minval.b = false, + .maxval.b = true, + .flagval.b = true, + .type = BOOL, }, { .index = D_PROJINHERIT, .conflicts = { {LAST_CONFLICT} }, @@ -804,10 +804,10 @@ struct opt_params { .message = \ "Sparse inodes not supported without CRC support."}, {LAST_CONFLICT} }, - .minval.i = 0, - .maxval.i = 1, - .flagval.i = 1, - .type = INT, + .minval.b = false, + .maxval.b = true, + .flagval.b = true, + .type = BOOL, }, }, }, @@ -936,10 +936,10 @@ struct opt_params { .subopt = L_INTERNAL, }, {LAST_CONFLICT} }, - .minval.i = 0, - .maxval.i = 1, - .flagval.i = 1, - .type = INT, + .minval.b = false, + .maxval.b = true, + .flagval.b = true, + .type = BOOL, }, { .index = L_NAME, .conflicts = { {.opt = OPT_L, @@ -1069,10 +1069,10 @@ struct opt_params { .type = STRING, }, { .index = R_FILE, - .minval.i = 0, - .maxval.i = 1, - .flagval.i = 1, - .type = INT, + .minval.b = false, + .maxval.b = true, + .flagval.b = true, + .type = BOOL, .conflicts = { {LAST_CONFLICT} }, }, { .index = R_NAME, @@ -1089,10 +1089,10 @@ struct opt_params { .type = STRING, }, { .index = R_NOALIGN, - .minval.i = 0, - .maxval.i = 1, - .flagval.i = 1, - .type = INT, + .minval.b = false, + .maxval.b = true, + .flagval.b = true, + .type = BOOL, .conflicts = { {LAST_CONFLICT} }, }, }, @@ -2202,7 +2202,7 @@ main( xfs_extlen_t nbmblocks; int nlflag; int *nodsflag; - int *norsflag; + bool *norsflag; xfs_alloc_rec_t *nrec; int nsflag; int nvflag; @@ -2265,7 +2265,7 @@ main( dsu = &opts[OPT_D].subopt_params[D_SU].value.i; dsw = &opts[OPT_D].subopt_params[D_SW].value.i; nodsflag = &opts[OPT_D].subopt_params[D_NOALIGN].value.i; - norsflag = &opts[OPT_R].subopt_params[R_NOALIGN].value.i; + norsflag = &opts[OPT_R].subopt_params[R_NOALIGN].value.b; logagno = &opts[OPT_L].subopt_params[L_AGNUM].value.u; lsu = &opts[OPT_L].subopt_params[L_SU].value.i; lsunit = &opts[OPT_L].subopt_params[L_SUNIT].value.i; @@ -2400,7 +2400,7 @@ main( if (c) fsx.fsx_xflags |= XFS_DIFLAG_RTINHERIT; - opts[OPT_D].subopt_params[D_RTINHERIT].value.u = c; + opts[OPT_D].subopt_params[D_RTINHERIT].value.b = c; break; case D_PROJINHERIT: fsx.fsx_projid = getnum(value, &opts[OPT_D], @@ -2736,15 +2736,15 @@ main( opts[OPT_D].subopt_params[D_FILE].value.i = xi.disfile; opts[OPT_D].subopt_params[D_PROJINHERIT].value.u = fsx.fsx_projid; opts[OPT_D].subopt_params[D_EXTSZINHERIT].value.u = fsx.fsx_extsize; - opts[OPT_L].subopt_params[L_FILE].value.i = xi.lisfile; + opts[OPT_L].subopt_params[L_FILE].value.b = xi.lisfile; opts[OPT_L].subopt_params[L_VERSION].value.i = sb_feat.log_version; opts[OPT_L].subopt_params[L_LAZYSBCNTR].value.b = sb_feat.lazy_sb_counters; opts[OPT_I].subopt_params[I_ATTR].value.i = sb_feat.attr_version ; opts[OPT_I].subopt_params[I_PROJID32BIT].value.b = !sb_feat.projid16bit ; - opts[OPT_I].subopt_params[I_SPINODES].value.i = sb_feat.spinodes ; + opts[OPT_I].subopt_params[I_SPINODES].value.b = sb_feat.spinodes ; opts[OPT_M].subopt_params[M_FINOBT].value.i = sb_feat.finobt ; opts[OPT_M].subopt_params[M_RMAPBT].value.b = sb_feat.rmapbt ; - opts[OPT_R].subopt_params[R_FILE].value.i = xi.risfile ; + opts[OPT_R].subopt_params[R_FILE].value.b = xi.risfile ; opts[OPT_R].subopt_params[R_NAME].value.s = xi.rtname; opts[OPT_R].subopt_params[R_DEV].value.s = xi.rtname; opts[OPT_S].subopt_params[S_LOG].value.u = sectorsize;