aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
authorSteve French <smfrench@austin.rr.com>2005-04-29 01:41:10 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-29 01:41:10 -0400
commit57337e42f1393941d59d5154eed27a63988ff2be (patch)
tree52a66ef24ea412473702a63f261e1520cf8e1885 /fs/cifs/misc.c
parent11aa0149d0e49ee1791735ec4ae3079b27b9a68e (diff)
[PATCH] cifs: handle termination of cifs oplockd kernel thread
Signed-off-by: Steve French (sfrench@us.ibm.com) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r--fs/cifs/misc.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 75fd3bd6e233..db14b503d89e 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -452,25 +452,30 @@ is_valid_oplock_break(struct smb_hdr *buf)
452 atomic_inc(&tcon->num_oplock_brks); 452 atomic_inc(&tcon->num_oplock_brks);
453#endif 453#endif
454 list_for_each(tmp1,&tcon->openFileList){ 454 list_for_each(tmp1,&tcon->openFileList){
455 netfile = list_entry(tmp1,struct cifsFileInfo,tlist); 455 netfile = list_entry(tmp1,struct cifsFileInfo,
456 tlist);
456 if(pSMB->Fid == netfile->netfid) { 457 if(pSMB->Fid == netfile->netfid) {
457 struct cifsInodeInfo *pCifsInode; 458 struct cifsInodeInfo *pCifsInode;
458 read_unlock(&GlobalSMBSeslock); 459 read_unlock(&GlobalSMBSeslock);
459 cFYI(1,("Matching file id, processing oplock break")); 460 cFYI(1,("file id match, oplock break"));
460 pCifsInode = 461 pCifsInode =
461 CIFS_I(netfile->pInode); 462 CIFS_I(netfile->pInode);
462 pCifsInode->clientCanCacheAll = FALSE; 463 pCifsInode->clientCanCacheAll = FALSE;
463 if(pSMB->OplockLevel == 0) 464 if(pSMB->OplockLevel == 0)
464 pCifsInode->clientCanCacheRead = FALSE; 465 pCifsInode->clientCanCacheRead
466 = FALSE;
465 pCifsInode->oplockPending = TRUE; 467 pCifsInode->oplockPending = TRUE;
466 AllocOplockQEntry(netfile->pInode, netfile->netfid, tcon); 468 AllocOplockQEntry(netfile->pInode,
469 netfile->netfid,
470 tcon);
467 cFYI(1,("about to wake up oplock thd")); 471 cFYI(1,("about to wake up oplock thd"));
468 wake_up_process(oplockThread); 472 if(oplockThread)
473 wake_up_process(oplockThread);
469 return TRUE; 474 return TRUE;
470 } 475 }
471 } 476 }
472 read_unlock(&GlobalSMBSeslock); 477 read_unlock(&GlobalSMBSeslock);
473 cFYI(1,("No matching file for oplock break on connection")); 478 cFYI(1,("No matching file for oplock break"));
474 return TRUE; 479 return TRUE;
475 } 480 }
476 } 481 }
@@ -491,7 +496,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
491 496
492 buffer = (unsigned char *) smb_buf; 497 buffer = (unsigned char *) smb_buf;
493 for (i = 0, j = 0; i < smb_buf_length; i++, j++) { 498 for (i = 0, j = 0; i < smb_buf_length; i++, j++) {
494 if (i % 8 == 0) { /* we have reached the beginning of line */ 499 if (i % 8 == 0) { /* have reached the beginning of line */
495 printk(KERN_DEBUG "| "); 500 printk(KERN_DEBUG "| ");
496 j = 0; 501 j = 0;
497 } 502 }
@@ -502,7 +507,7 @@ dump_smb(struct smb_hdr *smb_buf, int smb_buf_length)
502 else 507 else
503 debug_line[1 + (2 * j)] = '_'; 508 debug_line[1 + (2 * j)] = '_';
504 509
505 if (i % 8 == 7) { /* we have reached end of line, time to print ascii */ 510 if (i % 8 == 7) { /* reached end of line, time to print ascii */
506 debug_line[16] = 0; 511 debug_line[16] = 0;
507 printk(" | %s\n", debug_line); 512 printk(" | %s\n", debug_line);
508 } 513 }
@@ -577,7 +582,7 @@ cifs_convertUCSpath(char *target, const __le16 * source, int maxlen,
577 } 582 }
578 } 583 }
579 j++; 584 j++;
580 /* check to make sure we do not overrun callers allocated temp buffer */ 585 /* make sure we do not overrun callers allocated temp buffer */
581 if(j >= (2 * NAME_MAX)) 586 if(j >= (2 * NAME_MAX))
582 break; 587 break;
583 } 588 }
@@ -599,7 +604,7 @@ cifsConvertToUCS(__le16 * target, const char *source, int maxlen,
599 char src_char; 604 char src_char;
600 605
601 if(!mapChars) 606 if(!mapChars)
602 return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp); 607 return cifs_strtoUCS((wchar_t *) target, source, PATH_MAX, cp);
603 608
604 for(i = 0, j = 0; i < maxlen; j++) { 609 for(i = 0, j = 0; i < maxlen; j++) {
605 src_char = source[i]; 610 src_char = source[i];