aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--fs/cifs/asn1.c10
-rw-r--r--fs/cifs/cifsacl.c16
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/cifsfs.h8
-rw-r--r--fs/cifs/cifsglob.h44
-rw-r--r--fs/cifs/cifsproto.h13
-rw-r--r--fs/cifs/cifssmb.c38
-rw-r--r--fs/cifs/connect.c80
-rw-r--r--fs/cifs/dir.c18
-rw-r--r--fs/cifs/fcntl.c2
-rw-r--r--fs/cifs/file.c80
-rw-r--r--fs/cifs/inode.c42
-rw-r--r--fs/cifs/link.c2
-rw-r--r--fs/cifs/misc.c33
-rw-r--r--fs/cifs/readdir.c12
-rw-r--r--fs/cifs/smbencrypt.c8
-rw-r--r--fs/cifs/xattr.c2
17 files changed, 200 insertions, 214 deletions
diff --git a/fs/cifs/asn1.c b/fs/cifs/asn1.c
index bcda2c6b6a04..cb52cbbe45ff 100644
--- a/fs/cifs/asn1.c
+++ b/fs/cifs/asn1.c
@@ -460,8 +460,8 @@ decode_negTokenInit(unsigned char *security_blob, int length,
460 unsigned char *sequence_end; 460 unsigned char *sequence_end;
461 unsigned long *oid = NULL; 461 unsigned long *oid = NULL;
462 unsigned int cls, con, tag, oidlen, rc; 462 unsigned int cls, con, tag, oidlen, rc;
463 int use_ntlmssp = FALSE; 463 bool use_ntlmssp = false;
464 int use_kerberos = FALSE; 464 bool use_kerberos = false;
465 465
466 *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/ 466 *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/
467 467
@@ -561,15 +561,15 @@ decode_negTokenInit(unsigned char *security_blob, int length,
561 if (compare_oid(oid, oidlen, 561 if (compare_oid(oid, oidlen,
562 MSKRB5_OID, 562 MSKRB5_OID,
563 MSKRB5_OID_LEN)) 563 MSKRB5_OID_LEN))
564 use_kerberos = TRUE; 564 use_kerberos = true;
565 else if (compare_oid(oid, oidlen, 565 else if (compare_oid(oid, oidlen,
566 KRB5_OID, 566 KRB5_OID,
567 KRB5_OID_LEN)) 567 KRB5_OID_LEN))
568 use_kerberos = TRUE; 568 use_kerberos = true;
569 else if (compare_oid(oid, oidlen, 569 else if (compare_oid(oid, oidlen,
570 NTLMSSP_OID, 570 NTLMSSP_OID,
571 NTLMSSP_OID_LEN)) 571 NTLMSSP_OID_LEN))
572 use_ntlmssp = TRUE; 572 use_ntlmssp = true;
573 573
574 kfree(oid); 574 kfree(oid);
575 } 575 }
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index e99d4faf5f02..6fe1bc5bb368 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -559,7 +559,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
559 const char *path, const __u16 *pfid) 559 const char *path, const __u16 *pfid)
560{ 560{
561 struct cifsFileInfo *open_file = NULL; 561 struct cifsFileInfo *open_file = NULL;
562 int unlock_file = FALSE; 562 bool unlock_file = false;
563 int xid; 563 int xid;
564 int rc = -EIO; 564 int rc = -EIO;
565 __u16 fid; 565 __u16 fid;
@@ -586,10 +586,10 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
586 cifs_sb = CIFS_SB(sb); 586 cifs_sb = CIFS_SB(sb);
587 587
588 if (open_file) { 588 if (open_file) {
589 unlock_file = TRUE; 589 unlock_file = true;
590 fid = open_file->netfid; 590 fid = open_file->netfid;
591 } else if (pfid == NULL) { 591 } else if (pfid == NULL) {
592 int oplock = FALSE; 592 bool oplock = false;
593 /* open file */ 593 /* open file */
594 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, 594 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
595 READ_CONTROL, 0, &fid, &oplock, NULL, 595 READ_CONTROL, 0, &fid, &oplock, NULL,
@@ -604,7 +604,7 @@ static struct cifs_ntsd *get_cifs_acl(u32 *pacllen, struct inode *inode,
604 604
605 rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); 605 rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen);
606 cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen)); 606 cFYI(1, ("GetCIFSACL rc = %d ACL len %d", rc, *pacllen));
607 if (unlock_file == TRUE) /* find_readable_file increments ref count */ 607 if (unlock_file == true) /* find_readable_file increments ref count */
608 atomic_dec(&open_file->wrtPending); 608 atomic_dec(&open_file->wrtPending);
609 else if (pfid == NULL) /* if opened above we have to close the handle */ 609 else if (pfid == NULL) /* if opened above we have to close the handle */
610 CIFSSMBClose(xid, cifs_sb->tcon, fid); 610 CIFSSMBClose(xid, cifs_sb->tcon, fid);
@@ -619,7 +619,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
619 struct inode *inode, const char *path) 619 struct inode *inode, const char *path)
620{ 620{
621 struct cifsFileInfo *open_file; 621 struct cifsFileInfo *open_file;
622 int unlock_file = FALSE; 622 bool unlock_file = false;
623 int xid; 623 int xid;
624 int rc = -EIO; 624 int rc = -EIO;
625 __u16 fid; 625 __u16 fid;
@@ -640,10 +640,10 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
640 640
641 open_file = find_readable_file(CIFS_I(inode)); 641 open_file = find_readable_file(CIFS_I(inode));
642 if (open_file) { 642 if (open_file) {
643 unlock_file = TRUE; 643 unlock_file = true;
644 fid = open_file->netfid; 644 fid = open_file->netfid;
645 } else { 645 } else {
646 int oplock = FALSE; 646 int oplock = 0;
647 /* open file */ 647 /* open file */
648 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, 648 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN,
649 WRITE_DAC, 0, &fid, &oplock, NULL, 649 WRITE_DAC, 0, &fid, &oplock, NULL,
@@ -658,7 +658,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
658 658
659 rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen); 659 rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen);
660 cFYI(DBG2, ("SetCIFSACL rc = %d", rc)); 660 cFYI(DBG2, ("SetCIFSACL rc = %d", rc));
661 if (unlock_file == TRUE) 661 if (unlock_file)
662 atomic_dec(&open_file->wrtPending); 662 atomic_dec(&open_file->wrtPending);
663 else 663 else
664 CIFSSMBClose(xid, cifs_sb->tcon, fid); 664 CIFSSMBClose(xid, cifs_sb->tcon, fid);
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 68f1cdf6aed7..427a7c695896 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -306,8 +306,8 @@ cifs_alloc_inode(struct super_block *sb)
306 /* Until the file is open and we have gotten oplock 306 /* Until the file is open and we have gotten oplock
307 info back from the server, can not assume caching of 307 info back from the server, can not assume caching of
308 file data or metadata */ 308 file data or metadata */
309 cifs_inode->clientCanCacheRead = FALSE; 309 cifs_inode->clientCanCacheRead = false;
310 cifs_inode->clientCanCacheAll = FALSE; 310 cifs_inode->clientCanCacheAll = false;
311 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ 311 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
312 312
313 /* Can not set i_flags here - they get immediately overwritten 313 /* Can not set i_flags here - they get immediately overwritten
@@ -940,7 +940,7 @@ static int cifs_oplock_thread(void *dummyarg)
940 rc = CIFSSMBLock(0, pTcon, netfid, 940 rc = CIFSSMBLock(0, pTcon, netfid,
941 0 /* len */ , 0 /* offset */, 0, 941 0 /* len */ , 0 /* offset */, 0,
942 0, LOCKING_ANDX_OPLOCK_RELEASE, 942 0, LOCKING_ANDX_OPLOCK_RELEASE,
943 0 /* wait flag */); 943 false /* wait flag */);
944 cFYI(1, ("Oplock release rc = %d", rc)); 944 cFYI(1, ("Oplock release rc = %d", rc));
945 } 945 }
946 } else 946 } else
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 503f6aa734af..cd1301a09b3b 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -24,14 +24,6 @@
24 24
25#define ROOT_I 2 25#define ROOT_I 2
26 26
27#ifndef FALSE
28#define FALSE 0
29#endif
30
31#ifndef TRUE
32#define TRUE 1
33#endif
34
35extern struct file_system_type cifs_fs_type; 27extern struct file_system_type cifs_fs_type;
36extern const struct address_space_operations cifs_addr_ops; 28extern const struct address_space_operations cifs_addr_ops;
37extern const struct address_space_operations cifs_addr_ops_smallbuf; 29extern const struct address_space_operations cifs_addr_ops_smallbuf;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 69a2e1942542..b7d9f698e63e 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -57,14 +57,6 @@
57 57
58#include "cifspdu.h" 58#include "cifspdu.h"
59 59
60#ifndef FALSE
61#define FALSE 0
62#endif
63
64#ifndef TRUE
65#define TRUE 1
66#endif
67
68#ifndef XATTR_DOS_ATTRIB 60#ifndef XATTR_DOS_ATTRIB
69#define XATTR_DOS_ATTRIB "user.DOSATTRIB" 61#define XATTR_DOS_ATTRIB "user.DOSATTRIB"
70#endif 62#endif
@@ -147,7 +139,7 @@ struct TCP_Server_Info {
147 enum protocolEnum protocolType; 139 enum protocolEnum protocolType;
148 char versionMajor; 140 char versionMajor;
149 char versionMinor; 141 char versionMinor;
150 unsigned svlocal:1; /* local server or remote */ 142 bool svlocal:1; /* local server or remote */
151 atomic_t socketUseCount; /* number of open cifs sessions on socket */ 143 atomic_t socketUseCount; /* number of open cifs sessions on socket */
152 atomic_t inFlight; /* number of requests on the wire to server */ 144 atomic_t inFlight; /* number of requests on the wire to server */
153#ifdef CONFIG_CIFS_STATS2 145#ifdef CONFIG_CIFS_STATS2
@@ -286,10 +278,10 @@ struct cifsTconInfo {
286 FILE_SYSTEM_DEVICE_INFO fsDevInfo; 278 FILE_SYSTEM_DEVICE_INFO fsDevInfo;
287 FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */ 279 FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */
288 FILE_SYSTEM_UNIX_INFO fsUnixInfo; 280 FILE_SYSTEM_UNIX_INFO fsUnixInfo;
289 unsigned ipc:1; /* set if connection to IPC$ eg for RPC/PIPES */ 281 bool ipc:1; /* set if connection to IPC$ eg for RPC/PIPES */
290 unsigned retry:1; 282 bool retry:1;
291 unsigned nocase:1; 283 bool nocase:1;
292 unsigned unix_ext:1; /* if off disable Linux extensions to CIFS protocol 284 bool unix_ext:1; /* if false disable Linux extensions to CIFS protocol
293 for this mount even if server would support */ 285 for this mount even if server would support */
294 /* BB add field for back pointer to sb struct(s)? */ 286 /* BB add field for back pointer to sb struct(s)? */
295}; 287};
@@ -317,10 +309,10 @@ struct cifs_search_info {
317 char *srch_entries_start; 309 char *srch_entries_start;
318 char *presume_name; 310 char *presume_name;
319 unsigned int resume_name_len; 311 unsigned int resume_name_len;
320 unsigned endOfSearch:1; 312 bool endOfSearch:1;
321 unsigned emptyDir:1; 313 bool emptyDir:1;
322 unsigned unicode:1; 314 bool unicode:1;
323 unsigned smallBuf:1; /* so we know which buf_release function to call */ 315 bool smallBuf:1; /* so we know which buf_release function to call */
324}; 316};
325 317
326struct cifsFileInfo { 318struct cifsFileInfo {
@@ -335,9 +327,9 @@ struct cifsFileInfo {
335 struct inode *pInode; /* needed for oplock break */ 327 struct inode *pInode; /* needed for oplock break */
336 struct mutex lock_mutex; 328 struct mutex lock_mutex;
337 struct list_head llist; /* list of byte range locks we have. */ 329 struct list_head llist; /* list of byte range locks we have. */
338 unsigned closePend:1; /* file is marked to close */ 330 bool closePend:1; /* file is marked to close */
339 unsigned invalidHandle:1; /* file closed via session abend */ 331 bool invalidHandle:1; /* file closed via session abend */
340 unsigned messageMode:1; /* for pipes: message vs byte mode */ 332 bool messageMode:1; /* for pipes: message vs byte mode */
341 atomic_t wrtPending; /* handle in use - defer close */ 333 atomic_t wrtPending; /* handle in use - defer close */
342 struct semaphore fh_sem; /* prevents reopen race after dead ses*/ 334 struct semaphore fh_sem; /* prevents reopen race after dead ses*/
343 char *search_resume_name; /* BB removeme BB */ 335 char *search_resume_name; /* BB removeme BB */
@@ -356,9 +348,9 @@ struct cifsInodeInfo {
356 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 348 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */
357 atomic_t inUse; /* num concurrent users (local openers cifs) of file*/ 349 atomic_t inUse; /* num concurrent users (local openers cifs) of file*/
358 unsigned long time; /* jiffies of last update/check of inode */ 350 unsigned long time; /* jiffies of last update/check of inode */
359 unsigned clientCanCacheRead:1; /* read oplock */ 351 bool clientCanCacheRead:1; /* read oplock */
360 unsigned clientCanCacheAll:1; /* read and writebehind oplock */ 352 bool clientCanCacheAll:1; /* read and writebehind oplock */
361 unsigned oplockPending:1; 353 bool oplockPending:1;
362 struct inode vfs_inode; 354 struct inode vfs_inode;
363}; 355};
364 356
@@ -426,9 +418,9 @@ struct mid_q_entry {
426 struct smb_hdr *resp_buf; /* response buffer */ 418 struct smb_hdr *resp_buf; /* response buffer */
427 int midState; /* wish this were enum but can not pass to wait_event */ 419 int midState; /* wish this were enum but can not pass to wait_event */
428 __u8 command; /* smb command code */ 420 __u8 command; /* smb command code */
429 unsigned largeBuf:1; /* if valid response, is pointer to large buf */ 421 bool largeBuf:1; /* if valid response, is pointer to large buf */
430 unsigned multiRsp:1; /* multiple trans2 responses for one request */ 422 bool multiRsp:1; /* multiple trans2 responses for one request */
431 unsigned multiEnd:1; /* both received */ 423 bool multiEnd:1; /* both received */
432}; 424};
433 425
434struct oplock_q_entry { 426struct oplock_q_entry {
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 50f9fdae19b3..a249a29109a5 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -59,8 +59,9 @@ extern int SendReceiveBlockingLock(const unsigned int xid,
59 struct smb_hdr *out_buf, 59 struct smb_hdr *out_buf,
60 int *bytes_returned); 60 int *bytes_returned);
61extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length); 61extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length);
62extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *); 62extern bool is_valid_oplock_break(struct smb_hdr *smb,
63extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); 63 struct TCP_Server_Info *);
64extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof);
64extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *); 65extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *);
65#ifdef CONFIG_CIFS_EXPERIMENTAL 66#ifdef CONFIG_CIFS_EXPERIMENTAL
66extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *); 67extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *);
@@ -187,12 +188,12 @@ extern int CIFSSMBSetAttrLegacy(int xid, struct cifsTconInfo *tcon,
187#endif /* possibly unneeded function */ 188#endif /* possibly unneeded function */
188extern int CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, 189extern int CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon,
189 const char *fileName, __u64 size, 190 const char *fileName, __u64 size,
190 int setAllocationSizeFlag, 191 bool setAllocationSizeFlag,
191 const struct nls_table *nls_codepage, 192 const struct nls_table *nls_codepage,
192 int remap_special_chars); 193 int remap_special_chars);
193extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, 194extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon,
194 __u64 size, __u16 fileHandle, __u32 opener_pid, 195 __u64 size, __u16 fileHandle, __u32 opener_pid,
195 int AllocSizeFlag); 196 bool AllocSizeFlag);
196extern int CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *pTcon, 197extern int CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *pTcon,
197 char *full_path, __u64 mode, __u64 uid, 198 char *full_path, __u64 mode, __u64 uid,
198 __u64 gid, dev_t dev, 199 __u64 gid, dev_t dev,
@@ -291,11 +292,11 @@ extern int CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
291 const __u16 netfid, const __u64 len, 292 const __u16 netfid, const __u64 len,
292 const __u64 offset, const __u32 numUnlock, 293 const __u64 offset, const __u32 numUnlock,
293 const __u32 numLock, const __u8 lockType, 294 const __u32 numLock, const __u8 lockType,
294 const int waitFlag); 295 const bool waitFlag);
295extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 296extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
296 const __u16 smb_file_id, const int get_flag, 297 const __u16 smb_file_id, const int get_flag,
297 const __u64 len, struct file_lock *, 298 const __u64 len, struct file_lock *,
298 const __u16 lock_type, const int waitFlag); 299 const __u16 lock_type, const bool waitFlag);
299extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); 300extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon);
300extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); 301extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses);
301 302
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 4728fa982a4e..cfd9750852b3 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -95,7 +95,7 @@ static void mark_open_files_invalid(struct cifsTconInfo *pTcon)
95 list_for_each_safe(tmp, tmp1, &pTcon->openFileList) { 95 list_for_each_safe(tmp, tmp1, &pTcon->openFileList) {
96 open_file = list_entry(tmp, struct cifsFileInfo, tlist); 96 open_file = list_entry(tmp, struct cifsFileInfo, tlist);
97 if (open_file) 97 if (open_file)
98 open_file->invalidHandle = TRUE; 98 open_file->invalidHandle = true;
99 } 99 }
100 write_unlock(&GlobalSMBSeslock); 100 write_unlock(&GlobalSMBSeslock);
101 /* BB Add call to invalidate_inodes(sb) for all superblocks mounted 101 /* BB Add call to invalidate_inodes(sb) for all superblocks mounted
@@ -141,7 +141,7 @@ small_smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
141 if (tcon->ses->server->tcpStatus == 141 if (tcon->ses->server->tcpStatus ==
142 CifsNeedReconnect) { 142 CifsNeedReconnect) {
143 /* on "soft" mounts we wait once */ 143 /* on "soft" mounts we wait once */
144 if ((tcon->retry == FALSE) || 144 if (!tcon->retry ||
145 (tcon->ses->status == CifsExiting)) { 145 (tcon->ses->status == CifsExiting)) {
146 cFYI(1, ("gave up waiting on " 146 cFYI(1, ("gave up waiting on "
147 "reconnect in smb_init")); 147 "reconnect in smb_init"));
@@ -289,7 +289,7 @@ smb_init(int smb_command, int wct, struct cifsTconInfo *tcon,
289 if (tcon->ses->server->tcpStatus == 289 if (tcon->ses->server->tcpStatus ==
290 CifsNeedReconnect) { 290 CifsNeedReconnect) {
291 /* on "soft" mounts we wait once */ 291 /* on "soft" mounts we wait once */
292 if ((tcon->retry == FALSE) || 292 if (!tcon->retry ||
293 (tcon->ses->status == CifsExiting)) { 293 (tcon->ses->status == CifsExiting)) {
294 cFYI(1, ("gave up waiting on " 294 cFYI(1, ("gave up waiting on "
295 "reconnect in smb_init")); 295 "reconnect in smb_init"));
@@ -1686,7 +1686,7 @@ int
1686CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, 1686CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1687 const __u16 smb_file_id, const __u64 len, 1687 const __u16 smb_file_id, const __u64 len,
1688 const __u64 offset, const __u32 numUnlock, 1688 const __u64 offset, const __u32 numUnlock,
1689 const __u32 numLock, const __u8 lockType, const int waitFlag) 1689 const __u32 numLock, const __u8 lockType, const bool waitFlag)
1690{ 1690{
1691 int rc = 0; 1691 int rc = 0;
1692 LOCK_REQ *pSMB = NULL; 1692 LOCK_REQ *pSMB = NULL;
@@ -1695,7 +1695,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1695 int timeout = 0; 1695 int timeout = 0;
1696 __u16 count; 1696 __u16 count;
1697 1697
1698 cFYI(1, ("CIFSSMBLock timeout %d numLock %d", waitFlag, numLock)); 1698 cFYI(1, ("CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock));
1699 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 1699 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB);
1700 1700
1701 if (rc) 1701 if (rc)
@@ -1706,7 +1706,7 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon,
1706 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) { 1706 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) {
1707 timeout = CIFS_ASYNC_OP; /* no response expected */ 1707 timeout = CIFS_ASYNC_OP; /* no response expected */
1708 pSMB->Timeout = 0; 1708 pSMB->Timeout = 0;
1709 } else if (waitFlag == TRUE) { 1709 } else if (waitFlag) {
1710 timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */ 1710 timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */
1711 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */ 1711 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
1712 } else { 1712 } else {
@@ -1756,7 +1756,7 @@ int
1756CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 1756CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon,
1757 const __u16 smb_file_id, const int get_flag, const __u64 len, 1757 const __u16 smb_file_id, const int get_flag, const __u64 len,
1758 struct file_lock *pLockData, const __u16 lock_type, 1758 struct file_lock *pLockData, const __u16 lock_type,
1759 const int waitFlag) 1759 const bool waitFlag)
1760{ 1760{
1761 struct smb_com_transaction2_sfi_req *pSMB = NULL; 1761 struct smb_com_transaction2_sfi_req *pSMB = NULL;
1762 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; 1762 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
@@ -3581,9 +3581,9 @@ findFirstRetry:
3581 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3581 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
3582 if (rc == 0) { 3582 if (rc == 0) {
3583 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) 3583 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE)
3584 psrch_inf->unicode = TRUE; 3584 psrch_inf->unicode = true;
3585 else 3585 else
3586 psrch_inf->unicode = FALSE; 3586 psrch_inf->unicode = false;
3587 3587
3588 psrch_inf->ntwrk_buf_start = (char *)pSMBr; 3588 psrch_inf->ntwrk_buf_start = (char *)pSMBr;
3589 psrch_inf->smallBuf = 0; 3589 psrch_inf->smallBuf = 0;
@@ -3594,9 +3594,9 @@ findFirstRetry:
3594 le16_to_cpu(pSMBr->t2.ParameterOffset)); 3594 le16_to_cpu(pSMBr->t2.ParameterOffset));
3595 3595
3596 if (parms->EndofSearch) 3596 if (parms->EndofSearch)
3597 psrch_inf->endOfSearch = TRUE; 3597 psrch_inf->endOfSearch = true;
3598 else 3598 else
3599 psrch_inf->endOfSearch = FALSE; 3599 psrch_inf->endOfSearch = false;
3600 3600
3601 psrch_inf->entries_in_buffer = 3601 psrch_inf->entries_in_buffer =
3602 le16_to_cpu(parms->SearchCount); 3602 le16_to_cpu(parms->SearchCount);
@@ -3624,7 +3624,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3624 3624
3625 cFYI(1, ("In FindNext")); 3625 cFYI(1, ("In FindNext"));
3626 3626
3627 if (psrch_inf->endOfSearch == TRUE) 3627 if (psrch_inf->endOfSearch)
3628 return -ENOENT; 3628 return -ENOENT;
3629 3629
3630 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 3630 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
@@ -3682,7 +3682,7 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3682 cifs_stats_inc(&tcon->num_fnext); 3682 cifs_stats_inc(&tcon->num_fnext);
3683 if (rc) { 3683 if (rc) {
3684 if (rc == -EBADF) { 3684 if (rc == -EBADF) {
3685 psrch_inf->endOfSearch = TRUE; 3685 psrch_inf->endOfSearch = true;
3686 rc = 0; /* search probably was closed at end of search*/ 3686 rc = 0; /* search probably was closed at end of search*/
3687 } else 3687 } else
3688 cFYI(1, ("FindNext returned = %d", rc)); 3688 cFYI(1, ("FindNext returned = %d", rc));
@@ -3692,9 +3692,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3692 if (rc == 0) { 3692 if (rc == 0) {
3693 /* BB fixme add lock for file (srch_info) struct here */ 3693 /* BB fixme add lock for file (srch_info) struct here */
3694 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) 3694 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE)
3695 psrch_inf->unicode = TRUE; 3695 psrch_inf->unicode = true;
3696 else 3696 else
3697 psrch_inf->unicode = FALSE; 3697 psrch_inf->unicode = false;
3698 response_data = (char *) &pSMBr->hdr.Protocol + 3698 response_data = (char *) &pSMBr->hdr.Protocol +
3699 le16_to_cpu(pSMBr->t2.ParameterOffset); 3699 le16_to_cpu(pSMBr->t2.ParameterOffset);
3700 parms = (T2_FNEXT_RSP_PARMS *)response_data; 3700 parms = (T2_FNEXT_RSP_PARMS *)response_data;
@@ -3709,9 +3709,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3709 psrch_inf->ntwrk_buf_start = (char *)pSMB; 3709 psrch_inf->ntwrk_buf_start = (char *)pSMB;
3710 psrch_inf->smallBuf = 0; 3710 psrch_inf->smallBuf = 0;
3711 if (parms->EndofSearch) 3711 if (parms->EndofSearch)
3712 psrch_inf->endOfSearch = TRUE; 3712 psrch_inf->endOfSearch = true;
3713 else 3713 else
3714 psrch_inf->endOfSearch = FALSE; 3714 psrch_inf->endOfSearch = false;
3715 psrch_inf->entries_in_buffer = 3715 psrch_inf->entries_in_buffer =
3716 le16_to_cpu(parms->SearchCount); 3716 le16_to_cpu(parms->SearchCount);
3717 psrch_inf->index_of_last_entry += 3717 psrch_inf->index_of_last_entry +=
@@ -4586,7 +4586,7 @@ QFSPosixRetry:
4586 4586
4587int 4587int
4588CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName, 4588CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName,
4589 __u64 size, int SetAllocation, 4589 __u64 size, bool SetAllocation,
4590 const struct nls_table *nls_codepage, int remap) 4590 const struct nls_table *nls_codepage, int remap)
4591{ 4591{
4592 struct smb_com_transaction2_spi_req *pSMB = NULL; 4592 struct smb_com_transaction2_spi_req *pSMB = NULL;
@@ -4675,7 +4675,7 @@ SetEOFRetry:
4675 4675
4676int 4676int
4677CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size, 4677CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, __u64 size,
4678 __u16 fid, __u32 pid_of_opener, int SetAllocation) 4678 __u16 fid, __u32 pid_of_opener, bool SetAllocation)
4679{ 4679{
4680 struct smb_com_transaction2_sfi_req *pSMB = NULL; 4680 struct smb_com_transaction2_sfi_req *pSMB = NULL;
4681 char *data_offset; 4681 char *data_offset;
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e17106730168..6c4332f8da6c 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -71,23 +71,23 @@ struct smb_vol {
71 mode_t file_mode; 71 mode_t file_mode;
72 mode_t dir_mode; 72 mode_t dir_mode;
73 unsigned secFlg; 73 unsigned secFlg;
74 unsigned rw:1; 74 bool rw:1;
75 unsigned retry:1; 75 bool retry:1;
76 unsigned intr:1; 76 bool intr:1;
77 unsigned setuids:1; 77 bool setuids:1;
78 unsigned override_uid:1; 78 bool override_uid:1;
79 unsigned override_gid:1; 79 bool override_gid:1;
80 unsigned noperm:1; 80 bool noperm:1;
81 unsigned no_psx_acl:1; /* set if posix acl support should be disabled */ 81 bool no_psx_acl:1; /* set if posix acl support should be disabled */
82 unsigned cifs_acl:1; 82 bool cifs_acl:1;
83 unsigned no_xattr:1; /* set if xattr (EA) support should be disabled*/ 83 bool no_xattr:1; /* set if xattr (EA) support should be disabled*/
84 unsigned server_ino:1; /* use inode numbers from server ie UniqueId */ 84 bool server_ino:1; /* use inode numbers from server ie UniqueId */
85 unsigned direct_io:1; 85 bool direct_io:1;
86 unsigned remap:1; /* set to remap seven reserved chars in filenames */ 86 bool remap:1; /* set to remap seven reserved chars in filenames */
87 unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ 87 bool posix_paths:1; /* unset to not ask for posix pathnames. */
88 unsigned no_linux_ext:1; 88 bool no_linux_ext:1;
89 unsigned sfu_emul:1; 89 bool sfu_emul:1;
90 unsigned nullauth:1; /* attempt to authenticate with null user */ 90 bool nullauth:1; /* attempt to authenticate with null user */
91 unsigned nocase; /* request case insensitive filenames */ 91 unsigned nocase; /* request case insensitive filenames */
92 unsigned nobrl; /* disable sending byte range locks to srv */ 92 unsigned nobrl; /* disable sending byte range locks to srv */
93 unsigned int rsize; 93 unsigned int rsize;
@@ -345,8 +345,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
345 struct task_struct *task_to_wake = NULL; 345 struct task_struct *task_to_wake = NULL;
346 struct mid_q_entry *mid_entry; 346 struct mid_q_entry *mid_entry;
347 char temp; 347 char temp;
348 int isLargeBuf = FALSE; 348 bool isLargeBuf = false;
349 int isMultiRsp; 349 bool isMultiRsp;
350 int reconnect; 350 int reconnect;
351 351
352 current->flags |= PF_MEMALLOC; 352 current->flags |= PF_MEMALLOC;
@@ -390,8 +390,8 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
390 } else /* if existing small buf clear beginning */ 390 } else /* if existing small buf clear beginning */
391 memset(smallbuf, 0, sizeof(struct smb_hdr)); 391 memset(smallbuf, 0, sizeof(struct smb_hdr));
392 392
393 isLargeBuf = FALSE; 393 isLargeBuf = false;
394 isMultiRsp = FALSE; 394 isMultiRsp = false;
395 smb_buffer = smallbuf; 395 smb_buffer = smallbuf;
396 iov.iov_base = smb_buffer; 396 iov.iov_base = smb_buffer;
397 iov.iov_len = 4; 397 iov.iov_len = 4;
@@ -517,7 +517,7 @@ incomplete_rcv:
517 reconnect = 0; 517 reconnect = 0;
518 518
519 if (pdu_length > MAX_CIFS_SMALL_BUFFER_SIZE - 4) { 519 if (pdu_length > MAX_CIFS_SMALL_BUFFER_SIZE - 4) {
520 isLargeBuf = TRUE; 520 isLargeBuf = true;
521 memcpy(bigbuf, smallbuf, 4); 521 memcpy(bigbuf, smallbuf, 4);
522 smb_buffer = bigbuf; 522 smb_buffer = bigbuf;
523 } 523 }
@@ -582,16 +582,18 @@ incomplete_rcv:
582 (mid_entry->command == smb_buffer->Command)) { 582 (mid_entry->command == smb_buffer->Command)) {
583 if (check2ndT2(smb_buffer,server->maxBuf) > 0) { 583 if (check2ndT2(smb_buffer,server->maxBuf) > 0) {
584 /* We have a multipart transact2 resp */ 584 /* We have a multipart transact2 resp */
585 isMultiRsp = TRUE; 585 isMultiRsp = true;
586 if (mid_entry->resp_buf) { 586 if (mid_entry->resp_buf) {
587 /* merge response - fix up 1st*/ 587 /* merge response - fix up 1st*/
588 if (coalesce_t2(smb_buffer, 588 if (coalesce_t2(smb_buffer,
589 mid_entry->resp_buf)) { 589 mid_entry->resp_buf)) {
590 mid_entry->multiRsp = 1; 590 mid_entry->multiRsp =
591 true;
591 break; 592 break;
592 } else { 593 } else {
593 /* all parts received */ 594 /* all parts received */
594 mid_entry->multiEnd = 1; 595 mid_entry->multiEnd =
596 true;
595 goto multi_t2_fnd; 597 goto multi_t2_fnd;
596 } 598 }
597 } else { 599 } else {
@@ -603,17 +605,15 @@ incomplete_rcv:
603 /* Have first buffer */ 605 /* Have first buffer */
604 mid_entry->resp_buf = 606 mid_entry->resp_buf =
605 smb_buffer; 607 smb_buffer;
606 mid_entry->largeBuf = 1; 608 mid_entry->largeBuf =
609 true;
607 bigbuf = NULL; 610 bigbuf = NULL;
608 } 611 }
609 } 612 }
610 break; 613 break;
611 } 614 }
612 mid_entry->resp_buf = smb_buffer; 615 mid_entry->resp_buf = smb_buffer;
613 if (isLargeBuf) 616 mid_entry->largeBuf = isLargeBuf;
614 mid_entry->largeBuf = 1;
615 else
616 mid_entry->largeBuf = 0;
617multi_t2_fnd: 617multi_t2_fnd:
618 task_to_wake = mid_entry->tsk; 618 task_to_wake = mid_entry->tsk;
619 mid_entry->midState = MID_RESPONSE_RECEIVED; 619 mid_entry->midState = MID_RESPONSE_RECEIVED;
@@ -638,8 +638,8 @@ multi_t2_fnd:
638 smallbuf = NULL; 638 smallbuf = NULL;
639 } 639 }
640 wake_up_process(task_to_wake); 640 wake_up_process(task_to_wake);
641 } else if ((is_valid_oplock_break(smb_buffer, server) == FALSE) 641 } else if (!is_valid_oplock_break(smb_buffer, server) &&
642 && (isMultiRsp == FALSE)) { 642 !isMultiRsp) {
643 cERROR(1, ("No task to wake, unknown frame received! " 643 cERROR(1, ("No task to wake, unknown frame received! "
644 "NumMids %d", midCount.counter)); 644 "NumMids %d", midCount.counter));
645 cifs_dump_mem("Received Data is: ", (char *)smb_buffer, 645 cifs_dump_mem("Received Data is: ", (char *)smb_buffer,
@@ -825,7 +825,7 @@ cifs_parse_mount_options(char *options, const char *devname,
825 vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); 825 vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP);
826 826
827 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ 827 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */
828 vol->rw = TRUE; 828 vol->rw = true;
829 /* default is always to request posix paths. */ 829 /* default is always to request posix paths. */
830 vol->posix_paths = 1; 830 vol->posix_paths = 1;
831 831
@@ -1181,7 +1181,7 @@ cifs_parse_mount_options(char *options, const char *devname,
1181 } else if (strnicmp(data, "guest", 5) == 0) { 1181 } else if (strnicmp(data, "guest", 5) == 0) {
1182 /* ignore */ 1182 /* ignore */
1183 } else if (strnicmp(data, "rw", 2) == 0) { 1183 } else if (strnicmp(data, "rw", 2) == 0) {
1184 vol->rw = TRUE; 1184 vol->rw = true;
1185 } else if ((strnicmp(data, "suid", 4) == 0) || 1185 } else if ((strnicmp(data, "suid", 4) == 0) ||
1186 (strnicmp(data, "nosuid", 6) == 0) || 1186 (strnicmp(data, "nosuid", 6) == 0) ||
1187 (strnicmp(data, "exec", 4) == 0) || 1187 (strnicmp(data, "exec", 4) == 0) ||
@@ -1197,7 +1197,7 @@ cifs_parse_mount_options(char *options, const char *devname,
1197 is ok to just ignore them */ 1197 is ok to just ignore them */
1198 continue; 1198 continue;
1199 } else if (strnicmp(data, "ro", 2) == 0) { 1199 } else if (strnicmp(data, "ro", 2) == 0) {
1200 vol->rw = FALSE; 1200 vol->rw = false;
1201 } else if (strnicmp(data, "hard", 4) == 0) { 1201 } else if (strnicmp(data, "hard", 4) == 0) {
1202 vol->retry = 1; 1202 vol->retry = 1;
1203 } else if (strnicmp(data, "soft", 4) == 0) { 1203 } else if (strnicmp(data, "soft", 4) == 0) {
@@ -2602,7 +2602,7 @@ sesssetup_nomem: /* do not return an error on nomem for the info strings,
2602 2602
2603static int 2603static int
2604CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, 2604CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2605 struct cifsSesInfo *ses, int *pNTLMv2_flag, 2605 struct cifsSesInfo *ses, bool *pNTLMv2_flag,
2606 const struct nls_table *nls_codepage) 2606 const struct nls_table *nls_codepage)
2607{ 2607{
2608 struct smb_hdr *smb_buffer; 2608 struct smb_hdr *smb_buffer;
@@ -2625,7 +2625,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2625 if (ses == NULL) 2625 if (ses == NULL)
2626 return -EINVAL; 2626 return -EINVAL;
2627 domain = ses->domainName; 2627 domain = ses->domainName;
2628 *pNTLMv2_flag = FALSE; 2628 *pNTLMv2_flag = false;
2629 smb_buffer = cifs_buf_get(); 2629 smb_buffer = cifs_buf_get();
2630 if (smb_buffer == NULL) { 2630 if (smb_buffer == NULL) {
2631 return -ENOMEM; 2631 return -ENOMEM;
@@ -2778,7 +2778,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2778 CIFS_CRYPTO_KEY_SIZE); 2778 CIFS_CRYPTO_KEY_SIZE);
2779 if (SecurityBlob2->NegotiateFlags & 2779 if (SecurityBlob2->NegotiateFlags &
2780 cpu_to_le32(NTLMSSP_NEGOTIATE_NTLMV2)) 2780 cpu_to_le32(NTLMSSP_NEGOTIATE_NTLMV2))
2781 *pNTLMv2_flag = TRUE; 2781 *pNTLMv2_flag = true;
2782 2782
2783 if ((SecurityBlob2->NegotiateFlags & 2783 if ((SecurityBlob2->NegotiateFlags &
2784 cpu_to_le32(NTLMSSP_NEGOTIATE_ALWAYS_SIGN)) 2784 cpu_to_le32(NTLMSSP_NEGOTIATE_ALWAYS_SIGN))
@@ -2939,7 +2939,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
2939} 2939}
2940static int 2940static int
2941CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, 2941CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
2942 char *ntlm_session_key, int ntlmv2_flag, 2942 char *ntlm_session_key, bool ntlmv2_flag,
2943 const struct nls_table *nls_codepage) 2943 const struct nls_table *nls_codepage)
2944{ 2944{
2945 struct smb_hdr *smb_buffer; 2945 struct smb_hdr *smb_buffer;
@@ -3569,7 +3569,7 @@ int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
3569{ 3569{
3570 int rc = 0; 3570 int rc = 0;
3571 char ntlm_session_key[CIFS_SESS_KEY_SIZE]; 3571 char ntlm_session_key[CIFS_SESS_KEY_SIZE];
3572 int ntlmv2_flag = FALSE; 3572 bool ntlmv2_flag = false;
3573 int first_time = 0; 3573 int first_time = 0;
3574 3574
3575 /* what if server changes its buffer size after dropping the session? */ 3575 /* what if server changes its buffer size after dropping the session? */
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 0f5c62ba4038..6ed775986be9 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -130,7 +130,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
130 struct cifsFileInfo *pCifsFile = NULL; 130 struct cifsFileInfo *pCifsFile = NULL;
131 struct cifsInodeInfo *pCifsInode; 131 struct cifsInodeInfo *pCifsInode;
132 int disposition = FILE_OVERWRITE_IF; 132 int disposition = FILE_OVERWRITE_IF;
133 int write_only = FALSE; 133 bool write_only = false;
134 134
135 xid = GetXid(); 135 xid = GetXid();
136 136
@@ -152,7 +152,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
152 if (oflags & FMODE_WRITE) { 152 if (oflags & FMODE_WRITE) {
153 desiredAccess |= GENERIC_WRITE; 153 desiredAccess |= GENERIC_WRITE;
154 if (!(oflags & FMODE_READ)) 154 if (!(oflags & FMODE_READ))
155 write_only = TRUE; 155 write_only = true;
156 } 156 }
157 157
158 if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) 158 if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
@@ -254,7 +254,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
254 d_instantiate(direntry, newinode); 254 d_instantiate(direntry, newinode);
255 } 255 }
256 if ((nd == NULL /* nfsd case - nfs srv does not set nd */) || 256 if ((nd == NULL /* nfsd case - nfs srv does not set nd */) ||
257 ((nd->flags & LOOKUP_OPEN) == FALSE)) { 257 (!(nd->flags & LOOKUP_OPEN))) {
258 /* mknod case - do not leave file open */ 258 /* mknod case - do not leave file open */
259 CIFSSMBClose(xid, pTcon, fileHandle); 259 CIFSSMBClose(xid, pTcon, fileHandle);
260 } else if (newinode) { 260 } else if (newinode) {
@@ -266,8 +266,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
266 pCifsFile->netfid = fileHandle; 266 pCifsFile->netfid = fileHandle;
267 pCifsFile->pid = current->tgid; 267 pCifsFile->pid = current->tgid;
268 pCifsFile->pInode = newinode; 268 pCifsFile->pInode = newinode;
269 pCifsFile->invalidHandle = FALSE; 269 pCifsFile->invalidHandle = false;
270 pCifsFile->closePend = FALSE; 270 pCifsFile->closePend = false;
271 init_MUTEX(&pCifsFile->fh_sem); 271 init_MUTEX(&pCifsFile->fh_sem);
272 mutex_init(&pCifsFile->lock_mutex); 272 mutex_init(&pCifsFile->lock_mutex);
273 INIT_LIST_HEAD(&pCifsFile->llist); 273 INIT_LIST_HEAD(&pCifsFile->llist);
@@ -280,7 +280,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
280 pCifsInode = CIFS_I(newinode); 280 pCifsInode = CIFS_I(newinode);
281 if (pCifsInode) { 281 if (pCifsInode) {
282 /* if readable file instance put first in list*/ 282 /* if readable file instance put first in list*/
283 if (write_only == TRUE) { 283 if (write_only) {
284 list_add_tail(&pCifsFile->flist, 284 list_add_tail(&pCifsFile->flist,
285 &pCifsInode->openFileList); 285 &pCifsInode->openFileList);
286 } else { 286 } else {
@@ -288,12 +288,12 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
288 &pCifsInode->openFileList); 288 &pCifsInode->openFileList);
289 } 289 }
290 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { 290 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
291 pCifsInode->clientCanCacheAll = TRUE; 291 pCifsInode->clientCanCacheAll = true;
292 pCifsInode->clientCanCacheRead = TRUE; 292 pCifsInode->clientCanCacheRead = true;
293 cFYI(1, ("Exclusive Oplock inode %p", 293 cFYI(1, ("Exclusive Oplock inode %p",
294 newinode)); 294 newinode));
295 } else if ((oplock & 0xF) == OPLOCK_READ) 295 } else if ((oplock & 0xF) == OPLOCK_READ)
296 pCifsInode->clientCanCacheRead = TRUE; 296 pCifsInode->clientCanCacheRead = true;
297 } 297 }
298 write_unlock(&GlobalSMBSeslock); 298 write_unlock(&GlobalSMBSeslock);
299 } 299 }
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index 7d1d5aa4c430..5a57581eb4b2 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -68,7 +68,7 @@ int cifs_dir_notify(struct file *file, unsigned long arg)
68{ 68{
69 int xid; 69 int xid;
70 int rc = -EINVAL; 70 int rc = -EINVAL;
71 int oplock = FALSE; 71 int oplock = 0;
72 struct cifs_sb_info *cifs_sb; 72 struct cifs_sb_info *cifs_sb;
73 struct cifsTconInfo *pTcon; 73 struct cifsTconInfo *pTcon;
74 char *full_path = NULL; 74 char *full_path = NULL;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 40b690073fc1..31a0a33b9d95 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -51,8 +51,8 @@ static inline struct cifsFileInfo *cifs_init_private(
51 INIT_LIST_HEAD(&private_data->llist); 51 INIT_LIST_HEAD(&private_data->llist);
52 private_data->pfile = file; /* needed for writepage */ 52 private_data->pfile = file; /* needed for writepage */
53 private_data->pInode = inode; 53 private_data->pInode = inode;
54 private_data->invalidHandle = FALSE; 54 private_data->invalidHandle = false;
55 private_data->closePend = FALSE; 55 private_data->closePend = false;
56 /* we have to track num writers to the inode, since writepages 56 /* we have to track num writers to the inode, since writepages
57 does not tell us which handle the write is for so there can 57 does not tell us which handle the write is for so there can
58 be a close (overlapping with write) of the filehandle that 58 be a close (overlapping with write) of the filehandle that
@@ -148,12 +148,12 @@ client_can_cache:
148 full_path, buf, inode->i_sb, xid, NULL); 148 full_path, buf, inode->i_sb, xid, NULL);
149 149
150 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { 150 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
151 pCifsInode->clientCanCacheAll = TRUE; 151 pCifsInode->clientCanCacheAll = true;
152 pCifsInode->clientCanCacheRead = TRUE; 152 pCifsInode->clientCanCacheRead = true;
153 cFYI(1, ("Exclusive Oplock granted on inode %p", 153 cFYI(1, ("Exclusive Oplock granted on inode %p",
154 file->f_path.dentry->d_inode)); 154 file->f_path.dentry->d_inode));
155 } else if ((*oplock & 0xF) == OPLOCK_READ) 155 } else if ((*oplock & 0xF) == OPLOCK_READ)
156 pCifsInode->clientCanCacheRead = TRUE; 156 pCifsInode->clientCanCacheRead = true;
157 157
158 return rc; 158 return rc;
159} 159}
@@ -247,7 +247,7 @@ int cifs_open(struct inode *inode, struct file *file)
247 if (oplockEnabled) 247 if (oplockEnabled)
248 oplock = REQ_OPLOCK; 248 oplock = REQ_OPLOCK;
249 else 249 else
250 oplock = FALSE; 250 oplock = 0;
251 251
252 /* BB pass O_SYNC flag through on file attributes .. BB */ 252 /* BB pass O_SYNC flag through on file attributes .. BB */
253 253
@@ -339,7 +339,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile)
339 return rc; 339 return rc;
340} 340}
341 341
342static int cifs_reopen_file(struct file *file, int can_flush) 342static int cifs_reopen_file(struct file *file, bool can_flush)
343{ 343{
344 int rc = -EACCES; 344 int rc = -EACCES;
345 int xid, oplock; 345 int xid, oplock;
@@ -360,7 +360,7 @@ static int cifs_reopen_file(struct file *file, int can_flush)
360 360
361 xid = GetXid(); 361 xid = GetXid();
362 down(&pCifsFile->fh_sem); 362 down(&pCifsFile->fh_sem);
363 if (pCifsFile->invalidHandle == FALSE) { 363 if (!pCifsFile->invalidHandle) {
364 up(&pCifsFile->fh_sem); 364 up(&pCifsFile->fh_sem);
365 FreeXid(xid); 365 FreeXid(xid);
366 return 0; 366 return 0;
@@ -404,7 +404,7 @@ reopen_error_exit:
404 if (oplockEnabled) 404 if (oplockEnabled)
405 oplock = REQ_OPLOCK; 405 oplock = REQ_OPLOCK;
406 else 406 else
407 oplock = FALSE; 407 oplock = 0;
408 408
409 /* Can not refresh inode by passing in file_info buf to be returned 409 /* Can not refresh inode by passing in file_info buf to be returned
410 by SMBOpen and then calling get_inode_info with returned buf 410 by SMBOpen and then calling get_inode_info with returned buf
@@ -422,7 +422,7 @@ reopen_error_exit:
422 cFYI(1, ("oplock: %d", oplock)); 422 cFYI(1, ("oplock: %d", oplock));
423 } else { 423 } else {
424 pCifsFile->netfid = netfid; 424 pCifsFile->netfid = netfid;
425 pCifsFile->invalidHandle = FALSE; 425 pCifsFile->invalidHandle = false;
426 up(&pCifsFile->fh_sem); 426 up(&pCifsFile->fh_sem);
427 pCifsInode = CIFS_I(inode); 427 pCifsInode = CIFS_I(inode);
428 if (pCifsInode) { 428 if (pCifsInode) {
@@ -432,8 +432,8 @@ reopen_error_exit:
432 CIFS_I(inode)->write_behind_rc = rc; 432 CIFS_I(inode)->write_behind_rc = rc;
433 /* temporarily disable caching while we 433 /* temporarily disable caching while we
434 go to server to get inode info */ 434 go to server to get inode info */
435 pCifsInode->clientCanCacheAll = FALSE; 435 pCifsInode->clientCanCacheAll = false;
436 pCifsInode->clientCanCacheRead = FALSE; 436 pCifsInode->clientCanCacheRead = false;
437 if (pTcon->unix_ext) 437 if (pTcon->unix_ext)
438 rc = cifs_get_inode_info_unix(&inode, 438 rc = cifs_get_inode_info_unix(&inode,
439 full_path, inode->i_sb, xid); 439 full_path, inode->i_sb, xid);
@@ -448,16 +448,16 @@ reopen_error_exit:
448 we can not go to the server to get the new inod 448 we can not go to the server to get the new inod
449 info */ 449 info */
450 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { 450 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
451 pCifsInode->clientCanCacheAll = TRUE; 451 pCifsInode->clientCanCacheAll = true;
452 pCifsInode->clientCanCacheRead = TRUE; 452 pCifsInode->clientCanCacheRead = true;
453 cFYI(1, ("Exclusive Oplock granted on inode %p", 453 cFYI(1, ("Exclusive Oplock granted on inode %p",
454 file->f_path.dentry->d_inode)); 454 file->f_path.dentry->d_inode));
455 } else if ((oplock & 0xF) == OPLOCK_READ) { 455 } else if ((oplock & 0xF) == OPLOCK_READ) {
456 pCifsInode->clientCanCacheRead = TRUE; 456 pCifsInode->clientCanCacheRead = true;
457 pCifsInode->clientCanCacheAll = FALSE; 457 pCifsInode->clientCanCacheAll = false;
458 } else { 458 } else {
459 pCifsInode->clientCanCacheRead = FALSE; 459 pCifsInode->clientCanCacheRead = false;
460 pCifsInode->clientCanCacheAll = FALSE; 460 pCifsInode->clientCanCacheAll = false;
461 } 461 }
462 cifs_relock_file(pCifsFile); 462 cifs_relock_file(pCifsFile);
463 } 463 }
@@ -484,7 +484,7 @@ int cifs_close(struct inode *inode, struct file *file)
484 if (pSMBFile) { 484 if (pSMBFile) {
485 struct cifsLockInfo *li, *tmp; 485 struct cifsLockInfo *li, *tmp;
486 486
487 pSMBFile->closePend = TRUE; 487 pSMBFile->closePend = true;
488 if (pTcon) { 488 if (pTcon) {
489 /* no sense reconnecting to close a file that is 489 /* no sense reconnecting to close a file that is
490 already closed */ 490 already closed */
@@ -553,8 +553,8 @@ int cifs_close(struct inode *inode, struct file *file)
553 cFYI(1, ("closing last open instance for inode %p", inode)); 553 cFYI(1, ("closing last open instance for inode %p", inode));
554 /* if the file is not open we do not know if we can cache info 554 /* if the file is not open we do not know if we can cache info
555 on this inode, much less write behind and read ahead */ 555 on this inode, much less write behind and read ahead */
556 CIFS_I(inode)->clientCanCacheRead = FALSE; 556 CIFS_I(inode)->clientCanCacheRead = false;
557 CIFS_I(inode)->clientCanCacheAll = FALSE; 557 CIFS_I(inode)->clientCanCacheAll = false;
558 } 558 }
559 read_unlock(&GlobalSMBSeslock); 559 read_unlock(&GlobalSMBSeslock);
560 if ((rc == 0) && CIFS_I(inode)->write_behind_rc) 560 if ((rc == 0) && CIFS_I(inode)->write_behind_rc)
@@ -583,9 +583,9 @@ int cifs_closedir(struct inode *inode, struct file *file)
583 pTcon = cifs_sb->tcon; 583 pTcon = cifs_sb->tcon;
584 584
585 cFYI(1, ("Freeing private data in close dir")); 585 cFYI(1, ("Freeing private data in close dir"));
586 if ((pCFileStruct->srch_inf.endOfSearch == FALSE) && 586 if (!pCFileStruct->srch_inf.endOfSearch &&
587 (pCFileStruct->invalidHandle == FALSE)) { 587 !pCFileStruct->invalidHandle) {
588 pCFileStruct->invalidHandle = TRUE; 588 pCFileStruct->invalidHandle = true;
589 rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); 589 rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid);
590 cFYI(1, ("Closing uncompleted readdir with rc %d", 590 cFYI(1, ("Closing uncompleted readdir with rc %d",
591 rc)); 591 rc));
@@ -637,12 +637,12 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
637 __u32 numLock = 0; 637 __u32 numLock = 0;
638 __u32 numUnlock = 0; 638 __u32 numUnlock = 0;
639 __u64 length; 639 __u64 length;
640 int wait_flag = FALSE; 640 bool wait_flag = false;
641 struct cifs_sb_info *cifs_sb; 641 struct cifs_sb_info *cifs_sb;
642 struct cifsTconInfo *pTcon; 642 struct cifsTconInfo *pTcon;
643 __u16 netfid; 643 __u16 netfid;
644 __u8 lockType = LOCKING_ANDX_LARGE_FILES; 644 __u8 lockType = LOCKING_ANDX_LARGE_FILES;
645 int posix_locking; 645 bool posix_locking;
646 646
647 length = 1 + pfLock->fl_end - pfLock->fl_start; 647 length = 1 + pfLock->fl_end - pfLock->fl_start;
648 rc = -EACCES; 648 rc = -EACCES;
@@ -659,7 +659,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
659 cFYI(1, ("Flock")); 659 cFYI(1, ("Flock"));
660 if (pfLock->fl_flags & FL_SLEEP) { 660 if (pfLock->fl_flags & FL_SLEEP) {
661 cFYI(1, ("Blocking lock")); 661 cFYI(1, ("Blocking lock"));
662 wait_flag = TRUE; 662 wait_flag = true;
663 } 663 }
664 if (pfLock->fl_flags & FL_ACCESS) 664 if (pfLock->fl_flags & FL_ACCESS)
665 cFYI(1, ("Process suspended by mandatory locking - " 665 cFYI(1, ("Process suspended by mandatory locking - "
@@ -794,7 +794,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
794 stored_rc = CIFSSMBLock(xid, pTcon, 794 stored_rc = CIFSSMBLock(xid, pTcon,
795 netfid, 795 netfid,
796 li->length, li->offset, 796 li->length, li->offset,
797 1, 0, li->type, FALSE); 797 1, 0, li->type, false);
798 if (stored_rc) 798 if (stored_rc)
799 rc = stored_rc; 799 rc = stored_rc;
800 800
@@ -866,7 +866,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
866 filemap_fdatawait from here so tell 866 filemap_fdatawait from here so tell
867 reopen_file not to flush data to server 867 reopen_file not to flush data to server
868 now */ 868 now */
869 rc = cifs_reopen_file(file, FALSE); 869 rc = cifs_reopen_file(file, false);
870 if (rc != 0) 870 if (rc != 0)
871 break; 871 break;
872 } 872 }
@@ -966,7 +966,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
966 filemap_fdatawait from here so tell 966 filemap_fdatawait from here so tell
967 reopen_file not to flush data to 967 reopen_file not to flush data to
968 server now */ 968 server now */
969 rc = cifs_reopen_file(file, FALSE); 969 rc = cifs_reopen_file(file, false);
970 if (rc != 0) 970 if (rc != 0)
971 break; 971 break;
972 } 972 }
@@ -1093,7 +1093,7 @@ refind_writable:
1093 1093
1094 read_unlock(&GlobalSMBSeslock); 1094 read_unlock(&GlobalSMBSeslock);
1095 /* Had to unlock since following call can block */ 1095 /* Had to unlock since following call can block */
1096 rc = cifs_reopen_file(open_file->pfile, FALSE); 1096 rc = cifs_reopen_file(open_file->pfile, false);
1097 if (!rc) { 1097 if (!rc) {
1098 if (!open_file->closePend) 1098 if (!open_file->closePend)
1099 return open_file; 1099 return open_file;
@@ -1608,7 +1608,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1608 int buf_type = CIFS_NO_BUFFER; 1608 int buf_type = CIFS_NO_BUFFER;
1609 if ((open_file->invalidHandle) && 1609 if ((open_file->invalidHandle) &&
1610 (!open_file->closePend)) { 1610 (!open_file->closePend)) {
1611 rc = cifs_reopen_file(file, TRUE); 1611 rc = cifs_reopen_file(file, true);
1612 if (rc != 0) 1612 if (rc != 0)
1613 break; 1613 break;
1614 } 1614 }
@@ -1693,7 +1693,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
1693 while (rc == -EAGAIN) { 1693 while (rc == -EAGAIN) {
1694 if ((open_file->invalidHandle) && 1694 if ((open_file->invalidHandle) &&
1695 (!open_file->closePend)) { 1695 (!open_file->closePend)) {
1696 rc = cifs_reopen_file(file, TRUE); 1696 rc = cifs_reopen_file(file, true);
1697 if (rc != 0) 1697 if (rc != 0)
1698 break; 1698 break;
1699 } 1699 }
@@ -1850,7 +1850,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1850 while (rc == -EAGAIN) { 1850 while (rc == -EAGAIN) {
1851 if ((open_file->invalidHandle) && 1851 if ((open_file->invalidHandle) &&
1852 (!open_file->closePend)) { 1852 (!open_file->closePend)) {
1853 rc = cifs_reopen_file(file, TRUE); 1853 rc = cifs_reopen_file(file, true);
1854 if (rc != 0) 1854 if (rc != 0)
1855 break; 1855 break;
1856 } 1856 }
@@ -2009,10 +2009,10 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode)
2009 refreshing the inode only on increases in the file size 2009 refreshing the inode only on increases in the file size
2010 but this is tricky to do without racing with writebehind 2010 but this is tricky to do without racing with writebehind
2011 page caching in the current Linux kernel design */ 2011 page caching in the current Linux kernel design */
2012int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) 2012bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
2013{ 2013{
2014 if (!cifsInode) 2014 if (!cifsInode)
2015 return 1; 2015 return true;
2016 2016
2017 if (is_inode_writable(cifsInode)) { 2017 if (is_inode_writable(cifsInode)) {
2018 /* This inode is open for write at least once */ 2018 /* This inode is open for write at least once */
@@ -2022,15 +2022,15 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
2022 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { 2022 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
2023 /* since no page cache to corrupt on directio 2023 /* since no page cache to corrupt on directio
2024 we can change size safely */ 2024 we can change size safely */
2025 return 1; 2025 return true;
2026 } 2026 }
2027 2027
2028 if (i_size_read(&cifsInode->vfs_inode) < end_of_file) 2028 if (i_size_read(&cifsInode->vfs_inode) < end_of_file)
2029 return 1; 2029 return true;
2030 2030
2031 return 0; 2031 return false;
2032 } else 2032 } else
2033 return 1; 2033 return true;
2034} 2034}
2035 2035
2036static int cifs_prepare_write(struct file *file, struct page *page, 2036static int cifs_prepare_write(struct file *file, struct page *page,
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e1031b9e2c55..8eaa9e72fe8e 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -281,7 +281,7 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
281 struct cifs_sb_info *cifs_sb, int xid) 281 struct cifs_sb_info *cifs_sb, int xid)
282{ 282{
283 int rc; 283 int rc;
284 int oplock = FALSE; 284 int oplock = 0;
285 __u16 netfid; 285 __u16 netfid;
286 struct cifsTconInfo *pTcon = cifs_sb->tcon; 286 struct cifsTconInfo *pTcon = cifs_sb->tcon;
287 char buf[24]; 287 char buf[24];
@@ -389,7 +389,7 @@ int cifs_get_inode_info(struct inode **pinode,
389 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 389 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
390 const unsigned char *full_path = NULL; 390 const unsigned char *full_path = NULL;
391 char *buf = NULL; 391 char *buf = NULL;
392 int adjustTZ = FALSE; 392 bool adjustTZ = bool;
393 bool is_dfs_referral = false; 393 bool is_dfs_referral = false;
394 394
395 pTcon = cifs_sb->tcon; 395 pTcon = cifs_sb->tcon;
@@ -425,7 +425,7 @@ try_again_CIFSSMBQPathInfo:
425 pfindData, cifs_sb->local_nls, 425 pfindData, cifs_sb->local_nls,
426 cifs_sb->mnt_cifs_flags & 426 cifs_sb->mnt_cifs_flags &
427 CIFS_MOUNT_MAP_SPECIAL_CHR); 427 CIFS_MOUNT_MAP_SPECIAL_CHR);
428 adjustTZ = TRUE; 428 adjustTZ = true;
429 } 429 }
430 } 430 }
431 /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ 431 /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */
@@ -703,7 +703,7 @@ psx_del_no_retry:
703 } else if (rc == -ENOENT) { 703 } else if (rc == -ENOENT) {
704 d_drop(direntry); 704 d_drop(direntry);
705 } else if (rc == -ETXTBSY) { 705 } else if (rc == -ETXTBSY) {
706 int oplock = FALSE; 706 int oplock = 0;
707 __u16 netfid; 707 __u16 netfid;
708 708
709 rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, DELETE, 709 rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, DELETE,
@@ -736,7 +736,7 @@ psx_del_no_retry:
736 rc = -EOPNOTSUPP; 736 rc = -EOPNOTSUPP;
737 737
738 if (rc == -EOPNOTSUPP) { 738 if (rc == -EOPNOTSUPP) {
739 int oplock = FALSE; 739 int oplock = 0;
740 __u16 netfid; 740 __u16 netfid;
741 /* rc = CIFSSMBSetAttrLegacy(xid, pTcon, 741 /* rc = CIFSSMBSetAttrLegacy(xid, pTcon,
742 full_path, 742 full_path,
@@ -774,7 +774,7 @@ psx_del_no_retry:
774 if (direntry->d_inode) 774 if (direntry->d_inode)
775 drop_nlink(direntry->d_inode); 775 drop_nlink(direntry->d_inode);
776 } else if (rc == -ETXTBSY) { 776 } else if (rc == -ETXTBSY) {
777 int oplock = FALSE; 777 int oplock = 0;
778 __u16 netfid; 778 __u16 netfid;
779 779
780 rc = CIFSSMBOpen(xid, pTcon, full_path, 780 rc = CIFSSMBOpen(xid, pTcon, full_path,
@@ -1149,7 +1149,7 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
1149 cFYI(1, ("rename rc %d", rc)); 1149 cFYI(1, ("rename rc %d", rc));
1150 1150
1151 if ((rc == -EIO) || (rc == -EEXIST)) { 1151 if ((rc == -EIO) || (rc == -EEXIST)) {
1152 int oplock = FALSE; 1152 int oplock = 0;
1153 __u16 netfid; 1153 __u16 netfid;
1154 1154
1155 /* BB FIXME Is Generic Read correct for rename? */ 1155 /* BB FIXME Is Generic Read correct for rename? */
@@ -1186,7 +1186,7 @@ int cifs_revalidate(struct dentry *direntry)
1186 struct cifsInodeInfo *cifsInode; 1186 struct cifsInodeInfo *cifsInode;
1187 loff_t local_size; 1187 loff_t local_size;
1188 struct timespec local_mtime; 1188 struct timespec local_mtime;
1189 int invalidate_inode = FALSE; 1189 bool invalidate_inode = false;
1190 1190
1191 if (direntry->d_inode == NULL) 1191 if (direntry->d_inode == NULL)
1192 return -ENOENT; 1192 return -ENOENT;
@@ -1268,7 +1268,7 @@ int cifs_revalidate(struct dentry *direntry)
1268 only ones who could have modified the file and the 1268 only ones who could have modified the file and the
1269 server copy is staler than ours */ 1269 server copy is staler than ours */
1270 } else { 1270 } else {
1271 invalidate_inode = TRUE; 1271 invalidate_inode = true;
1272 } 1272 }
1273 } 1273 }
1274 1274
@@ -1402,8 +1402,8 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1402 int rc = -EACCES; 1402 int rc = -EACCES;
1403 struct cifsFileInfo *open_file = NULL; 1403 struct cifsFileInfo *open_file = NULL;
1404 FILE_BASIC_INFO time_buf; 1404 FILE_BASIC_INFO time_buf;
1405 int set_time = FALSE; 1405 bool set_time = false;
1406 int set_dosattr = FALSE; 1406 bool set_dosattr = false;
1407 __u64 mode = 0xFFFFFFFFFFFFFFFFULL; 1407 __u64 mode = 0xFFFFFFFFFFFFFFFFULL;
1408 __u64 uid = 0xFFFFFFFFFFFFFFFFULL; 1408 __u64 uid = 0xFFFFFFFFFFFFFFFFULL;
1409 __u64 gid = 0xFFFFFFFFFFFFFFFFULL; 1409 __u64 gid = 0xFFFFFFFFFFFFFFFFULL;
@@ -1464,7 +1464,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1464 __u16 nfid = open_file->netfid; 1464 __u16 nfid = open_file->netfid;
1465 __u32 npid = open_file->pid; 1465 __u32 npid = open_file->pid;
1466 rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, 1466 rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size,
1467 nfid, npid, FALSE); 1467 nfid, npid, false);
1468 atomic_dec(&open_file->wrtPending); 1468 atomic_dec(&open_file->wrtPending);
1469 cFYI(1, ("SetFSize for attrs rc = %d", rc)); 1469 cFYI(1, ("SetFSize for attrs rc = %d", rc));
1470 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 1470 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
@@ -1484,14 +1484,14 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1484 it was found or because there was an error setting 1484 it was found or because there was an error setting
1485 it by handle */ 1485 it by handle */
1486 rc = CIFSSMBSetEOF(xid, pTcon, full_path, 1486 rc = CIFSSMBSetEOF(xid, pTcon, full_path,
1487 attrs->ia_size, FALSE, 1487 attrs->ia_size, false,
1488 cifs_sb->local_nls, 1488 cifs_sb->local_nls,
1489 cifs_sb->mnt_cifs_flags & 1489 cifs_sb->mnt_cifs_flags &
1490 CIFS_MOUNT_MAP_SPECIAL_CHR); 1490 CIFS_MOUNT_MAP_SPECIAL_CHR);
1491 cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc)); 1491 cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc));
1492 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 1492 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) {
1493 __u16 netfid; 1493 __u16 netfid;
1494 int oplock = FALSE; 1494 int oplock = 0;
1495 1495
1496 rc = SMBLegacyOpen(xid, pTcon, full_path, 1496 rc = SMBLegacyOpen(xid, pTcon, full_path,
1497 FILE_OPEN, 1497 FILE_OPEN,
@@ -1516,7 +1516,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1516 1516
1517 /* Server is ok setting allocation size implicitly - no need 1517 /* Server is ok setting allocation size implicitly - no need
1518 to call: 1518 to call:
1519 CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, TRUE, 1519 CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, true,
1520 cifs_sb->local_nls); 1520 cifs_sb->local_nls);
1521 */ 1521 */
1522 1522
@@ -1564,7 +1564,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1564#endif 1564#endif
1565 /* not writeable */ 1565 /* not writeable */
1566 if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) { 1566 if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
1567 set_dosattr = TRUE; 1567 set_dosattr = true;
1568 time_buf.Attributes = 1568 time_buf.Attributes =
1569 cpu_to_le32(cifsInode->cifsAttrs | 1569 cpu_to_le32(cifsInode->cifsAttrs |
1570 ATTR_READONLY); 1570 ATTR_READONLY);
@@ -1574,7 +1574,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1574 not be able to write to it - so if any write 1574 not be able to write to it - so if any write
1575 bit is enabled for user or group or other we 1575 bit is enabled for user or group or other we
1576 need to at least try to remove r/o dos attr */ 1576 need to at least try to remove r/o dos attr */
1577 set_dosattr = TRUE; 1577 set_dosattr = true;
1578 time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs & 1578 time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs &
1579 (~ATTR_READONLY)); 1579 (~ATTR_READONLY));
1580 /* Windows ignores set to zero */ 1580 /* Windows ignores set to zero */
@@ -1588,14 +1588,14 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1588 } 1588 }
1589 1589
1590 if (attrs->ia_valid & ATTR_ATIME) { 1590 if (attrs->ia_valid & ATTR_ATIME) {
1591 set_time = TRUE; 1591 set_time = true;
1592 time_buf.LastAccessTime = 1592 time_buf.LastAccessTime =
1593 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_atime)); 1593 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_atime));
1594 } else 1594 } else
1595 time_buf.LastAccessTime = 0; 1595 time_buf.LastAccessTime = 0;
1596 1596
1597 if (attrs->ia_valid & ATTR_MTIME) { 1597 if (attrs->ia_valid & ATTR_MTIME) {
1598 set_time = TRUE; 1598 set_time = true;
1599 time_buf.LastWriteTime = 1599 time_buf.LastWriteTime =
1600 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_mtime)); 1600 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_mtime));
1601 } else 1601 } else
@@ -1606,7 +1606,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1606 server times */ 1606 server times */
1607 1607
1608 if (set_time && (attrs->ia_valid & ATTR_CTIME)) { 1608 if (set_time && (attrs->ia_valid & ATTR_CTIME)) {
1609 set_time = TRUE; 1609 set_time = true;
1610 /* Although Samba throws this field away 1610 /* Although Samba throws this field away
1611 it may be useful to Windows - but we do 1611 it may be useful to Windows - but we do
1612 not want to set ctime unless some other 1612 not want to set ctime unless some other
@@ -1630,7 +1630,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
1630 rc = -EOPNOTSUPP; 1630 rc = -EOPNOTSUPP;
1631 1631
1632 if (rc == -EOPNOTSUPP) { 1632 if (rc == -EOPNOTSUPP) {
1633 int oplock = FALSE; 1633 int oplock = 0;
1634 __u16 netfid; 1634 __u16 netfid;
1635 1635
1636 cFYI(1, ("calling SetFileInfo since SetPathInfo for " 1636 cFYI(1, ("calling SetFileInfo since SetPathInfo for "
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index d4e7ec93285f..1c2c3ce5020b 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -230,7 +230,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
230 struct inode *inode = direntry->d_inode; 230 struct inode *inode = direntry->d_inode;
231 int rc = -EACCES; 231 int rc = -EACCES;
232 int xid; 232 int xid;
233 int oplock = FALSE; 233 int oplock = 0;
234 struct cifs_sb_info *cifs_sb; 234 struct cifs_sb_info *cifs_sb;
235 struct cifsTconInfo *pTcon; 235 struct cifsTconInfo *pTcon;
236 char *full_path = NULL; 236 char *full_path = NULL;
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
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 32b445edc882..34ec32100c72 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -447,8 +447,8 @@ static int initiate_cifs_search(const int xid, struct file *file)
447 if (file->private_data == NULL) 447 if (file->private_data == NULL)
448 return -ENOMEM; 448 return -ENOMEM;
449 cifsFile = file->private_data; 449 cifsFile = file->private_data;
450 cifsFile->invalidHandle = TRUE; 450 cifsFile->invalidHandle = true;
451 cifsFile->srch_inf.endOfSearch = FALSE; 451 cifsFile->srch_inf.endOfSearch = false;
452 452
453 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 453 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
454 if (cifs_sb == NULL) 454 if (cifs_sb == NULL)
@@ -485,7 +485,7 @@ ffirst_retry:
485 cifs_sb->mnt_cifs_flags & 485 cifs_sb->mnt_cifs_flags &
486 CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb)); 486 CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb));
487 if (rc == 0) 487 if (rc == 0)
488 cifsFile->invalidHandle = FALSE; 488 cifsFile->invalidHandle = false;
489 if ((rc == -EOPNOTSUPP) && 489 if ((rc == -EOPNOTSUPP) &&
490 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) { 490 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) {
491 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; 491 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM;
@@ -670,7 +670,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
670 (index_to_find < first_entry_in_buffer)) { 670 (index_to_find < first_entry_in_buffer)) {
671 /* close and restart search */ 671 /* close and restart search */
672 cFYI(1, ("search backing up - close and restart search")); 672 cFYI(1, ("search backing up - close and restart search"));
673 cifsFile->invalidHandle = TRUE; 673 cifsFile->invalidHandle = true;
674 CIFSFindClose(xid, pTcon, cifsFile->netfid); 674 CIFSFindClose(xid, pTcon, cifsFile->netfid);
675 kfree(cifsFile->search_resume_name); 675 kfree(cifsFile->search_resume_name);
676 cifsFile->search_resume_name = NULL; 676 cifsFile->search_resume_name = NULL;
@@ -692,7 +692,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
692 } 692 }
693 693
694 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && 694 while ((index_to_find >= cifsFile->srch_inf.index_of_last_entry) &&
695 (rc == 0) && (cifsFile->srch_inf.endOfSearch == FALSE)) { 695 (rc == 0) && !cifsFile->srch_inf.endOfSearch) {
696 cFYI(1, ("calling findnext2")); 696 cFYI(1, ("calling findnext2"));
697 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid, 697 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid,
698 &cifsFile->srch_inf); 698 &cifsFile->srch_inf);
@@ -1038,7 +1038,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
1038 break; 1038 break;
1039 } 1039 }
1040 } /* else { 1040 } /* else {
1041 cifsFile->invalidHandle = TRUE; 1041 cifsFile->invalidHandle = true;
1042 CIFSFindClose(xid, pTcon, cifsFile->netfid); 1042 CIFSFindClose(xid, pTcon, cifsFile->netfid);
1043 } 1043 }
1044 kfree(cifsFile->search_resume_name); 1044 kfree(cifsFile->search_resume_name);
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index 58bbfd992cc0..ff3232fa1015 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -35,11 +35,11 @@
35#include "cifs_debug.h" 35#include "cifs_debug.h"
36#include "cifsencrypt.h" 36#include "cifsencrypt.h"
37 37
38#ifndef FALSE 38#ifndef false
39#define FALSE 0 39#define false 0
40#endif 40#endif
41#ifndef TRUE 41#ifndef true
42#define TRUE 1 42#define true 1
43#endif 43#endif
44 44
45/* following came from the other byteorder.h to avoid include conflicts */ 45/* following came from the other byteorder.h to avoid include conflicts */
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 8cd6a445b017..e9527eedc639 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -264,7 +264,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
264#ifdef CONFIG_CIFS_EXPERIMENTAL 264#ifdef CONFIG_CIFS_EXPERIMENTAL
265 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 265 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
266 __u16 fid; 266 __u16 fid;
267 int oplock = FALSE; 267 int oplock = 0;
268 struct cifs_ntsd *pacl = NULL; 268 struct cifs_ntsd *pacl = NULL;
269 __u32 buflen = 0; 269 __u32 buflen = 0;
270 if (experimEnabled) 270 if (experimEnabled)