From patchwork Thu Jun 7 23:55:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 10453669 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 A45EC60375 for ; Thu, 7 Jun 2018 23:55:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E99D29047 for ; Thu, 7 Jun 2018 23:55:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E8E929329; Thu, 7 Jun 2018 23:55:38 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 09A9529047 for ; Thu, 7 Jun 2018 23:55:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752301AbeFGXzg (ORCPT ); Thu, 7 Jun 2018 19:55:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:41916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260AbeFGXzg (ORCPT ); Thu, 7 Jun 2018 19:55:36 -0400 Received: from garbanzo.do-not-panic.com (c-73-15-241-2.hsd1.ca.comcast.net [73.15.241.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 475652089E; Thu, 7 Jun 2018 23:55:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528415735; bh=GIn/PRDziUrc37H18pm2NebjUsGsaD7eA3ldBJZAfT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9J/ipjWueahJoKLAKG82KNHP5VRRqXS2U5oOQGW5EHo0bikVixxsM5W6l9bElD4i PBwSj6eiAFxCq9c/M/ckgR7w7zhoaR4EgUk856pcseZvqTKK9hAnIXnngRlQn7uzF9 z5m+YGOCMQQ5eDVihfvgLJMR27y/tV2r538ThjUI= From: "Luis R. Rodriguez" To: sandeen@sandeen.net, linux-xfs@vger.kernel.org Cc: darrick.wong@oracle.com, jack@suse.com, jeffm@suse.com, okurz@suse.com, lpechacek@suse.com, jtulak@redhat.com, "Luis R. Rodriguez" Subject: [PATCH v5 1/4] mkfs: distinguish between struct sb_feat_args and struct cli_params Date: Thu, 7 Jun 2018 16:55:30 -0700 Message-Id: <20180607235533.20391-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180607235533.20391-1-mcgrof@kernel.org> References: <20180607235533.20391-1-mcgrof@kernel.org> 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 The struct sb_feat_args will actually be shared between the code which processes command line options and the configuration file, as such we need to clarify and reflect this clearly in documentation. Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Luis R. Rodriguez --- mkfs/xfs_mkfs.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index a135e06e7215..227613ef77d5 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -707,26 +707,18 @@ cli_opt_set( } /* - * Options configured on the command line. - * - * This stores all the specific config parameters the user sets on the command - * line. We do not use these values directly - they are inputs to the mkfs - * geometry validation and override any default configuration value we have. + * Shared superblock configuration options * - * We don't keep flags to indicate what parameters are set - if we need to check - * if an option was set on the command line, we check the relevant entry in the - * option table which records whether it was specified in the .seen and - * .str_seen variables in the table. + * These options provide shared configuration tunables for the filesystem + * superblock. There are three possible sources for these options set, each + * source can overriding the later source: * - * Some parameters are stored as strings for post-parsing after their dependent - * options have been resolved (e.g. block size and sector size have been parsed - * and validated). + * o built-in defaults + * o configuration file (XXX) + * o command line * - * This allows us to check that values have been set without needing separate - * flags for each value, and hence avoids needing to record and check for each - * specific option that can set the value later on in the code. In the cases - * where we don't have a cli_params structure around, the above cli_opt_set() - * function can be used. + * These values are not used directly - they are inputs into the mkfs geometry + * validation. */ struct sb_feat_args { int log_version; @@ -747,6 +739,25 @@ struct sb_feat_args { bool nortalign; }; +/* + * Options configured on the command line. + * + * This stores all the specific config parameters the user sets on the command + * line. We don't keep flags to indicate what parameters are set - if we need + * to check if an option was set on the command line, we check the relevant + * entry in the option table which records whether it was specified in the + * .seen and .str_seen variables in the table. + * + * Some parameters are stored as strings for post-parsing after their dependent + * options have been resolved (e.g. block size and sector size have been parsed + * and validated). + * + * This allows us to check that values have been set without needing separate + * flags for each value, and hence avoids needing to record and check for each + * specific option that can set the value later on in the code. In the cases + * where we don't have a cli_params structure around, the function cli_opt_set() + * function can be used. + */ struct cli_params { int sectorsize; int blocksize;