Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp2536421rdb; Fri, 18 Aug 2023 03:30:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEblGyhx54hRZiJVE5I/nVvspYL7850GFqfOJZe7glcOIGS3kEe2Do4np8tUxU2F94jP1M1 X-Received: by 2002:a05:6a00:1349:b0:687:404f:4d60 with SMTP id k9-20020a056a00134900b00687404f4d60mr2779648pfu.32.1692354647468; Fri, 18 Aug 2023 03:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692354647; cv=none; d=google.com; s=arc-20160816; b=AwM72hNAMUV1G3U+88j1dvHxpuDA1HFNJjjW8+sNuASIZoIOrg7+zdQSRh/5CErloe XyfmJ/Nsi5O8+SJUjBEUwsbMAKEuM4pKvuCFVPQNH8SBjyu9dlCo2aflMePe8BTswJWb 0kl8Lj7EPFJ2w+jngo/idDp37XJc7ivbxbl0cB6XTjd2XmozijQHuubYL4gzJKq/ykok gcVykZSlqCOkukR1sCewZFotiQ3mX5uuipS8UpXVC6MbyUEnD0xQjyalVoDr7lOuVU1Y msBWCnhR4ogEwHChSl6kZEljYHPuVHRRDVn5fH6IJZBLw1ReQz+Q4hKMD6+tEQK0L2U6 iCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=3rIWCgUgiLwiuWHTqAVfbPionh9pBnq1MqTaHxiZUw4=; fh=kyes4CAHC11GxktuhPbuQpp/73M19B4rafLY3R/ThWk=; b=cGvYtk+Q6JrPnYUAhB+k83U5jnDxQYJoLkwAvtjWNGY5kSKsShn4n8Fgv2RiP39z+N TpQmQBtimLKTG0ZaSGbLkFHjYDWqvbXFqkLhLyF7WAfY00uiGJfkzKA8pZ3IXf47H9sT lYx+CcWhVsx1BhcRQ3JWpQ76vN037z6zeNJLAMjHt150WjEy2+Cl4dsC4csW8lzB6QMX SRzbF/FLOaVMEfc5g6eEttoUL3MOSmro68pi328iVtHwB2UlJbxtN3W1zw3ALxx3TRz5 PG/ZOwGU7w5wl9ZKyzFHlpto+5Pwg4gOEtDJdXCPuIFuu5EIpWlh7uH3BCU5HnfNw9tm aPIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cg26-20020a056a00291a00b00677429ef6b0si1264787pfb.13.2023.08.18.03.30.29; Fri, 18 Aug 2023 03:30:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357691AbjHRDdM (ORCPT + 99 others); Thu, 17 Aug 2023 23:33:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357765AbjHRDdB (ORCPT ); Thu, 17 Aug 2023 23:33:01 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06A932711 for ; Thu, 17 Aug 2023 20:32:28 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RRnPW65DfztS3t; Fri, 18 Aug 2023 11:27:43 +0800 (CST) Received: from huawei.com (10.67.175.31) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 18 Aug 2023 11:31:22 +0800 From: GUO Zihua To: , CC: Subject: [PATCH -next] NFS: Move common includes outside ifdef Date: Fri, 18 Aug 2023 11:31:02 +0800 Message-ID: <20230818033102.7756-1-guozihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.31] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500024.china.huawei.com (7.185.36.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org module.h, clnt.h, addr.h and dns_resolve.h is always included whether CONFIG_NFS_USE_KERNEL_DNS is set or not and their order does not seems to matter. Move them outside the ifdef to simplify code and avoid checkincludes message. Signed-off-by: GUO Zihua --- fs/nfs/dns_resolve.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 6603b5cee029..714975e5c0db 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -7,14 +7,16 @@ * Resolves DNS hostnames into valid ip addresses */ -#ifdef CONFIG_NFS_USE_KERNEL_DNS - #include #include #include -#include + #include "dns_resolve.h" +#ifdef CONFIG_NFS_USE_KERNEL_DNS + +#include + ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, struct sockaddr_storage *ss, size_t salen) { @@ -35,7 +37,6 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, #else -#include #include #include #include @@ -43,15 +44,12 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, #include #include #include -#include -#include #include #include #include #include #include "nfs4_fs.h" -#include "dns_resolve.h" #include "cache_lib.h" #include "netns.h" -- 2.17.1