From patchwork Sun Apr 23 18:54:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Tulak X-Patchwork-Id: 9695231 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 CDDF3601E9 for ; Sun, 23 Apr 2017 18:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2F8C26490 for ; Sun, 23 Apr 2017 18:55:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8025267EC; Sun, 23 Apr 2017 18:55:16 +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 7376F26490 for ; Sun, 23 Apr 2017 18:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163227AbdDWSzP (ORCPT ); Sun, 23 Apr 2017 14:55:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49202 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163236AbdDWSzO (ORCPT ); Sun, 23 Apr 2017 14:55:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 991F48124F for ; Sun, 23 Apr 2017 18:55:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 991F48124F 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 991F48124F Received: from honza-mbp.redhat.com (ovpn-204-62.brq.redhat.com [10.40.204.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id D51431F8; Sun, 23 Apr 2017 18:55:12 +0000 (UTC) From: Jan Tulak To: linux-xfs@vger.kernel.org Cc: Jan Tulak Subject: [PATCH 05/12] mkfs: extend opt_params with a value field Date: Sun, 23 Apr 2017 20:54:56 +0200 Message-Id: <20170423185503.31415-6-jtulak@redhat.com> In-Reply-To: <20170423185503.31415-1-jtulak@redhat.com> References: <20170423185503.31415-1-jtulak@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 23 Apr 2017 18:55:13 +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 Add a new field int opt_params - value, which is filled with user input. Signed-off-by: Jan Tulak --- mkfs/xfs_mkfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 513e106..c2ffd91 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -128,6 +128,12 @@ uint64_t sectorsize; * Filled raw string from the user, so we never lose that information e.g. * to print it back in case of an issue. * + * value OPTIONAL + * The value that is to be used if the given subopt is not specified at all. + * This is filled with user input and anything you write here now is + * overwritten if user specifies the subopt. (If the user input is a string + * and not a number, this value is set to a positive non-zero number.) + * * !!! NOTE ================================================================== * * If you are adding a new option, or changing an existing one, @@ -152,6 +158,7 @@ struct opt_params { uint64_t maxval; uint64_t flagval; const char *raw_input; + uint64_t value; } subopt_params[MAX_SUBOPTS]; } opts[MAX_OPTS] = { #define OPT_B 0