Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 12023
b: refs/heads/master
c: 8d0d509
h: refs/heads/master
i:
  12021: 7666fb3
  12019: ba63f31
  12015: ce9a34c
v: v3
  • Loading branch information
Steve French committed Aug 18, 2005
1 parent cc9d38f commit 782df02
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f191401f5906f4d942fac87ebeb4671faf1ba7d6
refs/heads/master: 8d0d50948b276b46b75b1b5855d3f9fab1e0fd92
32 changes: 29 additions & 3 deletions trunk/fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ unsigned int ntlmv2_support = 0;
unsigned int sign_CIFS_PDUs = 1;
extern struct task_struct * oplockThread; /* remove sparse warning */
struct task_struct * oplockThread = NULL;
extern struct task_struct * dnotifyThread; /* remove sparse warning */
struct task_struct * dnotifyThread = NULL;
unsigned int CIFSMaxBufSize = CIFS_MAX_MSGSIZE;
module_param(CIFSMaxBufSize, int, 0);
MODULE_PARM_DESC(CIFSMaxBufSize,"Network buffer size (not including header). Default: 16384 Range: 8192 to 130048");
Expand All @@ -73,6 +75,7 @@ module_param(cifs_max_pending, int, 0);
MODULE_PARM_DESC(cifs_max_pending,"Simultaneous requests to server. Default: 50 Range: 2 to 256");

static DECLARE_COMPLETION(cifs_oplock_exited);
static DECLARE_COMPLETION(cifs_dnotify_exited);

extern mempool_t *cifs_sm_req_poolp;
extern mempool_t *cifs_req_poolp;
Expand Down Expand Up @@ -838,6 +841,19 @@ static int cifs_oplock_thread(void * dummyarg)
complete_and_exit (&cifs_oplock_exited, 0);
}

static int cifs_dnotify_thread(void * dummyarg)
{
daemonize("cifsdnotifyd");
allow_signal(SIGTERM);

dnotifyThread = current;
do {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(39*HZ);
} while(!signal_pending(current));
complete_and_exit (&cifs_dnotify_exited, 0);
}

static int __init
init_cifs(void)
{
Expand Down Expand Up @@ -884,10 +900,16 @@ init_cifs(void)
if (!rc) {
rc = (int)kernel_thread(cifs_oplock_thread, NULL,
CLONE_FS | CLONE_FILES | CLONE_VM);
if(rc > 0)
return 0;
else
if(rc > 0) {
rc = (int)kernel_thread(cifs_dnotify_thread, NULL,
CLONE_FS | CLONE_FILES | CLONE_VM);
if(rc > 0)
return 0;
else
cERROR(1,("error %d create dnotify thread", rc));
} else {
cERROR(1,("error %d create oplock thread",rc));
}
}
cifs_destroy_request_bufs();
}
Expand Down Expand Up @@ -916,6 +938,10 @@ exit_cifs(void)
send_sig(SIGTERM, oplockThread, 1);
wait_for_completion(&cifs_oplock_exited);
}
if(dnotifyThread) {
send_sig(SIGTERM, dnotifyThread, 1);
wait_for_completion(&cifs_dnotify_exited);
}
}

MODULE_AUTHOR("Steve French <sfrench@us.ibm.com>");
Expand Down

0 comments on commit 782df02

Please sign in to comment.