aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorWang Lei <wang840925@gmail.com>2010-08-04 10:16:33 -0400
committerSteve French <sfrench@us.ibm.com>2010-08-05 13:17:51 -0400
commit1a4240f4764ac78adbf4b0ebb49b3bd8c72ffa11 (patch)
tree7d9de5b071e7ab8a8355bdf7902db4c0a0e812b1 /fs/cifs/cifsfs.c
parentba5dadbf4e7b531bd7ccecffb4d3935c80a3372e (diff)
DNS: Separate out CIFS DNS Resolver code
Separate out the DNS resolver key type from the CIFS filesystem into its own module so that it can be made available for general use, including the AFS filesystem module. This facility makes it possible for the kernel to upcall to userspace to have it issue DNS requests, package up the replies and present them to the kernel in a useful form. The kernel is then able to cache the DNS replies as keys can be retained in keyrings. Resolver keys are of type "dns_resolver" and have a case-insensitive description that is of the form "[<type>:]<domain_name>". The optional <type> indicates the particular DNS lookup and packaging that's required. The <domain_name> is the query to be made. If <type> isn't given, a basic hostname to IP address lookup is made, and the result is stored in the key in the form of a printable string consisting of a comma-separated list of IPv4 and IPv6 addresses. This key type is supported by userspace helpers driven from /sbin/request-key and configured through /etc/request-key.conf. The cifs.upcall utility is invoked for UNC path server name to IP address resolution. The CIFS functionality is encapsulated by the dns_resolve_unc_to_ip() function, which is used to resolve a UNC path to an IP address for CIFS filesystem. This part remains in the CIFS module for now. See the added Documentation/networking/dns_resolver.txt for more information. Signed-off-by: Wang Lei <wang840925@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 8a2cf129e535..2a0c892959f4 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -45,7 +45,6 @@
45#include "cifs_fs_sb.h" 45#include "cifs_fs_sb.h"
46#include <linux/mm.h> 46#include <linux/mm.h>
47#include <linux/key-type.h> 47#include <linux/key-type.h>
48#include "dns_resolve.h"
49#include "cifs_spnego.h" 48#include "cifs_spnego.h"
50#include "fscache.h" 49#include "fscache.h"
51#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ 50#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
@@ -934,22 +933,13 @@ init_cifs(void)
934 if (rc) 933 if (rc)
935 goto out_unregister_filesystem; 934 goto out_unregister_filesystem;
936#endif 935#endif
937#ifdef CONFIG_CIFS_DFS_UPCALL
938 rc = cifs_init_dns_resolver();
939 if (rc)
940 goto out_unregister_key_type;
941#endif
942 rc = slow_work_register_user(THIS_MODULE); 936 rc = slow_work_register_user(THIS_MODULE);
943 if (rc) 937 if (rc)
944 goto out_unregister_resolver_key; 938 goto out_unregister_key_type;
945 939
946 return 0; 940 return 0;
947 941
948 out_unregister_resolver_key:
949#ifdef CONFIG_CIFS_DFS_UPCALL
950 cifs_exit_dns_resolver();
951 out_unregister_key_type: 942 out_unregister_key_type:
952#endif
953#ifdef CONFIG_CIFS_UPCALL 943#ifdef CONFIG_CIFS_UPCALL
954 unregister_key_type(&cifs_spnego_key_type); 944 unregister_key_type(&cifs_spnego_key_type);
955 out_unregister_filesystem: 945 out_unregister_filesystem:
@@ -976,7 +966,6 @@ exit_cifs(void)
976 cifs_fscache_unregister(); 966 cifs_fscache_unregister();
977#ifdef CONFIG_CIFS_DFS_UPCALL 967#ifdef CONFIG_CIFS_DFS_UPCALL
978 cifs_dfs_release_automount_timer(); 968 cifs_dfs_release_automount_timer();
979 cifs_exit_dns_resolver();
980#endif 969#endif
981#ifdef CONFIG_CIFS_UPCALL 970#ifdef CONFIG_CIFS_UPCALL
982 unregister_key_type(&cifs_spnego_key_type); 971 unregister_key_type(&cifs_spnego_key_type);