Skip to content

Commit 08be82b

Browse files
GUO Zihuaamschuma-ntap
authored andcommitted
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>
1 parent e87cf8a commit 08be82b

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

fs/nfs/dns_resolve.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
* Resolves DNS hostnames into valid ip addresses
88
*/
99

10-
#ifdef CONFIG_NFS_USE_KERNEL_DNS
11-
1210
#include <linux/module.h>
1311
#include <linux/sunrpc/clnt.h>
1412
#include <linux/sunrpc/addr.h>
15-
#include <linux/dns_resolver.h>
13+
1614
#include "dns_resolve.h"
1715

16+
#ifdef CONFIG_NFS_USE_KERNEL_DNS
17+
18+
#include <linux/dns_resolver.h>
19+
1820
ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
1921
struct sockaddr_storage *ss, size_t salen)
2022
{
@@ -35,23 +37,19 @@ ssize_t nfs_dns_resolve_name(struct net *net, char *name, size_t namelen,
3537

3638
#else
3739

38-
#include <linux/module.h>
3940
#include <linux/hash.h>
4041
#include <linux/string.h>
4142
#include <linux/kmod.h>
4243
#include <linux/slab.h>
4344
#include <linux/socket.h>
4445
#include <linux/seq_file.h>
4546
#include <linux/inet.h>
46-
#include <linux/sunrpc/clnt.h>
47-
#include <linux/sunrpc/addr.h>
4847
#include <linux/sunrpc/cache.h>
4948
#include <linux/sunrpc/svcauth.h>
5049
#include <linux/sunrpc/rpc_pipe_fs.h>
5150
#include <linux/nfs_fs.h>
5251

5352
#include "nfs4_fs.h"
54-
#include "dns_resolve.h"
5553
#include "cache_lib.h"
5654
#include "netns.h"
5755

0 commit comments

Comments
 (0)