From patchwork Mon Nov 4 10:55:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 11225413 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AF341709 for ; Mon, 4 Nov 2019 10:55:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72ADC21D7D for ; Mon, 4 Nov 2019 10:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727985AbfKDKz0 (ORCPT ); Mon, 4 Nov 2019 05:55:26 -0500 Received: from icp-osb-irony-out4.external.iinet.net.au ([203.59.1.220]:34019 "EHLO icp-osb-irony-out4.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728310AbfKDKz0 (ORCPT ); Mon, 4 Nov 2019 05:55:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AKAAC6AsBd/xK90HYNWRsBAQEBAQEBBQEBAREBAQMDAQEBgWoFAQEBCwGBc4JJhCmPWAEBAQEBAQaBEYoJhTGKFoF7CQEBAQEBAQEBATcBAYQ7AwIChDA1CA4CDgEBAQQBAQEBAQUDAYVYhioCAQMjBFIQGA0CJgICRxAGE4V1sGJ1fzMaijOBDigBgWSKRniBB4ERM4Mdh1WCXgSMcIJTN4ZAQ5Z1gi6VUQyOKAOLLqoVA4IMTS4KgydQhFIBAo0pZ45tAQE X-IPAS-Result: A2AKAAC6AsBd/xK90HYNWRsBAQEBAQEBBQEBAREBAQMDAQEBgWoFAQEBCwGBc4JJhCmPWAEBAQEBAQaBEYoJhTGKFoF7CQEBAQEBAQEBATcBAYQ7AwIChDA1CA4CDgEBAQQBAQEBAQUDAYVYhioCAQMjBFIQGA0CJgICRxAGE4V1sGJ1fzMaijOBDigBgWSKRniBB4ERM4Mdh1WCXgSMcIJTN4ZAQ5Z1gi6VUQyOKAOLLqoVA4IMTS4KgydQhFIBAo0pZ45tAQE X-IronPort-AV: E=Sophos;i="5.68,266,1569254400"; d="scan'208";a="207138674" Received: from unknown (HELO [192.168.1.222]) ([118.208.189.18]) by icp-osb-irony-out4.iinet.net.au with ESMTP; 04 Nov 2019 18:55:23 +0800 Subject: [PATCH v9 09/17] xfs: avoid redundant checks when options is empty From: Ian Kent To: linux-xfs Cc: Christoph Hellwig , "Darrick J. Wong" , Brian Foster , Eric Sandeen , David Howells , Dave Chinner , Al Viro Date: Mon, 04 Nov 2019 18:55:23 +0800 Message-ID: <157286492330.18393.10252610238010972274.stgit@fedora-28> In-Reply-To: <157286480109.18393.6285224459642752559.stgit@fedora-28> References: <157286480109.18393.6285224459642752559.stgit@fedora-28> User-Agent: StGit/unknown-version MIME-Version: 1.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org When options passed to xfs_parseargs() is NULL the checks performed after taking the branch are made with the initial values of dsunit, dswidth and iosizelog. But all the checks do nothing in this case so return immediately instead. Signed-off-by: Ian Kent Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 0dc072700599..17188a9ed541 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -199,7 +199,7 @@ xfs_parseargs( mp->m_allocsize_log = 16; /* 64k */ if (!options) - goto done; + return 0; while ((p = strsep(&options, ",")) != NULL) { int token; @@ -379,7 +379,6 @@ xfs_parseargs( return -EINVAL; } -done: if (mp->m_logbufs != -1 && mp->m_logbufs != 0 && (mp->m_logbufs < XLOG_MIN_ICLOGS ||