aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-18 12:41:43 -0400
committerSteve French <sfrench@us.ibm.com>2005-08-18 12:41:43 -0400
commit8d0d50948b276b46b75b1b5855d3f9fab1e0fd92 (patch)
treec0493d906cfd611f8dc3214dbbbd3a8e9e80ebf8
parentf191401f5906f4d942fac87ebeb4671faf1ba7d6 (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>
-rw-r--r--fs/cifs/cifsfs.c32
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;
59unsigned int sign_CIFS_PDUs = 1; 59unsigned int sign_CIFS_PDUs = 1;
60extern struct task_struct * oplockThread; /* remove sparse warning */ 60extern struct task_struct * oplockThread; /* remove sparse warning */
61struct task_struct * oplockThread = NULL; 61struct task_struct * oplockThread = NULL;
62extern struct task_struct * dnotifyThread; /* remove sparse warning */
63struct task_struct * dnotifyThread = NULL;
62unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE; 64unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
63module_param(CIFSMaxBufSize, int, 0); 65module_param(CIFSMaxBufSize, int, 0);
64MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048"); 66MODULE_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);
73MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256"); 75MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256");
74 76
75static DECLARE_COMPLETION(cifs_oplock_exited); 77static DECLARE_COMPLETION(cifs_oplock_exited);
78static DECLARE_COMPLETION(cifs_dnotify_exited);
76 79
77extern mempool_t *cifs_sm_req_poolp; 80extern mempool_t *cifs_sm_req_poolp;
78extern mempool_t *cifs_req_poolp; 81extern 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
844static 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
841static int __init 857static int __init
842init_cifs(void) 858init_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
921MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>"); 947MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");