mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: [NFS] Set CONFIG_KEYS when CONFIG_NFS_USE_KERNEL_DNS is set AFS: Implement an autocell mount capability [ver #2] DNS: If the DNS server returns an error, allow that to be cached [ver #2] NFS: Use kernel DNS resolver [ver #2] cifs: update README to include details about 'fsc' option
This commit is contained in:
commit
2897c684d1
13 changed files with 409 additions and 51 deletions
|
|
@ -100,3 +100,20 @@ 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
|
||||
|
|
|
|||
|
|
@ -6,6 +6,29 @@
|
|||
* Resolves DNS hostnames into valid ip addresses
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NFS_USE_KERNEL_DNS
|
||||
|
||||
#include <linux/sunrpc/clnt.h>
|
||||
#include <linux/dns_resolver.h>
|
||||
|
||||
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 <linux/hash.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/kmod.h>
|
||||
|
|
@ -346,3 +369,4 @@ void nfs_dns_resolver_destroy(void)
|
|||
nfs_cache_unregister(&nfs_dns_resolve);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue