aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-01-09 11:21:36 -0500
committerSteve French <sfrench@us.ibm.com>2008-01-09 11:21:36 -0500
commit6103335de8afa5d780dcd512abe85c696af7b040 (patch)
tree92940053ea0bef4b5c821ed84aa265c496724391 /fs/cifs
parentf6d09982197c4163c70f6af0cf15bb78674105c0 (diff)
[CIFS] DNS name resolution helper upcall for cifs
Adds additional option CIFS_DFS_UPCALL to fs/Kconfig for enabling DFS support. Resolved IP address is saved as a string in the key payload. Igor has a series of related patches that will follow which finish up CIFS DFS support Acked-by: Igor Mammedov <niallain@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/Makefile2
-rw-r--r--fs/cifs/cifsfs.c15
2 files changed, 16 insertions, 1 deletions
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index 45e42fb97c19..09898b8dc69b 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -9,3 +9,5 @@ cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \
9 readdir.o ioctl.o sess.o export.o cifsacl.o 9 readdir.o ioctl.o sess.o export.o cifsacl.o
10 10
11cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o 11cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
12
13cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 093beaa3900d..000b4a5d3219 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -44,6 +44,7 @@
44#include "cifs_fs_sb.h" 44#include "cifs_fs_sb.h"
45#include <linux/mm.h> 45#include <linux/mm.h>
46#include <linux/key-type.h> 46#include <linux/key-type.h>
47#include "dns_resolve.h"
47#include "cifs_spnego.h" 48#include "cifs_spnego.h"
48#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ 49#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
49 50
@@ -1015,11 +1016,16 @@ init_cifs(void)
1015 if (rc) 1016 if (rc)
1016 goto out_unregister_filesystem; 1017 goto out_unregister_filesystem;
1017#endif 1018#endif
1019#ifdef CONFIG_CIFS_DFS_UPCALL
1020 rc = register_key_type(&key_type_dns_resolver);
1021 if (rc)
1022 goto out_unregister_key_type;
1023#endif
1018 oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); 1024 oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
1019 if (IS_ERR(oplockThread)) { 1025 if (IS_ERR(oplockThread)) {
1020 rc = PTR_ERR(oplockThread); 1026 rc = PTR_ERR(oplockThread);
1021 cERROR(1, ("error %d create oplock thread", rc)); 1027 cERROR(1, ("error %d create oplock thread", rc));
1022 goto out_unregister_key_type; 1028 goto out_unregister_dfs_key_type;
1023 } 1029 }
1024 1030
1025 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); 1031 dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
@@ -1033,7 +1039,11 @@ init_cifs(void)
1033 1039
1034 out_stop_oplock_thread: 1040 out_stop_oplock_thread:
1035 kthread_stop(oplockThread); 1041 kthread_stop(oplockThread);
1042 out_unregister_dfs_key_type:
1043#ifdef CONFIG_CIFS_DFS_UPCALL
1044 unregister_key_type(&key_type_dns_resolver);
1036 out_unregister_key_type: 1045 out_unregister_key_type:
1046#endif
1037#ifdef CONFIG_CIFS_UPCALL 1047#ifdef CONFIG_CIFS_UPCALL
1038 unregister_key_type(&cifs_spnego_key_type); 1048 unregister_key_type(&cifs_spnego_key_type);
1039 out_unregister_filesystem: 1049 out_unregister_filesystem:
@@ -1059,6 +1069,9 @@ exit_cifs(void)
1059#ifdef CONFIG_PROC_FS 1069#ifdef CONFIG_PROC_FS
1060 cifs_proc_clean(); 1070 cifs_proc_clean();
1061#endif 1071#endif
1072#ifdef CONFIG_CIFS_DFS_UPCALL
1073 unregister_key_type(&key_type_dns_resolver);
1074#endif
1062#ifdef CONFIG_CIFS_UPCALL 1075#ifdef CONFIG_CIFS_UPCALL
1063 unregister_key_type(&cifs_spnego_key_type); 1076 unregister_key_type(&cifs_spnego_key_type);
1064#endif 1077#endif