aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r--fs/cifs/misc.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 2a42d9fedbb2..4b17f8fe3157 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -496,7 +496,8 @@ checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length)
496 } 496 }
497 return 0; 497 return 0;
498} 498}
499int 499
500bool
500is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) 501is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
501{ 502{
502 struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf; 503 struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf;
@@ -518,21 +519,20 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
518 pnotify = (struct file_notify_information *) 519 pnotify = (struct file_notify_information *)
519 ((char *)&pSMBr->hdr.Protocol + data_offset); 520 ((char *)&pSMBr->hdr.Protocol + data_offset);
520 cFYI(1, ("dnotify on %s Action: 0x%x", 521 cFYI(1, ("dnotify on %s Action: 0x%x",
521 pnotify->FileName, 522 pnotify->FileName, pnotify->Action));
522 pnotify->Action)); /* BB removeme BB */
523 /* cifs_dump_mem("Rcvd notify Data: ",buf, 523 /* cifs_dump_mem("Rcvd notify Data: ",buf,
524 sizeof(struct smb_hdr)+60); */ 524 sizeof(struct smb_hdr)+60); */
525 return TRUE; 525 return true;
526 } 526 }
527 if (pSMBr->hdr.Status.CifsError) { 527 if (pSMBr->hdr.Status.CifsError) {
528 cFYI(1, ("notify err 0x%d", 528 cFYI(1, ("notify err 0x%d",
529 pSMBr->hdr.Status.CifsError)); 529 pSMBr->hdr.Status.CifsError));
530 return TRUE; 530 return true;
531 } 531 }
532 return FALSE; 532 return false;
533 } 533 }
534 if (pSMB->hdr.Command != SMB_COM_LOCKING_ANDX) 534 if (pSMB->hdr.Command != SMB_COM_LOCKING_ANDX)
535 return FALSE; 535 return false;
536 if (pSMB->hdr.Flags & SMBFLG_RESPONSE) { 536 if (pSMB->hdr.Flags & SMBFLG_RESPONSE) {
537 /* no sense logging error on invalid handle on oplock 537 /* no sense logging error on invalid handle on oplock
538 break - harmless race between close request and oplock 538 break - harmless race between close request and oplock
@@ -541,21 +541,21 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
541 if ((NT_STATUS_INVALID_HANDLE) == 541 if ((NT_STATUS_INVALID_HANDLE) ==
542 le32_to_cpu(pSMB->hdr.Status.CifsError)) { 542 le32_to_cpu(pSMB->hdr.Status.CifsError)) {
543 cFYI(1, ("invalid handle on oplock break")); 543 cFYI(1, ("invalid handle on oplock break"));
544 return TRUE; 544 return true;
545 } else if (ERRbadfid == 545 } else if (ERRbadfid ==
546 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) { 546 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) {
547 return TRUE; 547 return true;
548 } else { 548 } else {
549 return FALSE; /* on valid oplock brk we get "request" */ 549 return false; /* on valid oplock brk we get "request" */
550 } 550 }
551 } 551 }
552 if (pSMB->hdr.WordCount != 8) 552 if (pSMB->hdr.WordCount != 8)
553 return FALSE; 553 return false;
554 554
555 cFYI(1, ("oplock type 0x%d level 0x%d", 555 cFYI(1, ("oplock type 0x%d level 0x%d",
556 pSMB->LockType, pSMB->OplockLevel)); 556 pSMB->LockType, pSMB->OplockLevel));
557 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)) 557 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE))
558 return FALSE; 558 return false;
559 559
560 /* look up tcon based on tid & uid */ 560 /* look up tcon based on tid & uid */
561 read_lock(&GlobalSMBSeslock); 561 read_lock(&GlobalSMBSeslock);
@@ -573,11 +573,11 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
573 ("file id match, oplock break")); 573 ("file id match, oplock break"));
574 pCifsInode = 574 pCifsInode =
575 CIFS_I(netfile->pInode); 575 CIFS_I(netfile->pInode);
576 pCifsInode->clientCanCacheAll = FALSE; 576 pCifsInode->clientCanCacheAll = false;
577 if (pSMB->OplockLevel == 0) 577 if (pSMB->OplockLevel == 0)
578 pCifsInode->clientCanCacheRead 578 pCifsInode->clientCanCacheRead
579 = FALSE; 579 = false;
580 pCifsInode->oplockPending = TRUE; 580 pCifsInode->oplockPending = true;
581 AllocOplockQEntry(netfile->pInode, 581 AllocOplockQEntry(netfile->pInode,
582 netfile->netfid, 582 netfile->netfid,
583 tcon); 583 tcon);
@@ -585,17 +585,17 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
585 ("about to wake up oplock thread")); 585 ("about to wake up oplock thread"));
586 if (oplockThread) 586 if (oplockThread)
587 wake_up_process(oplockThread); 587 wake_up_process(oplockThread);
588 return TRUE; 588 return true;
589 } 589 }
590 } 590 }
591 read_unlock(&GlobalSMBSeslock); 591 read_unlock(&GlobalSMBSeslock);
592 cFYI(1, ("No matching file for oplock break")); 592 cFYI(1, ("No matching file for oplock break"));
593 return TRUE; 593 return true;
594 } 594 }
595 } 595 }
596 read_unlock(&GlobalSMBSeslock); 596 read_unlock(&GlobalSMBSeslock);
597 cFYI(1, ("Can not process oplock break for non-existent connection")); 597 cFYI(1, ("Can not process oplock break for non-existent connection"));
598 return TRUE; 598 return true;
599} 599}
600 600
601void 601void