Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Move common includes outside ifdef

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 <guozihua@huawei.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>

authored by

GUO Zihua and committed by
Anna Schumaker
08be82ba e87cf8a2

+5 -7
+5 -7
fs/nfs/dns_resolve.c
··· 7 7 * Resolves DNS hostnames into valid ip addresses 8 8 */ 9 9 10 - #ifdef CONFIG_NFS_USE_KERNEL_DNS 11 - 12 10 #include <linux/module.h> 13 11 #include <linux/sunrpc/clnt.h> 14 12 #include <linux/sunrpc/addr.h> 15 - #include <linux/dns_resolver.h> 13 + 16 14 #include "dns_resolve.h" 15 + 16 + #ifdef CONFIG_NFS_USE_KERNEL_DNS 17 + 18 + #include <linux/dns_resolver.h> 17 19 18 20 ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen, 19 21 struct sockaddr_storage *ss, size_t salen) ··· 37 35 38 36 #else 39 37 40 - #include <linux/module.h> 41 38 #include <linux/hash.h> 42 39 #include <linux/string.h> 43 40 #include <linux/kmod.h> ··· 44 43 #include <linux/socket.h> 45 44 #include <linux/seq_file.h> 46 45 #include <linux/inet.h> 47 - #include <linux/sunrpc/clnt.h> 48 - #include <linux/sunrpc/addr.h> 49 46 #include <linux/sunrpc/cache.h> 50 47 #include <linux/sunrpc/svcauth.h> 51 48 #include <linux/sunrpc/rpc_pipe_fs.h> 52 49 #include <linux/nfs_fs.h> 53 50 54 51 #include "nfs4_fs.h" 55 - #include "dns_resolve.h" 56 52 #include "cache_lib.h" 57 53 #include "netns.h" 58 54