diff options
author | Steve French <sfrench@us.ibm.com> | 2005-08-18 12:41:43 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-08-18 12:41:43 -0400 |
commit | 8d0d50948b276b46b75b1b5855d3f9fab1e0fd92 (patch) | |
tree | c0493d906cfd611f8dc3214dbbbd3a8e9e80ebf8 /fs | |
parent | f191401f5906f4d942fac87ebeb4671faf1ba7d6 (diff) |
[CIFS] Change Notify support part 1 - add dnotify thread for processing
notify responses.
Signed-off-by: Asser Ferno <asser@diku.dk>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsfs.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 7fda0f7d9c00..d77abe236a67 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -59,6 +59,8 @@ unsigned int ntlmv2_support = 0; | |||
59 | unsigned int sign_CIFS_PDUs = 1; | 59 | unsigned int sign_CIFS_PDUs = 1; |
60 | extern struct task_struct * oplockThread; /* remove sparse warning */ | 60 | extern struct task_struct * oplockThread; /* remove sparse warning */ |
61 | struct task_struct * oplockThread = NULL; | 61 | struct task_struct * oplockThread = NULL; |
62 | extern struct task_struct * dnotifyThread; /* remove sparse warning */ | ||
63 | struct task_struct * dnotifyThread = NULL; | ||
62 | unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; | 64 | unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; |
63 | module_param(CIFSMaxBufSize, int, 0); | 65 | module_param(CIFSMaxBufSize, int, 0); |
64 | MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048"); | 66 | MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048"); |
@@ -73,6 +75,7 @@ module_param(cifs_max_pending, int, 0); | |||
73 | MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); | 75 | MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); |
74 | 76 | ||
75 | static DECLARE_COMPLETION(cifs_oplock_exited); | 77 | static DECLARE_COMPLETION(cifs_oplock_exited); |
78 | static DECLARE_COMPLETION(cifs_dnotify_exited); | ||
76 | 79 | ||
77 | extern mempool_t *cifs_sm_req_poolp; | 80 | extern mempool_t *cifs_sm_req_poolp; |
78 | extern mempool_t *cifs_req_poolp; | 81 | extern mempool_t *cifs_req_poolp; |
@@ -838,6 +841,19 @@ static int cifs_oplock_thread(void * dummyarg) | |||
838 | complete_and_exit (&cifs_oplock_exited, 0); | 841 | complete_and_exit (&cifs_oplock_exited, 0); |
839 | } | 842 | } |
840 | 843 | ||
844 | static int cifs_dnotify_thread(void * dummyarg) | ||
845 | { | ||
846 | daemonize("cifsdnotifyd"); | ||
847 | allow_signal(SIGTERM); | ||
848 | |||
849 | dnotifyThread = current; | ||
850 | do { | ||
851 | set_current_state(TASK_INTERRUPTIBLE); | ||
852 | schedule_timeout(39*HZ); | ||
853 | } while(!signal_pending(current)); | ||
854 | complete_and_exit (&cifs_dnotify_exited, 0); | ||
855 | } | ||
856 | |||
841 | static int __init | 857 | static int __init |
842 | init_cifs(void) | 858 | init_cifs(void) |
843 | { | 859 | { |
@@ -884,10 +900,16 @@ init_cifs(void) | |||
884 | if (!rc) { | 900 | if (!rc) { |
885 | rc = (int)kernel_thread(cifs_oplock_thread, NULL, | 901 | rc = (int)kernel_thread(cifs_oplock_thread, NULL, |
886 | CLONE_FS | CLONE_FILES | CLONE_VM); | 902 | CLONE_FS | CLONE_FILES | CLONE_VM); |
887 | if(rc > 0) | 903 | if(rc > 0) { |
888 | return 0; | 904 | rc = (int)kernel_thread(cifs_dnotify_thread, NULL, |
889 | else | 905 | CLONE_FS | CLONE_FILES | CLONE_VM); |
906 | if(rc > 0) | ||
907 | return 0; | ||
908 | else | ||
909 | cERROR(1,("error %d create dnotify thread", rc)); | ||
910 | } else { | ||
890 | cERROR(1,("error %d create oplock thread",rc)); | 911 | cERROR(1,("error %d create oplock thread",rc)); |
912 | } | ||
891 | } | 913 | } |
892 | cifs_destroy_request_bufs(); | 914 | cifs_destroy_request_bufs(); |
893 | } | 915 | } |
@@ -916,6 +938,10 @@ exit_cifs(void) | |||
916 | send_sig(SIGTERM, oplockThread, 1); | 938 | send_sig(SIGTERM, oplockThread, 1); |
917 | wait_for_completion(&cifs_oplock_exited); | 939 | wait_for_completion(&cifs_oplock_exited); |
918 | } | 940 | } |
941 | if(dnotifyThread) { | ||
942 | send_sig(SIGTERM, dnotifyThread, 1); | ||
943 | wait_for_completion(&cifs_dnotify_exited); | ||
944 | } | ||
919 | } | 945 | } |
920 | 946 | ||
921 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); | 947 | MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); |