Commit 84a15b93 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

[CIFS] Register and unregister cifs_spnego_key_type on module init/exit

Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 09fe7ba7
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include "cifs_debug.h" #include "cifs_debug.h"
#include "cifs_fs_sb.h" #include "cifs_fs_sb.h"
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/key-type.h>
#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
#ifdef CONFIG_CIFS_QUOTA #ifdef CONFIG_CIFS_QUOTA
...@@ -1005,12 +1006,16 @@ init_cifs(void) ...@@ -1005,12 +1006,16 @@ init_cifs(void)
rc = register_filesystem(&cifs_fs_type); rc = register_filesystem(&cifs_fs_type);
if (rc) if (rc)
goto out_destroy_request_bufs; goto out_destroy_request_bufs;
#ifdef CONFIG_CIFS_UPCALL
rc = register_key_type(&cifs_spnego_key_type);
if (rc)
goto out_unregister_filesystem;
#endif
oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd"); oplockThread = kthread_run(cifs_oplock_thread, NULL, "cifsoplockd");
if (IS_ERR(oplockThread)) { if (IS_ERR(oplockThread)) {
rc = PTR_ERR(oplockThread); rc = PTR_ERR(oplockThread);
cERROR(1, ("error %d create oplock thread", rc)); cERROR(1, ("error %d create oplock thread", rc));
goto out_unregister_filesystem; goto out_unregister_key_type;
} }
dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd");
...@@ -1024,7 +1029,11 @@ init_cifs(void) ...@@ -1024,7 +1029,11 @@ init_cifs(void)
out_stop_oplock_thread: out_stop_oplock_thread:
kthread_stop(oplockThread); kthread_stop(oplockThread);
out_unregister_key_type:
#ifdef CONFIG_CIFS_UPCALL
unregister_key_type(&cifs_spnego_key_type);
out_unregister_filesystem: out_unregister_filesystem:
#endif
unregister_filesystem(&cifs_fs_type); unregister_filesystem(&cifs_fs_type);
out_destroy_request_bufs: out_destroy_request_bufs:
cifs_destroy_request_bufs(); cifs_destroy_request_bufs();
...@@ -1045,6 +1054,9 @@ exit_cifs(void) ...@@ -1045,6 +1054,9 @@ exit_cifs(void)
cFYI(0, ("exit_cifs")); cFYI(0, ("exit_cifs"));
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
cifs_proc_clean(); cifs_proc_clean();
#endif
#ifdef CONFIG_CIFS_UPCALL
unregister_key_type(&cifs_spnego_key_type);
#endif #endif
unregister_filesystem(&cifs_fs_type); unregister_filesystem(&cifs_fs_type);
cifs_destroy_inodecache(); cifs_destroy_inodecache();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment