aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-04-28 20:06:05 -0400
committerSteve French <sfrench@us.ibm.com>2008-04-28 20:06:05 -0400
commit4b18f2a9c3964f7612b7403dddc1d1ba5443ae24 (patch)
tree6deaca1844706e70e235be6fe502269e4f15355f /fs/cifs/misc.c
parente9f20d6f03e8df393b001dab6dc5226c2a5daf57 (diff)
[CIFS] convert usage of implicit booleans to bool
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r--fs/cifs/misc.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 2a42d9fedbb2..1d69b8014e0b 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;
@@ -522,17 +523,17 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
522 pnotify->Action)); /* BB removeme BB */ 523 pnotify->Action)); /* BB removeme BB */
523 /* cifs_dump_mem("Rcvd notify Data: ",buf, 524 /* cifs_dump_mem("Rcvd notify Data: ",buf,
524 sizeof(struct smb_hdr)+60); */ 525 sizeof(struct smb_hdr)+60); */
525 return TRUE; 526 return true;
526 } 527 }
527 if (pSMBr->hdr.Status.CifsError) { 528 if (pSMBr->hdr.Status.CifsError) {
528 cFYI(1, ("notify err 0x%d", 529 cFYI(1, ("notify err 0x%d",
529 pSMBr->hdr.Status.CifsError)); 530 pSMBr->hdr.Status.CifsError));
530 return TRUE; 531 return true;
531 } 532 }
532 return FALSE; 533 return false;
533 } 534 }
534 if (pSMB->hdr.Command != SMB_COM_LOCKING_ANDX) 535 if (pSMB->hdr.Command != SMB_COM_LOCKING_ANDX)
535 return FALSE; 536 return false;
536 if (pSMB->hdr.Flags & SMBFLG_RESPONSE) { 537 if (pSMB->hdr.Flags & SMBFLG_RESPONSE) {
537 /* no sense logging error on invalid handle on oplock 538 /* no sense logging error on invalid handle on oplock
538 break - harmless race between close request and oplock 539 break - harmless race between close request and oplock
@@ -541,21 +542,21 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
541 if ((NT_STATUS_INVALID_HANDLE) == 542 if ((NT_STATUS_INVALID_HANDLE) ==
542 le32_to_cpu(pSMB->hdr.Status.CifsError)) { 543 le32_to_cpu(pSMB->hdr.Status.CifsError)) {
543 cFYI(1, ("invalid handle on oplock break")); 544 cFYI(1, ("invalid handle on oplock break"));
544 return TRUE; 545 return true;
545 } else if (ERRbadfid == 546 } else if (ERRbadfid ==
546 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) { 547 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) {
547 return TRUE; 548 return true;
548 } else { 549 } else {
549 return FALSE; /* on valid oplock brk we get "request" */ 550 return false; /* on valid oplock brk we get "request" */
550 } 551 }
551 } 552 }
552 if (pSMB->hdr.WordCount != 8) 553 if (pSMB->hdr.WordCount != 8)
553 return FALSE; 554 return false;
554 555
555 cFYI(1, ("oplock type 0x%d level 0x%d", 556 cFYI(1, ("oplock type 0x%d level 0x%d",
556 pSMB->LockType, pSMB->OplockLevel)); 557 pSMB->LockType, pSMB->OplockLevel));
557 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)) 558 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE))
558 return FALSE; 559 return false;
559 560
560 /* look up tcon based on tid & uid */ 561 /* look up tcon based on tid & uid */
561 read_lock(&GlobalSMBSeslock); 562 read_lock(&GlobalSMBSeslock);
@@ -573,11 +574,11 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
573 ("file id match, oplock break")); 574 ("file id match, oplock break"));
574 pCifsInode = 575 pCifsInode =
575 CIFS_I(netfile->pInode); 576 CIFS_I(netfile->pInode);
576 pCifsInode->clientCanCacheAll = FALSE; 577 pCifsInode->clientCanCacheAll = false;
577 if (pSMB->OplockLevel == 0) 578 if (pSMB->OplockLevel == 0)
578 pCifsInode->clientCanCacheRead 579 pCifsInode->clientCanCacheRead
579 = FALSE; 580 = false;
580 pCifsInode->oplockPending = TRUE; 581 pCifsInode->oplockPending = true;
581 AllocOplockQEntry(netfile->pInode, 582 AllocOplockQEntry(netfile->pInode,
582 netfile->netfid, 583 netfile->netfid,
583 tcon); 584 tcon);
@@ -585,17 +586,17 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
585 ("about to wake up oplock thread")); 586 ("about to wake up oplock thread"));
586 if (oplockThread) 587 if (oplockThread)
587 wake_up_process(oplockThread); 588 wake_up_process(oplockThread);
588 return TRUE; 589 return true;
589 } 590 }
590 } 591 }
591 read_unlock(&GlobalSMBSeslock); 592 read_unlock(&GlobalSMBSeslock);
592 cFYI(1, ("No matching file for oplock break")); 593 cFYI(1, ("No matching file for oplock break"));
593 return TRUE; 594 return true;
594 } 595 }
595 } 596 }
596 read_unlock(&GlobalSMBSeslock); 597 read_unlock(&GlobalSMBSeslock);
597 cFYI(1, ("Can not process oplock break for non-existent connection")); 598 cFYI(1, ("Can not process oplock break for non-existent connection"));
598 return TRUE; 599 return true;
599} 600}
600 601
601void 602void