From patchwork Thu Aug 12 15:18:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 119274 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7CFImRR008513 for ; Thu, 12 Aug 2010 15:18:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933774Ab0HLPSl (ORCPT ); Thu, 12 Aug 2010 11:18:41 -0400 Received: from mx2.netapp.com ([216.240.18.37]:5639 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933766Ab0HLPSk (ORCPT ); Thu, 12 Aug 2010 11:18:40 -0400 X-IronPort-AV: E=Sophos;i="4.55,358,1278313200"; d="scan'208";a="427213023" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 12 Aug 2010 08:18:12 -0700 Received: from [10.58.50.35] (debk2-lxp.hq.netapp.com [10.58.50.35]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id o7CFIA41007217; Thu, 12 Aug 2010 08:18:11 -0700 (PDT) Message-ID: <4C6410D4.6050100@netapp.com> Date: Thu, 12 Aug 2010 11:18:44 -0400 From: Bryan Schumaker User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Lightning/1.0b2 Lanikai/3.1.2 ThunderBrowse/3.3.1 MIME-Version: 1.0 To: Stephen Rothwell CC: Steve French , linux-cifs@vger.kernel.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Lei , David Howells Subject: Re: linux-next: build failure after merge of the cifs tree References: <20100812131741.f3a800d7.sfr@canb.auug.org.au> <20100812174621.b1dbc20f.sfr@canb.auug.org.au> In-Reply-To: <20100812174621.b1dbc20f.sfr@canb.auug.org.au> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 12 Aug 2010 15:18:48 +0000 (UTC) diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig index cc1bb33..c5bbdca 100644 --- a/fs/nfs/Kconfig +++ b/fs/nfs/Kconfig @@ -100,3 +100,19 @@ config NFS_FSCACHE help Say Y here if you want NFS data to be cached locally on disc through the general filesystem cache manager + +config NFS_USE_LEGACY_DNS + bool "Use the legacy NFS DNS resolver" + depends on NFS_V4 + help + The kernel now provides a method for translating a host name into an + IP address. Select Y here if you would rather use your own DNS + resolver script. + + If unsure, say N + +config NFS_USE_KERNEL_DNS + bool + depends on NFS_V4 && !NFS_USE_LEGACY_DNS + select DNS_RESOLVER + select KEYS + default y diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c index 76fd235..dba50a5 100644 --- a/fs/nfs/dns_resolve.c +++ b/fs/nfs/dns_resolve.c @@ -6,6 +6,29 @@ * Resolves DNS hostnames into valid ip addresses */ +#ifdef CONFIG_NFS_USE_KERNEL_DNS + +#include +#include + +ssize_t nfs_dns_resolve_name(char *name, size_t namelen, + struct sockaddr *sa, size_t salen) +{ + ssize_t ret; + char *ip_addr = NULL; + int ip_len; + + ip_len = dns_query(NULL, name, namelen, NULL, &ip_addr, NULL); + if (ip_len > 0) + ret = rpc_pton(ip_addr, ip_len, sa, salen); + else + ret = -ESRCH; + kfree(ip_addr); + return ret; +} + +#else + #include #include #include @@ -346,3 +369,4 @@ void nfs_dns_resolver_destroy(void) nfs_cache_unregister(&nfs_dns_resolve); } +#endif diff --git a/fs/nfs/dns_resolve.h b/fs/nfs/dns_resolve.h index a3f0938..199bb55 100644 --- a/fs/nfs/dns_resolve.h +++ b/fs/nfs/dns_resolve.h @@ -6,8 +6,20 @@ #define NFS_DNS_HOSTNAME_MAXLEN (128) + +#ifdef CONFIG_NFS_USE_KERNEL_DNS +static inline int nfs_dns_resolver_init(void) +{ + return 0; +} + +static inline void nfs_dns_resolver_destroy(void) +{} +#else extern int nfs_dns_resolver_init(void); extern void nfs_dns_resolver_destroy(void); +#endif + extern ssize_t nfs_dns_resolve_name(char *name, size_t namelen, struct sockaddr *sa, size_t salen);