diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 54 |
1 files changed, 5 insertions, 49 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 38491fd3871d..5e6d35804d73 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/delay.h> | 35 | #include <linux/delay.h> |
36 | #include <linux/kthread.h> | 36 | #include <linux/kthread.h> |
37 | #include <linux/freezer.h> | 37 | #include <linux/freezer.h> |
38 | #include <linux/smp_lock.h> | ||
38 | #include "cifsfs.h" | 39 | #include "cifsfs.h" |
39 | #include "cifspdu.h" | 40 | #include "cifspdu.h" |
40 | #define DECLARE_GLOBALS_HERE | 41 | #define DECLARE_GLOBALS_HERE |
@@ -66,9 +67,6 @@ unsigned int sign_CIFS_PDUs = 1; | |||
66 | extern struct task_struct *oplockThread; /* remove sparse warning */ | 67 | extern struct task_struct *oplockThread; /* remove sparse warning */ |
67 | struct task_struct *oplockThread = NULL; | 68 | struct task_struct *oplockThread = NULL; |
68 | /* extern struct task_struct * dnotifyThread; remove sparse warning */ | 69 | /* extern struct task_struct * dnotifyThread; remove sparse warning */ |
69 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
70 | static struct task_struct *dnotifyThread = NULL; | ||
71 | #endif | ||
72 | static const struct super_operations cifs_super_ops; | 70 | static const struct super_operations cifs_super_ops; |
73 | unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; | 71 | unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; |
74 | module_param(CIFSMaxBufSize, int, 0); | 72 | module_param(CIFSMaxBufSize, int, 0); |
@@ -316,6 +314,7 @@ cifs_alloc_inode(struct super_block *sb) | |||
316 | cifs_inode->clientCanCacheAll = false; | 314 | cifs_inode->clientCanCacheAll = false; |
317 | cifs_inode->delete_pending = false; | 315 | cifs_inode->delete_pending = false; |
318 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ | 316 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ |
317 | cifs_inode->server_eof = 0; | ||
319 | 318 | ||
320 | /* Can not set i_flags here - they get immediately overwritten | 319 | /* Can not set i_flags here - they get immediately overwritten |
321 | to zero by the VFS */ | 320 | to zero by the VFS */ |
@@ -532,6 +531,7 @@ static void cifs_umount_begin(struct super_block *sb) | |||
532 | if (tcon == NULL) | 531 | if (tcon == NULL) |
533 | return; | 532 | return; |
534 | 533 | ||
534 | lock_kernel(); | ||
535 | read_lock(&cifs_tcp_ses_lock); | 535 | read_lock(&cifs_tcp_ses_lock); |
536 | if (tcon->tc_count == 1) | 536 | if (tcon->tc_count == 1) |
537 | tcon->tidStatus = CifsExiting; | 537 | tcon->tidStatus = CifsExiting; |
@@ -550,6 +550,7 @@ static void cifs_umount_begin(struct super_block *sb) | |||
550 | } | 550 | } |
551 | /* BB FIXME - finish add checks for tidStatus BB */ | 551 | /* BB FIXME - finish add checks for tidStatus BB */ |
552 | 552 | ||
553 | unlock_kernel(); | ||
553 | return; | 554 | return; |
554 | } | 555 | } |
555 | 556 | ||
@@ -601,8 +602,7 @@ cifs_get_sb(struct file_system_type *fs_type, | |||
601 | 602 | ||
602 | rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0); | 603 | rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0); |
603 | if (rc) { | 604 | if (rc) { |
604 | up_write(&sb->s_umount); | 605 | deactivate_locked_super(sb); |
605 | deactivate_super(sb); | ||
606 | return rc; | 606 | return rc; |
607 | } | 607 | } |
608 | sb->s_flags |= MS_ACTIVE; | 608 | sb->s_flags |= MS_ACTIVE; |
@@ -1040,34 +1040,6 @@ static int cifs_oplock_thread(void *dummyarg) | |||
1040 | return 0; | 1040 | return 0; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
1044 | static int cifs_dnotify_thread(void *dummyarg) | ||
1045 | { | ||
1046 | struct list_head *tmp; | ||
1047 | struct TCP_Server_Info *server; | ||
1048 | |||
1049 | do { | ||
1050 | if (try_to_freeze()) | ||
1051 | continue; | ||
1052 | set_current_state(TASK_INTERRUPTIBLE); | ||
1053 | schedule_timeout(15*HZ); | ||
1054 | /* check if any stuck requests that need | ||
1055 | to be woken up and wakeq so the | ||
1056 | thread can wake up and error out */ | ||
1057 | read_lock(&cifs_tcp_ses_lock); | ||
1058 | list_for_each(tmp, &cifs_tcp_ses_list) { | ||
1059 | server = list_entry(tmp, struct TCP_Server_Info, | ||
1060 | tcp_ses_list); | ||
1061 | if (atomic_read(&server->inFlight)) | ||
1062 | wake_up_all(&server->response_q); | ||
1063 | } | ||
1064 | read_unlock(&cifs_tcp_ses_lock); | ||
1065 | } while (!kthread_should_stop()); | ||
1066 | |||
1067 | return 0; | ||
1068 | } | ||
1069 | #endif | ||
1070 | |||
1071 | static int __init | 1043 | static int __init |
1072 | init_cifs(void) | 1044 | init_cifs(void) |
1073 | { | 1045 | { |
@@ -1144,21 +1116,8 @@ init_cifs(void) | |||
1144 | goto out_unregister_dfs_key_type; | 1116 | goto out_unregister_dfs_key_type; |
1145 | } | 1117 | } |
1146 | 1118 | ||
1147 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
1148 | dnotifyThread = kthread_run(cifs_dnotify_thread, NULL, "cifsdnotifyd"); | ||
1149 | if (IS_ERR(dnotifyThread)) { | ||
1150 | rc = PTR_ERR(dnotifyThread); | ||
1151 | cERROR(1, ("error %d create dnotify thread", rc)); | ||
1152 | goto out_stop_oplock_thread; | ||
1153 | } | ||
1154 | #endif | ||
1155 | |||
1156 | return 0; | 1119 | return 0; |
1157 | 1120 | ||
1158 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
1159 | out_stop_oplock_thread: | ||
1160 | #endif | ||
1161 | kthread_stop(oplockThread); | ||
1162 | out_unregister_dfs_key_type: | 1121 | out_unregister_dfs_key_type: |
1163 | #ifdef CONFIG_CIFS_DFS_UPCALL | 1122 | #ifdef CONFIG_CIFS_DFS_UPCALL |
1164 | unregister_key_type(&key_type_dns_resolver); | 1123 | unregister_key_type(&key_type_dns_resolver); |
@@ -1196,9 +1155,6 @@ exit_cifs(void) | |||
1196 | cifs_destroy_inodecache(); | 1155 | cifs_destroy_inodecache(); |
1197 | cifs_destroy_mids(); | 1156 | cifs_destroy_mids(); |
1198 | cifs_destroy_request_bufs(); | 1157 | cifs_destroy_request_bufs(); |
1199 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
1200 | kthread_stop(dnotifyThread); | ||
1201 | #endif | ||
1202 | kthread_stop(oplockThread); | 1158 | kthread_stop(oplockThread); |
1203 | } | 1159 | } |
1204 | 1160 | ||