diff options
author | Jeff Layton <jlayton@redhat.com> | 2007-11-03 01:02:24 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2007-11-03 01:02:24 -0400 |
commit | 84a15b935481fa651cc6ec60aed015312b67adda (patch) | |
tree | 9f98331e41373bd0b4784e294a57a8a6d4156bbc /fs/cifs/cifsfs.c | |
parent | 09fe7ba78dedb9017401ed555ecc4435c99a7556 (diff) |
[CIFS] Register and unregister cifs_spnego_key_type on module init/exit
Signed-off-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.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index a6fbea57c4b1..94c0f55d7669 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "cifs_debug.h" | 43 | #include "cifs_debug.h" |
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 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ | 47 | #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ |
47 | 48 | ||
48 | #ifdef CONFIG_CIFS_QUOTA | 49 | #ifdef CONFIG_CIFS_QUOTA |
@@ -1005,12 +1006,16 @@ init_cifs(void) | |||
1005 | rc = register_filesystem(&cifs_fs_type); | 1006 | rc = register_filesystem(&cifs_fs_type); |
1006 | if (rc) | 1007 | if (rc) |
1007 | goto out_destroy_request_bufs; | 1008 | goto out_destroy_request_bufs; |
1008 | 1009 | #ifdef CONFIG_CIFS_UPCALL | |
1010 | rc = register_key_type(&cifs_spnego_key_type); | ||
1011 | if (rc) | ||
1012 | goto out_unregister_filesystem; | ||
1013 | #endif | ||
1009 | oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); | 1014 | oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); |
1010 | if (IS_ERR(oplockThread)) { | 1015 | if (IS_ERR(oplockThread)) { |
1011 | rc = PTR_ERR(oplockThread); | 1016 | rc = PTR_ERR(oplockThread); |
1012 | cERROR(1, ("error %d create oplock thread", rc)); | 1017 | cERROR(1, ("error %d create oplock thread", rc)); |
1013 | goto out_unregister_filesystem; | 1018 | goto out_unregister_key_type; |
1014 | } | 1019 | } |
1015 | 1020 | ||
1016 | dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); | 1021 | dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); |
@@ -1024,7 +1029,11 @@ init_cifs(void) | |||
1024 | 1029 | ||
1025 | out_stop_oplock_thread: | 1030 | out_stop_oplock_thread: |
1026 | kthread_stop(oplockThread); | 1031 | kthread_stop(oplockThread); |
1032 | out_unregister_key_type: | ||
1033 | #ifdef CONFIG_CIFS_UPCALL | ||
1034 | unregister_key_type(&cifs_spnego_key_type); | ||
1027 | out_unregister_filesystem: | 1035 | out_unregister_filesystem: |
1036 | #endif | ||
1028 | unregister_filesystem(&cifs_fs_type); | 1037 | unregister_filesystem(&cifs_fs_type); |
1029 | out_destroy_request_bufs: | 1038 | out_destroy_request_bufs: |
1030 | cifs_destroy_request_bufs(); | 1039 | cifs_destroy_request_bufs(); |
@@ -1046,6 +1055,9 @@ exit_cifs(void) | |||
1046 | #ifdef CONFIG_PROC_FS | 1055 | #ifdef CONFIG_PROC_FS |
1047 | cifs_proc_clean(); | 1056 | cifs_proc_clean(); |
1048 | #endif | 1057 | #endif |
1058 | #ifdef CONFIG_CIFS_UPCALL | ||
1059 | unregister_key_type(&cifs_spnego_key_type); | ||
1060 | #endif | ||
1049 | unregister_filesystem(&cifs_fs_type); | 1061 | unregister_filesystem(&cifs_fs_type); |
1050 | cifs_destroy_inodecache(); | 1062 | cifs_destroy_inodecache(); |
1051 | cifs_destroy_mids(); | 1063 | cifs_destroy_mids(); |