From: Bharath Vedartham <linux.bhar@gmail.com>
To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] nfs/dns_resolve.c: Move redundant headers to the top
Date: Sat, 11 May 2019 15:02:28 +0530 [thread overview]
Message-ID: <20190511093228.GA8757@bharath12345-Inspiron-5559> (raw)
NFS uses either the kernel's DNS service or its own depending on whether
CONFIG_NFS_USE_KERNEL_DNS is enabled or not.
4 header files which are:
(i) #include <linux/module.h>
(ii) #include <linux/sunrpc/clnt.h>
(iii) #include <linux/sunrpc/addr.h>
(iv) #include "dns_resolve.h"
These 4 header files are used regardless of whether
CONFIG_NFS_USE_KERNEL_DNS is enabled or not. But they have been included
under #ifdef CONFIG_NFS_USE_KERNEL_DNS and also the #else section(if
CONFIG_NFS_USE_KERNEL_DNS is not enabled).
Move these redundant headers to the top of the file i.e include them
before #ifdef CONFIG_NFS_USE_KERNEL_DNS.
Tested by compiling the kernel and also running
./scripts/checkincludes.pl on fs/nfs/dns_resolve.c
Signed-off-by: Bharath Vedartham <linux.bhar@gmail.com>
---
fs/nfs/dns_resolve.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index a7d3df8..b34e575 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -7,14 +7,15 @@
* Resolves DNS hostnames into valid ip addresses
*/
-#ifdef CONFIG_NFS_USE_KERNEL_DNS
-
#include <linux/module.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/addr.h>
-#include <linux/dns_resolver.h>
#include "dns_resolve.h"
+#ifdef CONFIG_NFS_USE_KERNEL_DNS
+
+#include <linux/dns_resolver.h>
+
ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
struct sockaddr *sa, size_t salen)
{
@@ -33,24 +34,19 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
#else
-#include <linux/module.h>
#include <linux/hash.h>
#include <linux/string.h>
#include <linux/kmod.h>
#include <linux/slab.h>
-#include <linux/module.h>
#include <linux/socket.h>
#include <linux/seq_file.h>
#include <linux/inet.h>
-#include <linux/sunrpc/clnt.h>
-#include <linux/sunrpc/addr.h>
#include <linux/sunrpc/cache.h>
#include <linux/sunrpc/svcauth.h>
#include <linux/sunrpc/rpc_pipe_fs.h>
#include <linux/nfs_fs.h>
#include "nfs4_fs.h"
-#include "dns_resolve.h"
#include "cache_lib.h"
#include "netns.h"
--
2.7.4
reply other threads:[~2019-05-11 9:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190511093228.GA8757@bharath12345-Inspiron-5559 \
--to=linux.bhar@gmail.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).