Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[CIFS] fix build warning
[CIFS] Fixed build warning in is_ip
[CIFS] cleanup cifsd completion
[CIFS] Remove over-indented code in find_unc().
[CIFS] fix typo
[CIFS] Remove duplicate call to mode_to_acl
[CIFS] convert usage of implicit booleans to bool
[CIFS] fixed compatibility issue with samba refferal request
[CIFS] Fix statfs formatting
[CIFS] Adds to dns_resolver checking if the server name is an IP addr and skipping upcall in this case.
[CIFS] Fix spelling mistake
[CIFS] Update cifs version number

+338 -343
+3
fs/cifs/CHANGES
··· 1 + Version 1.53 2 + ------------ 3 + 1 4 Version 1.52 2 5 ------------ 3 6 Fix oops on second mount to server when null auth is used.
+5 -5
fs/cifs/asn1.c
··· 460 460 unsigned char *sequence_end; 461 461 unsigned long *oid = NULL; 462 462 unsigned int cls, con, tag, oidlen, rc; 463 - int use_ntlmssp = FALSE; 464 - int use_kerberos = FALSE; 463 + bool use_ntlmssp = false; 464 + bool use_kerberos = false; 465 465 466 466 *secType = NTLM; /* BB eventually make Kerberos or NLTMSSP the default*/ 467 467 ··· 561 561 if (compare_oid(oid, oidlen, 562 562 MSKRB5_OID, 563 563 MSKRB5_OID_LEN)) 564 - use_kerberos = TRUE; 564 + use_kerberos = true; 565 565 else if (compare_oid(oid, oidlen, 566 566 KRB5_OID, 567 567 KRB5_OID_LEN)) 568 - use_kerberos = TRUE; 568 + use_kerberos = true; 569 569 else if (compare_oid(oid, oidlen, 570 570 NTLMSSP_OID, 571 571 NTLMSSP_OID_LEN)) 572 - use_ntlmssp = TRUE; 572 + use_ntlmssp = true; 573 573 574 574 kfree(oid); 575 575 }
+14 -11
fs/cifs/cifs_dfs_ref.c
··· 93 93 /* find sharename end */ 94 94 pSep++; 95 95 pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC)); 96 - if (!pSep) { 97 - cERROR(1, ("%s:2 cant find share name in node name: %s", 98 - __func__, node_name)); 99 - kfree(UNC); 100 - return NULL; 96 + if (pSep) { 97 + /* trim path up to sharename end 98 + * now we have share name in UNC */ 99 + *pSep = 0; 101 100 } 102 - /* trim path up to sharename end 103 - * * now we have share name in UNC */ 104 - *pSep = 0; 105 101 106 102 return UNC; 107 103 } ··· 184 188 tkn_e = strchr(tkn_e+1, '\\'); 185 189 if (tkn_e) { 186 190 strcat(mountdata, ",prefixpath="); 187 - strcat(mountdata, tkn_e); 191 + strcat(mountdata, tkn_e+1); 188 192 } 189 193 } 190 194 ··· 240 244 return NULL; 241 245 242 246 if (cifs_sb->tcon->Flags & SMB_SHARE_IS_IN_DFS) { 243 - /* we should use full path name to correct working with DFS */ 247 + int i; 248 + /* we should use full path name for correct working with DFS */ 244 249 l_max_len = strnlen(cifs_sb->tcon->treeName, MAX_TREE_SIZE+1) + 245 250 strnlen(search_path, MAX_PATHCONF) + 1; 246 251 tmp_path = kmalloc(l_max_len, GFP_KERNEL); ··· 250 253 return NULL; 251 254 } 252 255 strncpy(tmp_path, cifs_sb->tcon->treeName, l_max_len); 253 - strcat(tmp_path, search_path); 254 256 tmp_path[l_max_len-1] = 0; 257 + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) 258 + for (i = 0; i < l_max_len; i++) { 259 + if (tmp_path[i] == '\\') 260 + tmp_path[i] = '/'; 261 + } 262 + strncat(tmp_path, search_path, l_max_len - strlen(tmp_path)); 263 + 255 264 full_path = tmp_path; 256 265 kfree(search_path); 257 266 } else {
+8 -8
fs/cifs/cifsacl.c
··· 559 559 const char *path, const __u16 *pfid) 560 560 { 561 561 struct cifsFileInfo *open_file = NULL; 562 - int unlock_file = FALSE; 562 + bool unlock_file = false; 563 563 int xid; 564 564 int rc = -EIO; 565 565 __u16 fid; ··· 586 586 cifs_sb = CIFS_SB(sb); 587 587 588 588 if (open_file) { 589 - unlock_file = TRUE; 589 + unlock_file = true; 590 590 fid = open_file->netfid; 591 591 } else if (pfid == NULL) { 592 - int oplock = FALSE; 592 + int oplock = 0; 593 593 /* open file */ 594 594 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, 595 595 READ_CONTROL, 0, &fid, &oplock, NULL, ··· 604 604 605 605 rc = CIFSSMBGetCIFSACL(xid, cifs_sb->tcon, fid, &pntsd, pacllen); 606 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 608 atomic_dec(&open_file->wrtPending); 609 609 else if (pfid == NULL) /* if opened above we have to close the handle */ 610 610 CIFSSMBClose(xid, cifs_sb->tcon, fid); ··· 619 619 struct inode *inode, const char *path) 620 620 { 621 621 struct cifsFileInfo *open_file; 622 - int unlock_file = FALSE; 622 + bool unlock_file = false; 623 623 int xid; 624 624 int rc = -EIO; 625 625 __u16 fid; ··· 640 640 641 641 open_file = find_readable_file(CIFS_I(inode)); 642 642 if (open_file) { 643 - unlock_file = TRUE; 643 + unlock_file = true; 644 644 fid = open_file->netfid; 645 645 } else { 646 - int oplock = FALSE; 646 + int oplock = 0; 647 647 /* open file */ 648 648 rc = CIFSSMBOpen(xid, cifs_sb->tcon, path, FILE_OPEN, 649 649 WRITE_DAC, 0, &fid, &oplock, NULL, ··· 658 658 659 659 rc = CIFSSMBSetCIFSACL(xid, cifs_sb->tcon, fid, pnntsd, acllen); 660 660 cFYI(DBG2, ("SetCIFSACL rc = %d", rc)); 661 - if (unlock_file == TRUE) 661 + if (unlock_file) 662 662 atomic_dec(&open_file->wrtPending); 663 663 else 664 664 CIFSSMBClose(xid, cifs_sb->tcon, fid);
+34 -34
fs/cifs/cifsfs.c
··· 222 222 cifs_statfs(struct dentry *dentry, struct kstatfs *buf) 223 223 { 224 224 struct super_block *sb = dentry->d_sb; 225 - int xid; 225 + struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 226 + struct cifsTconInfo *tcon = cifs_sb->tcon; 226 227 int rc = -EOPNOTSUPP; 227 - struct cifs_sb_info *cifs_sb; 228 - struct cifsTconInfo *pTcon; 228 + int xid; 229 229 230 230 xid = GetXid(); 231 231 232 - cifs_sb = CIFS_SB(sb); 233 - pTcon = cifs_sb->tcon; 234 - 235 232 buf->f_type = CIFS_MAGIC_NUMBER; 236 233 237 - /* instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO */ 238 - buf->f_namelen = PATH_MAX; /* PATH_MAX may be too long - it would 239 - presumably be total path, but note 240 - that some servers (includinng Samba 3) 241 - have a shorter maximum path */ 234 + /* 235 + * PATH_MAX may be too long - it would presumably be total path, 236 + * but note that some servers (includinng Samba 3) have a shorter 237 + * maximum path. 238 + * 239 + * Instead could get the real value via SMB_QUERY_FS_ATTRIBUTE_INFO. 240 + */ 241 + buf->f_namelen = PATH_MAX; 242 242 buf->f_files = 0; /* undefined */ 243 243 buf->f_ffree = 0; /* unlimited */ 244 244 245 - /* BB we could add a second check for a QFS Unix capability bit */ 246 - /* BB FIXME check CIFS_POSIX_EXTENSIONS Unix cap first FIXME BB */ 247 - if ((pTcon->ses->capabilities & CAP_UNIX) && (CIFS_POSIX_EXTENSIONS & 248 - le64_to_cpu(pTcon->fsUnixInfo.Capability))) 249 - rc = CIFSSMBQFSPosixInfo(xid, pTcon, buf); 245 + /* 246 + * We could add a second check for a QFS Unix capability bit 247 + */ 248 + if ((tcon->ses->capabilities & CAP_UNIX) && 249 + (CIFS_POSIX_EXTENSIONS & le64_to_cpu(tcon->fsUnixInfo.Capability))) 250 + rc = CIFSSMBQFSPosixInfo(xid, tcon, buf); 250 251 251 - /* Only need to call the old QFSInfo if failed 252 - on newer one */ 253 - if (rc) 254 - if (pTcon->ses->capabilities & CAP_NT_SMBS) 255 - rc = CIFSSMBQFSInfo(xid, pTcon, buf); /* not supported by OS2 */ 252 + /* 253 + * Only need to call the old QFSInfo if failed on newer one, 254 + * e.g. by OS/2. 255 + **/ 256 + if (rc && (tcon->ses->capabilities & CAP_NT_SMBS)) 257 + rc = CIFSSMBQFSInfo(xid, tcon, buf); 256 258 257 - /* Some old Windows servers also do not support level 103, retry with 258 - older level one if old server failed the previous call or we 259 - bypassed it because we detected that this was an older LANMAN sess */ 259 + /* 260 + * Some old Windows servers also do not support level 103, retry with 261 + * older level one if old server failed the previous call or we 262 + * bypassed it because we detected that this was an older LANMAN sess 263 + */ 260 264 if (rc) 261 - rc = SMBOldQFSInfo(xid, pTcon, buf); 262 - /* int f_type; 263 - __fsid_t f_fsid; 264 - int f_namelen; */ 265 - /* BB get from info in tcon struct at mount time call to QFSAttrInfo */ 265 + rc = SMBOldQFSInfo(xid, tcon, buf); 266 + 266 267 FreeXid(xid); 267 - return 0; /* always return success? what if volume is no 268 - longer available? */ 268 + return 0; 269 269 } 270 270 271 271 static int cifs_permission(struct inode *inode, int mask, struct nameidata *nd) ··· 306 306 /* Until the file is open and we have gotten oplock 307 307 info back from the server, can not assume caching of 308 308 file data or metadata */ 309 - cifs_inode->clientCanCacheRead = FALSE; 310 - cifs_inode->clientCanCacheAll = FALSE; 309 + cifs_inode->clientCanCacheRead = false; 310 + cifs_inode->clientCanCacheAll = false; 311 311 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ 312 312 313 313 /* Can not set i_flags here - they get immediately overwritten ··· 940 940 rc = CIFSSMBLock(0, pTcon, netfid, 941 941 0 /* len */ , 0 /* offset */, 0, 942 942 0, LOCKING_ANDX_OPLOCK_RELEASE, 943 - 0 /* wait flag */); 943 + false /* wait flag */); 944 944 cFYI(1, ("Oplock release rc = %d", rc)); 945 945 } 946 946 } else
+1 -9
fs/cifs/cifsfs.h
··· 24 24 25 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 - 35 27 extern struct file_system_type cifs_fs_type; 36 28 extern const struct address_space_operations cifs_addr_ops; 37 29 extern const struct address_space_operations cifs_addr_ops_smallbuf; ··· 102 110 extern const struct export_operations cifs_export_ops; 103 111 #endif /* EXPERIMENTAL */ 104 112 105 - #define CIFS_VERSION "1.52" 113 + #define CIFS_VERSION "1.53" 106 114 #endif /* _CIFSFS_H */
+18 -26
fs/cifs/cifsglob.h
··· 57 57 58 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 60 #ifndef XATTR_DOS_ATTRIB 69 61 #define XATTR_DOS_ATTRIB "user.DOSATTRIB" 70 62 #endif ··· 139 147 enum protocolEnum protocolType; 140 148 char versionMajor; 141 149 char versionMinor; 142 - unsigned svlocal:1; /* local server or remote */ 150 + bool svlocal:1; /* local server or remote */ 143 151 atomic_t socketUseCount; /* number of open cifs sessions on socket */ 144 152 atomic_t inFlight; /* number of requests on the wire to server */ 145 153 #ifdef CONFIG_CIFS_STATS2 ··· 278 286 FILE_SYSTEM_DEVICE_INFO fsDevInfo; 279 287 FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */ 280 288 FILE_SYSTEM_UNIX_INFO fsUnixInfo; 281 - unsigned ipc:1; /* set if connection to IPC$ eg for RPC/PIPES */ 282 - unsigned retry:1; 283 - unsigned nocase:1; 284 - unsigned unix_ext:1; /* if off disable Linux extensions to CIFS protocol 289 + bool ipc:1; /* set if connection to IPC$ eg for RPC/PIPES */ 290 + bool retry:1; 291 + bool nocase:1; 292 + bool unix_ext:1; /* if false disable Linux extensions to CIFS protocol 285 293 for this mount even if server would support */ 286 294 /* BB add field for back pointer to sb struct(s)? */ 287 295 }; ··· 309 317 char *srch_entries_start; 310 318 char *presume_name; 311 319 unsigned int resume_name_len; 312 - unsigned endOfSearch:1; 313 - unsigned emptyDir:1; 314 - unsigned unicode:1; 315 - unsigned smallBuf:1; /* so we know which buf_release function to call */ 320 + bool endOfSearch:1; 321 + bool emptyDir:1; 322 + bool unicode:1; 323 + bool smallBuf:1; /* so we know which buf_release function to call */ 316 324 }; 317 325 318 326 struct cifsFileInfo { ··· 327 335 struct inode *pInode; /* needed for oplock break */ 328 336 struct mutex lock_mutex; 329 337 struct list_head llist; /* list of byte range locks we have. */ 330 - unsigned closePend:1; /* file is marked to close */ 331 - unsigned invalidHandle:1; /* file closed via session abend */ 332 - unsigned messageMode:1; /* for pipes: message vs byte mode */ 338 + bool closePend:1; /* file is marked to close */ 339 + bool invalidHandle:1; /* file closed via session abend */ 340 + bool messageMode:1; /* for pipes: message vs byte mode */ 333 341 atomic_t wrtPending; /* handle in use - defer close */ 334 342 struct semaphore fh_sem; /* prevents reopen race after dead ses*/ 335 343 char *search_resume_name; /* BB removeme BB */ ··· 348 356 __u32 cifsAttrs; /* e.g. DOS archive bit, sparse, compressed, system */ 349 357 atomic_t inUse; /* num concurrent users (local openers cifs) of file*/ 350 358 unsigned long time; /* jiffies of last update/check of inode */ 351 - unsigned clientCanCacheRead:1; /* read oplock */ 352 - unsigned clientCanCacheAll:1; /* read and writebehind oplock */ 353 - unsigned oplockPending:1; 359 + bool clientCanCacheRead:1; /* read oplock */ 360 + bool clientCanCacheAll:1; /* read and writebehind oplock */ 361 + bool oplockPending:1; 354 362 struct inode vfs_inode; 355 363 }; 356 364 ··· 418 426 struct smb_hdr *resp_buf; /* response buffer */ 419 427 int midState; /* wish this were enum but can not pass to wait_event */ 420 428 __u8 command; /* smb command code */ 421 - unsigned largeBuf:1; /* if valid response, is pointer to large buf */ 422 - unsigned multiRsp:1; /* multiple trans2 responses for one request */ 423 - unsigned multiEnd:1; /* both received */ 429 + bool largeBuf:1; /* if valid response, is pointer to large buf */ 430 + bool multiRsp:1; /* multiple trans2 responses for one request */ 431 + bool multiEnd:1; /* both received */ 424 432 }; 425 433 426 434 struct oplock_q_entry {
+1 -1
fs/cifs/cifspdu.h
··· 2050 2050 to 0xFFFF00 */ 2051 2051 #define CIFS_UNIX_LARGE_WRITE_CAP 0x00000080 2052 2052 #define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x00000100 /* can do SPNEGO crypt */ 2053 - #define CIFS_UNIX_TRANPSORT_ENCRYPTION_MANDATORY_CAP 0x00000200 /* must do */ 2053 + #define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x00000200 /* must do */ 2054 2054 #define CIFS_UNIX_PROXY_CAP 0x00000400 /* Proxy cap: 0xACE ioctl and 2055 2055 QFS PROXY call */ 2056 2056 #ifdef CONFIG_CIFS_POSIX
+8 -7
fs/cifs/cifsproto.h
··· 59 59 struct smb_hdr *out_buf, 60 60 int *bytes_returned); 61 61 extern int checkSMB(struct smb_hdr *smb, __u16 mid, unsigned int length); 62 - extern int is_valid_oplock_break(struct smb_hdr *smb, struct TCP_Server_Info *); 63 - extern int is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); 62 + extern bool is_valid_oplock_break(struct smb_hdr *smb, 63 + struct TCP_Server_Info *); 64 + extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); 64 65 extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *); 65 66 #ifdef CONFIG_CIFS_EXPERIMENTAL 66 67 extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *); ··· 70 69 extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); 71 70 extern int decode_negTokenInit(unsigned char *security_blob, int length, 72 71 enum securityEnum *secType); 73 - extern int cifs_inet_pton(int, char *source, void *dst); 72 + extern int cifs_inet_pton(const int, const char *source, void *dst); 74 73 extern int map_smb_to_linux_error(struct smb_hdr *smb, int logErr); 75 74 extern void header_assemble(struct smb_hdr *, char /* command */ , 76 75 const struct cifsTconInfo *, int /* length of ··· 188 187 #endif /* possibly unneeded function */ 189 188 extern int CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, 190 189 const char *fileName, __u64 size, 191 - int setAllocationSizeFlag, 190 + bool setAllocationSizeFlag, 192 191 const struct nls_table *nls_codepage, 193 192 int remap_special_chars); 194 193 extern int CIFSSMBSetFileSize(const int xid, struct cifsTconInfo *tcon, 195 194 __u64 size, __u16 fileHandle, __u32 opener_pid, 196 - int AllocSizeFlag); 195 + bool AllocSizeFlag); 197 196 extern int CIFSSMBUnixSetPerms(const int xid, struct cifsTconInfo *pTcon, 198 197 char *full_path, __u64 mode, __u64 uid, 199 198 __u64 gid, dev_t dev, ··· 292 291 const __u16 netfid, const __u64 len, 293 292 const __u64 offset, const __u32 numUnlock, 294 293 const __u32 numLock, const __u8 lockType, 295 - const int waitFlag); 294 + const bool waitFlag); 296 295 extern int CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 297 296 const __u16 smb_file_id, const int get_flag, 298 297 const __u64 len, struct file_lock *, 299 - const __u16 lock_type, const int waitFlag); 298 + const __u16 lock_type, const bool waitFlag); 300 299 extern int CIFSSMBTDis(const int xid, struct cifsTconInfo *tcon); 301 300 extern int CIFSSMBLogoff(const int xid, struct cifsSesInfo *ses); 302 301
+19 -19
fs/cifs/cifssmb.c
··· 95 95 list_for_each_safe(tmp, tmp1, &pTcon->openFileList) { 96 96 open_file = list_entry(tmp, struct cifsFileInfo, tlist); 97 97 if (open_file) 98 - open_file->invalidHandle = TRUE; 98 + open_file->invalidHandle = true; 99 99 } 100 100 write_unlock(&GlobalSMBSeslock); 101 101 /* BB Add call to invalidate_inodes(sb) for all superblocks mounted ··· 141 141 if (tcon->ses->server->tcpStatus == 142 142 CifsNeedReconnect) { 143 143 /* on "soft" mounts we wait once */ 144 - if ((tcon->retry == FALSE) || 144 + if (!tcon->retry || 145 145 (tcon->ses->status == CifsExiting)) { 146 146 cFYI(1, ("gave up waiting on " 147 147 "reconnect in smb_init")); ··· 289 289 if (tcon->ses->server->tcpStatus == 290 290 CifsNeedReconnect) { 291 291 /* on "soft" mounts we wait once */ 292 - if ((tcon->retry == FALSE) || 292 + if (!tcon->retry || 293 293 (tcon->ses->status == CifsExiting)) { 294 294 cFYI(1, ("gave up waiting on " 295 295 "reconnect in smb_init")); ··· 1686 1686 CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, 1687 1687 const __u16 smb_file_id, const __u64 len, 1688 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 1691 int rc = 0; 1692 1692 LOCK_REQ *pSMB = NULL; ··· 1695 1695 int timeout = 0; 1696 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 1699 rc = small_smb_init(SMB_COM_LOCKING_ANDX, 8, tcon, (void **) &pSMB); 1700 1700 1701 1701 if (rc) ··· 1706 1706 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) { 1707 1707 timeout = CIFS_ASYNC_OP; /* no response expected */ 1708 1708 pSMB->Timeout = 0; 1709 - } else if (waitFlag == TRUE) { 1709 + } else if (waitFlag) { 1710 1710 timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */ 1711 1711 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */ 1712 1712 } else { ··· 1756 1756 CIFSSMBPosixLock(const int xid, struct cifsTconInfo *tcon, 1757 1757 const __u16 smb_file_id, const int get_flag, const __u64 len, 1758 1758 struct file_lock *pLockData, const __u16 lock_type, 1759 - const int waitFlag) 1759 + const bool waitFlag) 1760 1760 { 1761 1761 struct smb_com_transaction2_sfi_req *pSMB = NULL; 1762 1762 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; ··· 3581 3581 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 3582 3582 if (rc == 0) { 3583 3583 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) 3584 - psrch_inf->unicode = TRUE; 3584 + psrch_inf->unicode = true; 3585 3585 else 3586 - psrch_inf->unicode = FALSE; 3586 + psrch_inf->unicode = false; 3587 3587 3588 3588 psrch_inf->ntwrk_buf_start = (char *)pSMBr; 3589 3589 psrch_inf->smallBuf = 0; ··· 3594 3594 le16_to_cpu(pSMBr->t2.ParameterOffset)); 3595 3595 3596 3596 if (parms->EndofSearch) 3597 - psrch_inf->endOfSearch = TRUE; 3597 + psrch_inf->endOfSearch = true; 3598 3598 else 3599 - psrch_inf->endOfSearch = FALSE; 3599 + psrch_inf->endOfSearch = false; 3600 3600 3601 3601 psrch_inf->entries_in_buffer = 3602 3602 le16_to_cpu(parms->SearchCount); ··· 3624 3624 3625 3625 cFYI(1, ("In FindNext")); 3626 3626 3627 - if (psrch_inf->endOfSearch == TRUE) 3627 + if (psrch_inf->endOfSearch) 3628 3628 return -ENOENT; 3629 3629 3630 3630 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, ··· 3682 3682 cifs_stats_inc(&tcon->num_fnext); 3683 3683 if (rc) { 3684 3684 if (rc == -EBADF) { 3685 - psrch_inf->endOfSearch = TRUE; 3685 + psrch_inf->endOfSearch = true; 3686 3686 rc = 0; /* search probably was closed at end of search*/ 3687 3687 } else 3688 3688 cFYI(1, ("FindNext returned = %d", rc)); ··· 3692 3692 if (rc == 0) { 3693 3693 /* BB fixme add lock for file (srch_info) struct here */ 3694 3694 if (pSMBr->hdr.Flags2 & SMBFLG2_UNICODE) 3695 - psrch_inf->unicode = TRUE; 3695 + psrch_inf->unicode = true; 3696 3696 else 3697 - psrch_inf->unicode = FALSE; 3697 + psrch_inf->unicode = false; 3698 3698 response_data = (char *) &pSMBr->hdr.Protocol + 3699 3699 le16_to_cpu(pSMBr->t2.ParameterOffset); 3700 3700 parms = (T2_FNEXT_RSP_PARMS *)response_data; ··· 3709 3709 psrch_inf->ntwrk_buf_start = (char *)pSMB; 3710 3710 psrch_inf->smallBuf = 0; 3711 3711 if (parms->EndofSearch) 3712 - psrch_inf->endOfSearch = TRUE; 3712 + psrch_inf->endOfSearch = true; 3713 3713 else 3714 - psrch_inf->endOfSearch = FALSE; 3714 + psrch_inf->endOfSearch = false; 3715 3715 psrch_inf->entries_in_buffer = 3716 3716 le16_to_cpu(parms->SearchCount); 3717 3717 psrch_inf->index_of_last_entry += ··· 4586 4586 4587 4587 int 4588 4588 CIFSSMBSetEOF(const int xid, struct cifsTconInfo *tcon, const char *fileName, 4589 - __u64 size, int SetAllocation, 4589 + __u64 size, bool SetAllocation, 4590 4590 const struct nls_table *nls_codepage, int remap) 4591 4591 { 4592 4592 struct smb_com_transaction2_spi_req *pSMB = NULL; ··· 4675 4675 4676 4676 int 4677 4677 CIFSSMBSetFileSize(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 4680 struct smb_com_transaction2_sfi_req *pSMB = NULL; 4681 4681 char *data_offset;
+74 -79
fs/cifs/connect.c
··· 49 49 #define CIFS_PORT 445 50 50 #define RFC1001_PORT 139 51 51 52 - static DECLARE_COMPLETION(cifsd_complete); 53 - 54 52 extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8, 55 53 unsigned char *p24); 56 54 ··· 69 71 mode_t file_mode; 70 72 mode_t dir_mode; 71 73 unsigned secFlg; 72 - unsigned rw:1; 73 - unsigned retry:1; 74 - unsigned intr:1; 75 - unsigned setuids:1; 76 - unsigned override_uid:1; 77 - unsigned override_gid:1; 78 - unsigned noperm:1; 79 - unsigned no_psx_acl:1; /* set if posix acl support should be disabled */ 80 - unsigned cifs_acl:1; 81 - unsigned no_xattr:1; /* set if xattr (EA) support should be disabled*/ 82 - unsigned server_ino:1; /* use inode numbers from server ie UniqueId */ 83 - unsigned direct_io:1; 84 - unsigned remap:1; /* set to remap seven reserved chars in filenames */ 85 - unsigned posix_paths:1; /* unset to not ask for posix pathnames. */ 86 - unsigned no_linux_ext:1; 87 - unsigned sfu_emul:1; 88 - unsigned nullauth:1; /* attempt to authenticate with null user */ 74 + bool rw:1; 75 + bool retry:1; 76 + bool intr:1; 77 + bool setuids:1; 78 + bool override_uid:1; 79 + bool override_gid:1; 80 + bool noperm:1; 81 + bool no_psx_acl:1; /* set if posix acl support should be disabled */ 82 + bool cifs_acl:1; 83 + bool no_xattr:1; /* set if xattr (EA) support should be disabled*/ 84 + bool server_ino:1; /* use inode numbers from server ie UniqueId */ 85 + bool direct_io:1; 86 + bool remap:1; /* set to remap seven reserved chars in filenames */ 87 + bool posix_paths:1; /* unset to not ask for posix pathnames. */ 88 + bool no_linux_ext:1; 89 + bool sfu_emul:1; 90 + bool nullauth:1; /* attempt to authenticate with null user */ 89 91 unsigned nocase; /* request case insensitive filenames */ 90 92 unsigned nobrl; /* disable sending byte range locks to srv */ 91 93 unsigned int rsize; ··· 343 345 struct task_struct *task_to_wake = NULL; 344 346 struct mid_q_entry *mid_entry; 345 347 char temp; 346 - int isLargeBuf = FALSE; 347 - int isMultiRsp; 348 + bool isLargeBuf = false; 349 + bool isMultiRsp; 348 350 int reconnect; 349 351 350 352 current->flags |= PF_MEMALLOC; ··· 354 356 atomic_inc(&tcpSesAllocCount); 355 357 length = tcpSesAllocCount.counter; 356 358 write_unlock(&GlobalSMBSeslock); 357 - complete(&cifsd_complete); 358 359 if (length > 1) 359 360 mempool_resize(cifs_req_poolp, length + cifs_min_rcv, 360 361 GFP_KERNEL); ··· 387 390 } else /* if existing small buf clear beginning */ 388 391 memset(smallbuf, 0, sizeof(struct smb_hdr)); 389 392 390 - isLargeBuf = FALSE; 391 - isMultiRsp = FALSE; 393 + isLargeBuf = false; 394 + isMultiRsp = false; 392 395 smb_buffer = smallbuf; 393 396 iov.iov_base = smb_buffer; 394 397 iov.iov_len = 4; ··· 514 517 reconnect = 0; 515 518 516 519 if (pdu_length > MAX_CIFS_SMALL_BUFFER_SIZE - 4) { 517 - isLargeBuf = TRUE; 520 + isLargeBuf = true; 518 521 memcpy(bigbuf, smallbuf, 4); 519 522 smb_buffer = bigbuf; 520 523 } ··· 579 582 (mid_entry->command == smb_buffer->Command)) { 580 583 if (check2ndT2(smb_buffer,server->maxBuf) > 0) { 581 584 /* We have a multipart transact2 resp */ 582 - isMultiRsp = TRUE; 585 + isMultiRsp = true; 583 586 if (mid_entry->resp_buf) { 584 587 /* merge response - fix up 1st*/ 585 588 if (coalesce_t2(smb_buffer, 586 589 mid_entry->resp_buf)) { 587 - mid_entry->multiRsp = 1; 590 + mid_entry->multiRsp = 591 + true; 588 592 break; 589 593 } else { 590 594 /* all parts received */ 591 - mid_entry->multiEnd = 1; 595 + mid_entry->multiEnd = 596 + true; 592 597 goto multi_t2_fnd; 593 598 } 594 599 } else { ··· 602 603 /* Have first buffer */ 603 604 mid_entry->resp_buf = 604 605 smb_buffer; 605 - mid_entry->largeBuf = 1; 606 + mid_entry->largeBuf = 607 + true; 606 608 bigbuf = NULL; 607 609 } 608 610 } 609 611 break; 610 612 } 611 613 mid_entry->resp_buf = smb_buffer; 612 - if (isLargeBuf) 613 - mid_entry->largeBuf = 1; 614 - else 615 - mid_entry->largeBuf = 0; 614 + mid_entry->largeBuf = isLargeBuf; 616 615 multi_t2_fnd: 617 616 task_to_wake = mid_entry->tsk; 618 617 mid_entry->midState = MID_RESPONSE_RECEIVED; ··· 635 638 smallbuf = NULL; 636 639 } 637 640 wake_up_process(task_to_wake); 638 - } else if ((is_valid_oplock_break(smb_buffer, server) == FALSE) 639 - && (isMultiRsp == FALSE)) { 641 + } else if (!is_valid_oplock_break(smb_buffer, server) && 642 + !isMultiRsp) { 640 643 cERROR(1, ("No task to wake, unknown frame received! " 641 644 "NumMids %d", midCount.counter)); 642 645 cifs_dump_mem("Received Data is: ", (char *)smb_buffer, ··· 822 825 vol->file_mode = (S_IRWXUGO | S_ISGID) & (~S_IXGRP); 823 826 824 827 /* vol->retry default is 0 (i.e. "soft" limited retry not hard retry) */ 825 - vol->rw = TRUE; 828 + vol->rw = true; 826 829 /* default is always to request posix paths. */ 827 830 vol->posix_paths = 1; 828 831 ··· 1178 1181 } else if (strnicmp(data, "guest", 5) == 0) { 1179 1182 /* ignore */ 1180 1183 } else if (strnicmp(data, "rw", 2) == 0) { 1181 - vol->rw = TRUE; 1184 + vol->rw = true; 1182 1185 } else if ((strnicmp(data, "suid", 4) == 0) || 1183 1186 (strnicmp(data, "nosuid", 6) == 0) || 1184 1187 (strnicmp(data, "exec", 4) == 0) || ··· 1194 1197 is ok to just ignore them */ 1195 1198 continue; 1196 1199 } else if (strnicmp(data, "ro", 2) == 0) { 1197 - vol->rw = FALSE; 1200 + vol->rw = false; 1198 1201 } else if (strnicmp(data, "hard", 4) == 0) { 1199 1202 vol->retry = 1; 1200 1203 } else if (strnicmp(data, "soft", 4) == 0) { ··· 1302 1305 "begin with // or \\\\ \n"); 1303 1306 return 1; 1304 1307 } 1308 + value = strpbrk(vol->UNC+2, "/\\"); 1309 + if (value) 1310 + *value = '\\'; 1305 1311 } else { 1306 1312 printk(KERN_WARNING "CIFS: UNC name too long\n"); 1307 1313 return 1; ··· 1362 1362 { 1363 1363 struct list_head *tmp; 1364 1364 struct cifsTconInfo *tcon; 1365 + __be32 old_ip; 1365 1366 1366 1367 read_lock(&GlobalSMBSeslock); 1368 + 1367 1369 list_for_each(tmp, &GlobalTreeConnectionList) { 1368 1370 cFYI(1, ("Next tcon")); 1369 1371 tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); 1370 - if (tcon->ses) { 1371 - if (tcon->ses->server) { 1372 - cFYI(1, 1373 - ("old ip addr: %x == new ip %x ?", 1374 - tcon->ses->server->addr.sockAddr.sin_addr. 1375 - s_addr, new_target_ip_addr)); 1376 - if (tcon->ses->server->addr.sockAddr.sin_addr. 1377 - s_addr == new_target_ip_addr) { 1378 - /* BB lock tcon, server and tcp session and increment use count here? */ 1379 - /* found a match on the TCP session */ 1380 - /* BB check if reconnection needed */ 1381 - cFYI(1, 1382 - ("IP match, old UNC: %s new: %s", 1383 - tcon->treeName, uncName)); 1384 - if (strncmp 1385 - (tcon->treeName, uncName, 1386 - MAX_TREE_SIZE) == 0) { 1387 - cFYI(1, 1388 - ("and old usr: %s new: %s", 1389 - tcon->treeName, uncName)); 1390 - if (strncmp 1391 - (tcon->ses->userName, 1392 - userName, 1393 - MAX_USERNAME_SIZE) == 0) { 1394 - read_unlock(&GlobalSMBSeslock); 1395 - /* matched smb session 1396 - (user name */ 1397 - return tcon; 1398 - } 1399 - } 1400 - } 1401 - } 1402 - } 1372 + if (!tcon->ses || !tcon->ses->server) 1373 + continue; 1374 + 1375 + old_ip = tcon->ses->server->addr.sockAddr.sin_addr.s_addr; 1376 + cFYI(1, ("old ip addr: %x == new ip %x ?", 1377 + old_ip, new_target_ip_addr)); 1378 + 1379 + if (old_ip != new_target_ip_addr) 1380 + continue; 1381 + 1382 + /* BB lock tcon, server, tcp session and increment use count? */ 1383 + /* found a match on the TCP session */ 1384 + /* BB check if reconnection needed */ 1385 + cFYI(1, ("IP match, old UNC: %s new: %s", 1386 + tcon->treeName, uncName)); 1387 + 1388 + if (strncmp(tcon->treeName, uncName, MAX_TREE_SIZE)) 1389 + continue; 1390 + 1391 + cFYI(1, ("and old usr: %s new: %s", 1392 + tcon->treeName, uncName)); 1393 + 1394 + if (strncmp(tcon->ses->userName, userName, MAX_USERNAME_SIZE)) 1395 + continue; 1396 + 1397 + /* matched smb session (user name) */ 1398 + read_unlock(&GlobalSMBSeslock); 1399 + return tcon; 1403 1400 } 1401 + 1404 1402 read_unlock(&GlobalSMBSeslock); 1405 1403 return NULL; 1406 1404 } ··· 1980 1982 kfree(srvTcp->hostname); 1981 1983 goto out; 1982 1984 } 1983 - wait_for_completion(&cifsd_complete); 1984 1985 rc = 0; 1985 1986 memcpy(srvTcp->workstation_RFC1001_name, 1986 1987 volume_info.source_rfc1001_name, 16); ··· 2599 2602 2600 2603 static int 2601 2604 CIFSNTLMSSPNegotiateSessSetup(unsigned int xid, 2602 - struct cifsSesInfo *ses, int *pNTLMv2_flag, 2605 + struct cifsSesInfo *ses, bool *pNTLMv2_flag, 2603 2606 const struct nls_table *nls_codepage) 2604 2607 { 2605 2608 struct smb_hdr *smb_buffer; ··· 2622 2625 if (ses == NULL) 2623 2626 return -EINVAL; 2624 2627 domain = ses->domainName; 2625 - *pNTLMv2_flag = FALSE; 2628 + *pNTLMv2_flag = false; 2626 2629 smb_buffer = cifs_buf_get(); 2627 2630 if (smb_buffer == NULL) { 2628 2631 return -ENOMEM; ··· 2775 2778 CIFS_CRYPTO_KEY_SIZE); 2776 2779 if (SecurityBlob2->NegotiateFlags & 2777 2780 cpu_to_le32(NTLMSSP_NEGOTIATE_NTLMV2)) 2778 - *pNTLMv2_flag = TRUE; 2781 + *pNTLMv2_flag = true; 2779 2782 2780 2783 if ((SecurityBlob2->NegotiateFlags & 2781 2784 cpu_to_le32(NTLMSSP_NEGOTIATE_ALWAYS_SIGN)) ··· 2936 2939 } 2937 2940 static int 2938 2941 CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses, 2939 - char *ntlm_session_key, int ntlmv2_flag, 2942 + char *ntlm_session_key, bool ntlmv2_flag, 2940 2943 const struct nls_table *nls_codepage) 2941 2944 { 2942 2945 struct smb_hdr *smb_buffer; ··· 3553 3556 cifs_sb->prepath = NULL; 3554 3557 kfree(tmp); 3555 3558 if (ses) 3556 - schedule_timeout_interruptible(msecs_to_jiffies(500)); 3557 - if (ses) 3558 3559 sesInfoFree(ses); 3559 3560 3560 3561 FreeXid(xid); ··· 3564 3569 { 3565 3570 int rc = 0; 3566 3571 char ntlm_session_key[CIFS_SESS_KEY_SIZE]; 3567 - int ntlmv2_flag = FALSE; 3572 + bool ntlmv2_flag = false; 3568 3573 int first_time = 0; 3569 3574 3570 3575 /* what if server changes its buffer size after dropping the session? */
+9 -9
fs/cifs/dir.c
··· 130 130 struct cifsFileInfo *pCifsFile = NULL; 131 131 struct cifsInodeInfo *pCifsInode; 132 132 int disposition = FILE_OVERWRITE_IF; 133 - int write_only = FALSE; 133 + bool write_only = false; 134 134 135 135 xid = GetXid(); 136 136 ··· 152 152 if (oflags & FMODE_WRITE) { 153 153 desiredAccess |= GENERIC_WRITE; 154 154 if (!(oflags & FMODE_READ)) 155 - write_only = TRUE; 155 + write_only = true; 156 156 } 157 157 158 158 if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) ··· 254 254 d_instantiate(direntry, newinode); 255 255 } 256 256 if ((nd == NULL /* nfsd case - nfs srv does not set nd */) || 257 - ((nd->flags & LOOKUP_OPEN) == FALSE)) { 257 + (!(nd->flags & LOOKUP_OPEN))) { 258 258 /* mknod case - do not leave file open */ 259 259 CIFSSMBClose(xid, pTcon, fileHandle); 260 260 } else if (newinode) { ··· 266 266 pCifsFile->netfid = fileHandle; 267 267 pCifsFile->pid = current->tgid; 268 268 pCifsFile->pInode = newinode; 269 - pCifsFile->invalidHandle = FALSE; 270 - pCifsFile->closePend = FALSE; 269 + pCifsFile->invalidHandle = false; 270 + pCifsFile->closePend = false; 271 271 init_MUTEX(&pCifsFile->fh_sem); 272 272 mutex_init(&pCifsFile->lock_mutex); 273 273 INIT_LIST_HEAD(&pCifsFile->llist); ··· 280 280 pCifsInode = CIFS_I(newinode); 281 281 if (pCifsInode) { 282 282 /* if readable file instance put first in list*/ 283 - if (write_only == TRUE) { 283 + if (write_only) { 284 284 list_add_tail(&pCifsFile->flist, 285 285 &pCifsInode->openFileList); 286 286 } else { ··· 288 288 &pCifsInode->openFileList); 289 289 } 290 290 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { 291 - pCifsInode->clientCanCacheAll = TRUE; 292 - pCifsInode->clientCanCacheRead = TRUE; 291 + pCifsInode->clientCanCacheAll = true; 292 + pCifsInode->clientCanCacheRead = true; 293 293 cFYI(1, ("Exclusive Oplock inode %p", 294 294 newinode)); 295 295 } else if ((oplock & 0xF) == OPLOCK_READ) 296 - pCifsInode->clientCanCacheRead = TRUE; 296 + pCifsInode->clientCanCacheRead = true; 297 297 } 298 298 write_unlock(&GlobalSMBSeslock); 299 299 }
+52 -10
fs/cifs/dns_resolve.c
··· 55 55 .match = user_match, 56 56 }; 57 57 58 + /* Checks if supplied name is IP address 59 + * returns: 60 + * 1 - name is IP 61 + * 0 - name is not IP 62 + */ 63 + static int is_ip(const char *name) 64 + { 65 + int rc; 66 + struct sockaddr_in sin_server; 67 + struct sockaddr_in6 sin_server6; 68 + 69 + rc = cifs_inet_pton(AF_INET, name, 70 + &sin_server.sin_addr.s_addr); 71 + 72 + if (rc <= 0) { 73 + /* not ipv4 address, try ipv6 */ 74 + rc = cifs_inet_pton(AF_INET6, name, 75 + &sin_server6.sin6_addr.in6_u); 76 + if (rc > 0) 77 + return 1; 78 + } else { 79 + return 1; 80 + } 81 + /* we failed translating address */ 82 + return 0; 83 + } 58 84 59 85 /* Resolves server name to ip address. 60 86 * input: ··· 93 67 dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) 94 68 { 95 69 int rc = -EAGAIN; 96 - struct key *rkey; 70 + struct key *rkey = ERR_PTR(-EAGAIN); 97 71 char *name; 72 + char *data = NULL; 98 73 int len; 99 74 100 75 if (!ip_addr || !unc) ··· 124 97 memcpy(name, unc+2, len); 125 98 name[len] = 0; 126 99 100 + if (is_ip(name)) { 101 + cFYI(1, ("%s: it is IP, skipping dns upcall: %s", 102 + __func__, name)); 103 + data = name; 104 + goto skip_upcall; 105 + } 106 + 127 107 rkey = request_key(&key_type_dns_resolver, name, ""); 128 108 if (!IS_ERR(rkey)) { 129 - len = strlen(rkey->payload.data); 130 - *ip_addr = kmalloc(len+1, GFP_KERNEL); 131 - if (*ip_addr) { 132 - memcpy(*ip_addr, rkey->payload.data, len); 133 - (*ip_addr)[len] = '\0'; 134 - cFYI(1, ("%s: resolved: %s to %s", __func__, 109 + data = rkey->payload.data; 110 + cFYI(1, ("%s: resolved: %s to %s", __func__, 135 111 rkey->description, 136 112 *ip_addr 137 113 )); 114 + } else { 115 + cERROR(1, ("%s: unable to resolve: %s", __func__, name)); 116 + goto out; 117 + } 118 + 119 + skip_upcall: 120 + if (data) { 121 + len = strlen(data); 122 + *ip_addr = kmalloc(len+1, GFP_KERNEL); 123 + if (*ip_addr) { 124 + memcpy(*ip_addr, data, len); 125 + (*ip_addr)[len] = '\0'; 138 126 rc = 0; 139 127 } else { 140 128 rc = -ENOMEM; 141 129 } 142 - key_put(rkey); 143 - } else { 144 - cERROR(1, ("%s: unable to resolve: %s", __func__, name)); 130 + if (!IS_ERR(rkey)) 131 + key_put(rkey); 145 132 } 146 133 134 + out: 147 135 kfree(name); 148 136 return rc; 149 137 }
+1 -1
fs/cifs/fcntl.c
··· 68 68 { 69 69 int xid; 70 70 int rc = -EINVAL; 71 - int oplock = FALSE; 71 + int oplock = 0; 72 72 struct cifs_sb_info *cifs_sb; 73 73 struct cifsTconInfo *pTcon; 74 74 char *full_path = NULL;
+40 -40
fs/cifs/file.c
··· 51 51 INIT_LIST_HEAD(&private_data->llist); 52 52 private_data->pfile = file; /* needed for writepage */ 53 53 private_data->pInode = inode; 54 - private_data->invalidHandle = FALSE; 55 - private_data->closePend = FALSE; 54 + private_data->invalidHandle = false; 55 + private_data->closePend = false; 56 56 /* we have to track num writers to the inode, since writepages 57 57 does not tell us which handle the write is for so there can 58 58 be a close (overlapping with write) of the filehandle that ··· 148 148 full_path, buf, inode->i_sb, xid, NULL); 149 149 150 150 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { 151 - pCifsInode->clientCanCacheAll = TRUE; 152 - pCifsInode->clientCanCacheRead = TRUE; 151 + pCifsInode->clientCanCacheAll = true; 152 + pCifsInode->clientCanCacheRead = true; 153 153 cFYI(1, ("Exclusive Oplock granted on inode %p", 154 154 file->f_path.dentry->d_inode)); 155 155 } else if ((*oplock & 0xF) == OPLOCK_READ) 156 - pCifsInode->clientCanCacheRead = TRUE; 156 + pCifsInode->clientCanCacheRead = true; 157 157 158 158 return rc; 159 159 } ··· 247 247 if (oplockEnabled) 248 248 oplock = REQ_OPLOCK; 249 249 else 250 - oplock = FALSE; 250 + oplock = 0; 251 251 252 252 /* BB pass O_SYNC flag through on file attributes .. BB */ 253 253 ··· 339 339 return rc; 340 340 } 341 341 342 - static int cifs_reopen_file(struct file *file, int can_flush) 342 + static int cifs_reopen_file(struct file *file, bool can_flush) 343 343 { 344 344 int rc = -EACCES; 345 345 int xid, oplock; ··· 360 360 361 361 xid = GetXid(); 362 362 down(&pCifsFile->fh_sem); 363 - if (pCifsFile->invalidHandle == FALSE) { 363 + if (!pCifsFile->invalidHandle) { 364 364 up(&pCifsFile->fh_sem); 365 365 FreeXid(xid); 366 366 return 0; ··· 404 404 if (oplockEnabled) 405 405 oplock = REQ_OPLOCK; 406 406 else 407 - oplock = FALSE; 407 + oplock = 0; 408 408 409 409 /* Can not refresh inode by passing in file_info buf to be returned 410 410 by SMBOpen and then calling get_inode_info with returned buf ··· 422 422 cFYI(1, ("oplock: %d", oplock)); 423 423 } else { 424 424 pCifsFile->netfid = netfid; 425 - pCifsFile->invalidHandle = FALSE; 425 + pCifsFile->invalidHandle = false; 426 426 up(&pCifsFile->fh_sem); 427 427 pCifsInode = CIFS_I(inode); 428 428 if (pCifsInode) { ··· 432 432 CIFS_I(inode)->write_behind_rc = rc; 433 433 /* temporarily disable caching while we 434 434 go to server to get inode info */ 435 - pCifsInode->clientCanCacheAll = FALSE; 436 - pCifsInode->clientCanCacheRead = FALSE; 435 + pCifsInode->clientCanCacheAll = false; 436 + pCifsInode->clientCanCacheRead = false; 437 437 if (pTcon->unix_ext) 438 438 rc = cifs_get_inode_info_unix(&inode, 439 439 full_path, inode->i_sb, xid); ··· 448 448 we can not go to the server to get the new inod 449 449 info */ 450 450 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { 451 - pCifsInode->clientCanCacheAll = TRUE; 452 - pCifsInode->clientCanCacheRead = TRUE; 451 + pCifsInode->clientCanCacheAll = true; 452 + pCifsInode->clientCanCacheRead = true; 453 453 cFYI(1, ("Exclusive Oplock granted on inode %p", 454 454 file->f_path.dentry->d_inode)); 455 455 } else if ((oplock & 0xF) == OPLOCK_READ) { 456 - pCifsInode->clientCanCacheRead = TRUE; 457 - pCifsInode->clientCanCacheAll = FALSE; 456 + pCifsInode->clientCanCacheRead = true; 457 + pCifsInode->clientCanCacheAll = false; 458 458 } else { 459 - pCifsInode->clientCanCacheRead = FALSE; 460 - pCifsInode->clientCanCacheAll = FALSE; 459 + pCifsInode->clientCanCacheRead = false; 460 + pCifsInode->clientCanCacheAll = false; 461 461 } 462 462 cifs_relock_file(pCifsFile); 463 463 } ··· 484 484 if (pSMBFile) { 485 485 struct cifsLockInfo *li, *tmp; 486 486 487 - pSMBFile->closePend = TRUE; 487 + pSMBFile->closePend = true; 488 488 if (pTcon) { 489 489 /* no sense reconnecting to close a file that is 490 490 already closed */ ··· 553 553 cFYI(1, ("closing last open instance for inode %p", inode)); 554 554 /* if the file is not open we do not know if we can cache info 555 555 on this inode, much less write behind and read ahead */ 556 - CIFS_I(inode)->clientCanCacheRead = FALSE; 557 - CIFS_I(inode)->clientCanCacheAll = FALSE; 556 + CIFS_I(inode)->clientCanCacheRead = false; 557 + CIFS_I(inode)->clientCanCacheAll = false; 558 558 } 559 559 read_unlock(&GlobalSMBSeslock); 560 560 if ((rc == 0) && CIFS_I(inode)->write_behind_rc) ··· 583 583 pTcon = cifs_sb->tcon; 584 584 585 585 cFYI(1, ("Freeing private data in close dir")); 586 - if ((pCFileStruct->srch_inf.endOfSearch == FALSE) && 587 - (pCFileStruct->invalidHandle == FALSE)) { 588 - pCFileStruct->invalidHandle = TRUE; 586 + if (!pCFileStruct->srch_inf.endOfSearch && 587 + !pCFileStruct->invalidHandle) { 588 + pCFileStruct->invalidHandle = true; 589 589 rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); 590 590 cFYI(1, ("Closing uncompleted readdir with rc %d", 591 591 rc)); ··· 637 637 __u32 numLock = 0; 638 638 __u32 numUnlock = 0; 639 639 __u64 length; 640 - int wait_flag = FALSE; 640 + bool wait_flag = false; 641 641 struct cifs_sb_info *cifs_sb; 642 642 struct cifsTconInfo *pTcon; 643 643 __u16 netfid; 644 644 __u8 lockType = LOCKING_ANDX_LARGE_FILES; 645 - int posix_locking; 645 + bool posix_locking; 646 646 647 647 length = 1 + pfLock->fl_end - pfLock->fl_start; 648 648 rc = -EACCES; ··· 659 659 cFYI(1, ("Flock")); 660 660 if (pfLock->fl_flags & FL_SLEEP) { 661 661 cFYI(1, ("Blocking lock")); 662 - wait_flag = TRUE; 662 + wait_flag = true; 663 663 } 664 664 if (pfLock->fl_flags & FL_ACCESS) 665 665 cFYI(1, ("Process suspended by mandatory locking - " ··· 794 794 stored_rc = CIFSSMBLock(xid, pTcon, 795 795 netfid, 796 796 li->length, li->offset, 797 - 1, 0, li->type, FALSE); 797 + 1, 0, li->type, false); 798 798 if (stored_rc) 799 799 rc = stored_rc; 800 800 ··· 866 866 filemap_fdatawait from here so tell 867 867 reopen_file not to flush data to server 868 868 now */ 869 - rc = cifs_reopen_file(file, FALSE); 869 + rc = cifs_reopen_file(file, false); 870 870 if (rc != 0) 871 871 break; 872 872 } ··· 966 966 filemap_fdatawait from here so tell 967 967 reopen_file not to flush data to 968 968 server now */ 969 - rc = cifs_reopen_file(file, FALSE); 969 + rc = cifs_reopen_file(file, false); 970 970 if (rc != 0) 971 971 break; 972 972 } ··· 1093 1093 1094 1094 read_unlock(&GlobalSMBSeslock); 1095 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 1097 if (!rc) { 1098 1098 if (!open_file->closePend) 1099 1099 return open_file; ··· 1608 1608 int buf_type = CIFS_NO_BUFFER; 1609 1609 if ((open_file->invalidHandle) && 1610 1610 (!open_file->closePend)) { 1611 - rc = cifs_reopen_file(file, TRUE); 1611 + rc = cifs_reopen_file(file, true); 1612 1612 if (rc != 0) 1613 1613 break; 1614 1614 } ··· 1693 1693 while (rc == -EAGAIN) { 1694 1694 if ((open_file->invalidHandle) && 1695 1695 (!open_file->closePend)) { 1696 - rc = cifs_reopen_file(file, TRUE); 1696 + rc = cifs_reopen_file(file, true); 1697 1697 if (rc != 0) 1698 1698 break; 1699 1699 } ··· 1850 1850 while (rc == -EAGAIN) { 1851 1851 if ((open_file->invalidHandle) && 1852 1852 (!open_file->closePend)) { 1853 - rc = cifs_reopen_file(file, TRUE); 1853 + rc = cifs_reopen_file(file, true); 1854 1854 if (rc != 0) 1855 1855 break; 1856 1856 } ··· 2009 2009 refreshing the inode only on increases in the file size 2010 2010 but this is tricky to do without racing with writebehind 2011 2011 page caching in the current Linux kernel design */ 2012 - int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) 2012 + bool is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) 2013 2013 { 2014 2014 if (!cifsInode) 2015 - return 1; 2015 + return true; 2016 2016 2017 2017 if (is_inode_writable(cifsInode)) { 2018 2018 /* This inode is open for write at least once */ ··· 2022 2022 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { 2023 2023 /* since no page cache to corrupt on directio 2024 2024 we can change size safely */ 2025 - return 1; 2025 + return true; 2026 2026 } 2027 2027 2028 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 2032 } else 2033 - return 1; 2033 + return true; 2034 2034 } 2035 2035 2036 2036 static int cifs_prepare_write(struct file *file, struct page *page,
+21 -25
fs/cifs/inode.c
··· 281 281 struct cifs_sb_info *cifs_sb, int xid) 282 282 { 283 283 int rc; 284 - int oplock = FALSE; 284 + int oplock = 0; 285 285 __u16 netfid; 286 286 struct cifsTconInfo *pTcon = cifs_sb->tcon; 287 287 char buf[24]; ··· 389 389 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 390 390 const unsigned char *full_path = NULL; 391 391 char *buf = NULL; 392 - int adjustTZ = FALSE; 392 + bool adjustTZ = false; 393 393 bool is_dfs_referral = false; 394 394 395 395 pTcon = cifs_sb->tcon; ··· 425 425 pfindData, cifs_sb->local_nls, 426 426 cifs_sb->mnt_cifs_flags & 427 427 CIFS_MOUNT_MAP_SPECIAL_CHR); 428 - adjustTZ = TRUE; 428 + adjustTZ = true; 429 429 } 430 430 } 431 431 /* dump_mem("\nQPathInfo return data",&findData, sizeof(findData)); */ ··· 703 703 } else if (rc == -ENOENT) { 704 704 d_drop(direntry); 705 705 } else if (rc == -ETXTBSY) { 706 - int oplock = FALSE; 706 + int oplock = 0; 707 707 __u16 netfid; 708 708 709 709 rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, DELETE, ··· 736 736 rc = -EOPNOTSUPP; 737 737 738 738 if (rc == -EOPNOTSUPP) { 739 - int oplock = FALSE; 739 + int oplock = 0; 740 740 __u16 netfid; 741 741 /* rc = CIFSSMBSetAttrLegacy(xid, pTcon, 742 742 full_path, ··· 774 774 if (direntry->d_inode) 775 775 drop_nlink(direntry->d_inode); 776 776 } else if (rc == -ETXTBSY) { 777 - int oplock = FALSE; 777 + int oplock = 0; 778 778 __u16 netfid; 779 779 780 780 rc = CIFSSMBOpen(xid, pTcon, full_path, ··· 1149 1149 cFYI(1, ("rename rc %d", rc)); 1150 1150 1151 1151 if ((rc == -EIO) || (rc == -EEXIST)) { 1152 - int oplock = FALSE; 1152 + int oplock = 0; 1153 1153 __u16 netfid; 1154 1154 1155 1155 /* BB FIXME Is Generic Read correct for rename? */ ··· 1186 1186 struct cifsInodeInfo *cifsInode; 1187 1187 loff_t local_size; 1188 1188 struct timespec local_mtime; 1189 - int invalidate_inode = FALSE; 1189 + bool invalidate_inode = false; 1190 1190 1191 1191 if (direntry->d_inode == NULL) 1192 1192 return -ENOENT; ··· 1268 1268 only ones who could have modified the file and the 1269 1269 server copy is staler than ours */ 1270 1270 } else { 1271 - invalidate_inode = TRUE; 1271 + invalidate_inode = true; 1272 1272 } 1273 1273 } 1274 1274 ··· 1402 1402 int rc = -EACCES; 1403 1403 struct cifsFileInfo *open_file = NULL; 1404 1404 FILE_BASIC_INFO time_buf; 1405 - int set_time = FALSE; 1406 - int set_dosattr = FALSE; 1405 + bool set_time = false; 1406 + bool set_dosattr = false; 1407 1407 __u64 mode = 0xFFFFFFFFFFFFFFFFULL; 1408 1408 __u64 uid = 0xFFFFFFFFFFFFFFFFULL; 1409 1409 __u64 gid = 0xFFFFFFFFFFFFFFFFULL; ··· 1464 1464 __u16 nfid = open_file->netfid; 1465 1465 __u32 npid = open_file->pid; 1466 1466 rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, 1467 - nfid, npid, FALSE); 1467 + nfid, npid, false); 1468 1468 atomic_dec(&open_file->wrtPending); 1469 1469 cFYI(1, ("SetFSize for attrs rc = %d", rc)); 1470 1470 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { ··· 1484 1484 it was found or because there was an error setting 1485 1485 it by handle */ 1486 1486 rc = CIFSSMBSetEOF(xid, pTcon, full_path, 1487 - attrs->ia_size, FALSE, 1487 + attrs->ia_size, false, 1488 1488 cifs_sb->local_nls, 1489 1489 cifs_sb->mnt_cifs_flags & 1490 1490 CIFS_MOUNT_MAP_SPECIAL_CHR); 1491 1491 cFYI(1, ("SetEOF by path (setattrs) rc = %d", rc)); 1492 1492 if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { 1493 1493 __u16 netfid; 1494 - int oplock = FALSE; 1494 + int oplock = 0; 1495 1495 1496 1496 rc = SMBLegacyOpen(xid, pTcon, full_path, 1497 1497 FILE_OPEN, ··· 1516 1516 1517 1517 /* Server is ok setting allocation size implicitly - no need 1518 1518 to call: 1519 - CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, TRUE, 1519 + CIFSSMBSetEOF(xid, pTcon, full_path, attrs->ia_size, true, 1520 1520 cifs_sb->local_nls); 1521 1521 */ 1522 1522 ··· 1564 1564 #endif 1565 1565 /* not writeable */ 1566 1566 if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) { 1567 - set_dosattr = TRUE; 1567 + set_dosattr = true; 1568 1568 time_buf.Attributes = 1569 1569 cpu_to_le32(cifsInode->cifsAttrs | 1570 1570 ATTR_READONLY); ··· 1574 1574 not be able to write to it - so if any write 1575 1575 bit is enabled for user or group or other we 1576 1576 need to at least try to remove r/o dos attr */ 1577 - set_dosattr = TRUE; 1577 + set_dosattr = true; 1578 1578 time_buf.Attributes = cpu_to_le32(cifsInode->cifsAttrs & 1579 1579 (~ATTR_READONLY)); 1580 1580 /* Windows ignores set to zero */ 1581 1581 if (time_buf.Attributes == 0) 1582 1582 time_buf.Attributes |= cpu_to_le32(ATTR_NORMAL); 1583 1583 } 1584 - #ifdef CONFIG_CIFS_EXPERIMENTAL 1585 - if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) 1586 - mode_to_acl(direntry->d_inode, full_path, mode); 1587 - #endif 1588 1584 } 1589 1585 1590 1586 if (attrs->ia_valid & ATTR_ATIME) { 1591 - set_time = TRUE; 1587 + set_time = true; 1592 1588 time_buf.LastAccessTime = 1593 1589 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_atime)); 1594 1590 } else 1595 1591 time_buf.LastAccessTime = 0; 1596 1592 1597 1593 if (attrs->ia_valid & ATTR_MTIME) { 1598 - set_time = TRUE; 1594 + set_time = true; 1599 1595 time_buf.LastWriteTime = 1600 1596 cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_mtime)); 1601 1597 } else ··· 1602 1606 server times */ 1603 1607 1604 1608 if (set_time && (attrs->ia_valid & ATTR_CTIME)) { 1605 - set_time = TRUE; 1609 + set_time = true; 1606 1610 /* Although Samba throws this field away 1607 1611 it may be useful to Windows - but we do 1608 1612 not want to set ctime unless some other ··· 1626 1630 rc = -EOPNOTSUPP; 1627 1631 1628 1632 if (rc == -EOPNOTSUPP) { 1629 - int oplock = FALSE; 1633 + int oplock = 0; 1630 1634 __u16 netfid; 1631 1635 1632 1636 cFYI(1, ("calling SetFileInfo since SetPathInfo for "
+1 -1
fs/cifs/link.c
··· 230 230 struct inode *inode = direntry->d_inode; 231 231 int rc = -EACCES; 232 232 int xid; 233 - int oplock = FALSE; 233 + int oplock = 0; 234 234 struct cifs_sb_info *cifs_sb; 235 235 struct cifsTconInfo *pTcon; 236 236 char *full_path = NULL;
+17 -16
fs/cifs/misc.c
··· 496 496 } 497 497 return 0; 498 498 } 499 - int 499 + 500 + bool 500 501 is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) 501 502 { 502 503 struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf; ··· 523 522 pnotify->Action)); /* BB removeme BB */ 524 523 /* cifs_dump_mem("Rcvd notify Data: ",buf, 525 524 sizeof(struct smb_hdr)+60); */ 526 - return TRUE; 525 + return true; 527 526 } 528 527 if (pSMBr->hdr.Status.CifsError) { 529 528 cFYI(1, ("notify err 0x%d", 530 529 pSMBr->hdr.Status.CifsError)); 531 - return TRUE; 530 + return true; 532 531 } 533 - return FALSE; 532 + return false; 534 533 } 535 534 if (pSMB->hdr.Command != SMB_COM_LOCKING_ANDX) 536 - return FALSE; 535 + return false; 537 536 if (pSMB->hdr.Flags & SMBFLG_RESPONSE) { 538 537 /* no sense logging error on invalid handle on oplock 539 538 break - harmless race between close request and oplock ··· 542 541 if ((NT_STATUS_INVALID_HANDLE) == 543 542 le32_to_cpu(pSMB->hdr.Status.CifsError)) { 544 543 cFYI(1, ("invalid handle on oplock break")); 545 - return TRUE; 544 + return true; 546 545 } else if (ERRbadfid == 547 546 le16_to_cpu(pSMB->hdr.Status.DosError.Error)) { 548 - return TRUE; 547 + return true; 549 548 } else { 550 - return FALSE; /* on valid oplock brk we get "request" */ 549 + return false; /* on valid oplock brk we get "request" */ 551 550 } 552 551 } 553 552 if (pSMB->hdr.WordCount != 8) 554 - return FALSE; 553 + return false; 555 554 556 555 cFYI(1, ("oplock type 0x%d level 0x%d", 557 556 pSMB->LockType, pSMB->OplockLevel)); 558 557 if (!(pSMB->LockType & LOCKING_ANDX_OPLOCK_RELEASE)) 559 - return FALSE; 558 + return false; 560 559 561 560 /* look up tcon based on tid & uid */ 562 561 read_lock(&GlobalSMBSeslock); ··· 574 573 ("file id match, oplock break")); 575 574 pCifsInode = 576 575 CIFS_I(netfile->pInode); 577 - pCifsInode->clientCanCacheAll = FALSE; 576 + pCifsInode->clientCanCacheAll = false; 578 577 if (pSMB->OplockLevel == 0) 579 578 pCifsInode->clientCanCacheRead 580 - = FALSE; 581 - pCifsInode->oplockPending = TRUE; 579 + = false; 580 + pCifsInode->oplockPending = true; 582 581 AllocOplockQEntry(netfile->pInode, 583 582 netfile->netfid, 584 583 tcon); ··· 586 585 ("about to wake up oplock thread")); 587 586 if (oplockThread) 588 587 wake_up_process(oplockThread); 589 - return TRUE; 588 + return true; 590 589 } 591 590 } 592 591 read_unlock(&GlobalSMBSeslock); 593 592 cFYI(1, ("No matching file for oplock break")); 594 - return TRUE; 593 + return true; 595 594 } 596 595 } 597 596 read_unlock(&GlobalSMBSeslock); 598 597 cFYI(1, ("Can not process oplock break for non-existent connection")); 599 - return TRUE; 598 + return true; 600 599 } 601 600 602 601 void
+1 -31
fs/cifs/netmisc.c
··· 132 132 {0, 0} 133 133 }; 134 134 135 - 136 - /* if the mount helper is missing we need to reverse the 1st slash 137 - from '/' to backslash in order to format the UNC properly for 138 - ip address parsing and for tree connect (unless the user 139 - remembered to put the UNC name in properly). Fortunately we do 140 - not have to call this twice (we check for IPv4 addresses 141 - first, so it is already converted by the time we 142 - try IPv6 addresses */ 143 - static int canonicalize_unc(char *cp) 144 - { 145 - int i; 146 - 147 - for (i = 0; i <= 46 /* INET6_ADDRSTRLEN */ ; i++) { 148 - if (cp[i] == 0) 149 - break; 150 - if (cp[i] == '\\') 151 - break; 152 - if (cp[i] == '/') { 153 - cFYI(DBG2, ("change slash to \\ in malformed UNC")); 154 - cp[i] = '\\'; 155 - return 1; 156 - } 157 - } 158 - return 0; 159 - } 160 - 161 135 /* Convert string containing dotted ip address to binary form */ 162 136 /* returns 0 if invalid address */ 163 137 164 138 int 165 - cifs_inet_pton(int address_family, char *cp, void *dst) 139 + cifs_inet_pton(const int address_family, const char *cp, void *dst) 166 140 { 167 141 int ret = 0; 168 142 169 143 /* calculate length by finding first slash or NULL */ 170 144 if (address_family == AF_INET) { 171 145 ret = in4_pton(cp, -1 /* len */, dst, '\\', NULL); 172 - if (ret == 0) { 173 - if (canonicalize_unc(cp)) 174 - ret = in4_pton(cp, -1, dst, '\\', NULL); 175 - } 176 146 } else if (address_family == AF_INET6) { 177 147 ret = in6_pton(cp, -1 /* len */, dst , '\\', NULL); 178 148 }
+6 -6
fs/cifs/readdir.c
··· 447 447 if (file->private_data == NULL) 448 448 return -ENOMEM; 449 449 cifsFile = file->private_data; 450 - cifsFile->invalidHandle = TRUE; 451 - cifsFile->srch_inf.endOfSearch = FALSE; 450 + cifsFile->invalidHandle = true; 451 + cifsFile->srch_inf.endOfSearch = false; 452 452 453 453 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 454 454 if (cifs_sb == NULL) ··· 485 485 cifs_sb->mnt_cifs_flags & 486 486 CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb)); 487 487 if (rc == 0) 488 - cifsFile->invalidHandle = FALSE; 488 + cifsFile->invalidHandle = false; 489 489 if ((rc == -EOPNOTSUPP) && 490 490 (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)) { 491 491 cifs_sb->mnt_cifs_flags &= ~CIFS_MOUNT_SERVER_INUM; ··· 670 670 (index_to_find < first_entry_in_buffer)) { 671 671 /* close and restart search */ 672 672 cFYI(1, ("search backing up - close and restart search")); 673 - cifsFile->invalidHandle = TRUE; 673 + cifsFile->invalidHandle = true; 674 674 CIFSFindClose(xid, pTcon, cifsFile->netfid); 675 675 kfree(cifsFile->search_resume_name); 676 676 cifsFile->search_resume_name = NULL; ··· 692 692 } 693 693 694 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 696 cFYI(1, ("calling findnext2")); 697 697 rc = CIFSFindNext(xid, pTcon, cifsFile->netfid, 698 698 &cifsFile->srch_inf); ··· 1038 1038 break; 1039 1039 } 1040 1040 } /* else { 1041 - cifsFile->invalidHandle = TRUE; 1041 + cifsFile->invalidHandle = true; 1042 1042 CIFSFindClose(xid, pTcon, cifsFile->netfid); 1043 1043 } 1044 1044 kfree(cifsFile->search_resume_name);
+4 -4
fs/cifs/smbencrypt.c
··· 35 35 #include "cifs_debug.h" 36 36 #include "cifsencrypt.h" 37 37 38 - #ifndef FALSE 39 - #define FALSE 0 38 + #ifndef false 39 + #define false 0 40 40 #endif 41 - #ifndef TRUE 42 - #define TRUE 1 41 + #ifndef true 42 + #define true 1 43 43 #endif 44 44 45 45 /* following came from the other byteorder.h to avoid include conflicts */
+1 -1
fs/cifs/xattr.c
··· 264 264 #ifdef CONFIG_CIFS_EXPERIMENTAL 265 265 else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 266 266 __u16 fid; 267 - int oplock = FALSE; 267 + int oplock = 0; 268 268 struct cifs_ntsd *pacl = NULL; 269 269 __u32 buflen = 0; 270 270 if (experimEnabled)