diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 172 |
1 files changed, 85 insertions, 87 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 1361d67f68f3..ed3689e6617c 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -136,15 +136,15 @@ cifs_posix_open_inode_helper(struct inode *inode, struct file *file, | |||
136 | if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && | 136 | if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && |
137 | (file->f_path.dentry->d_inode->i_size == | 137 | (file->f_path.dentry->d_inode->i_size == |
138 | (loff_t)le64_to_cpu(buf->EndOfFile))) { | 138 | (loff_t)le64_to_cpu(buf->EndOfFile))) { |
139 | cFYI(1, ("inode unchanged on server")); | 139 | cFYI(1, "inode unchanged on server"); |
140 | } else { | 140 | } else { |
141 | if (file->f_path.dentry->d_inode->i_mapping) { | 141 | if (file->f_path.dentry->d_inode->i_mapping) { |
142 | rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); | 142 | rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); |
143 | if (rc != 0) | 143 | if (rc != 0) |
144 | CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; | 144 | CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; |
145 | } | 145 | } |
146 | cFYI(1, ("invalidating remote inode since open detected it " | 146 | cFYI(1, "invalidating remote inode since open detected it " |
147 | "changed")); | 147 | "changed"); |
148 | invalidate_remote_inode(file->f_path.dentry->d_inode); | 148 | invalidate_remote_inode(file->f_path.dentry->d_inode); |
149 | } */ | 149 | } */ |
150 | 150 | ||
@@ -152,8 +152,8 @@ psx_client_can_cache: | |||
152 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 152 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
153 | pCifsInode->clientCanCacheAll = true; | 153 | pCifsInode->clientCanCacheAll = true; |
154 | pCifsInode->clientCanCacheRead = true; | 154 | pCifsInode->clientCanCacheRead = true; |
155 | cFYI(1, ("Exclusive Oplock granted on inode %p", | 155 | cFYI(1, "Exclusive Oplock granted on inode %p", |
156 | file->f_path.dentry->d_inode)); | 156 | file->f_path.dentry->d_inode); |
157 | } else if ((oplock & 0xF) == OPLOCK_READ) | 157 | } else if ((oplock & 0xF) == OPLOCK_READ) |
158 | pCifsInode->clientCanCacheRead = true; | 158 | pCifsInode->clientCanCacheRead = true; |
159 | 159 | ||
@@ -190,8 +190,8 @@ cifs_fill_filedata(struct file *file) | |||
190 | if (file->private_data != NULL) { | 190 | if (file->private_data != NULL) { |
191 | return pCifsFile; | 191 | return pCifsFile; |
192 | } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL)) | 192 | } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL)) |
193 | cERROR(1, ("could not find file instance for " | 193 | cERROR(1, "could not find file instance for " |
194 | "new file %p", file)); | 194 | "new file %p", file); |
195 | return NULL; | 195 | return NULL; |
196 | } | 196 | } |
197 | 197 | ||
@@ -217,7 +217,7 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file, | |||
217 | if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && | 217 | if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && |
218 | (file->f_path.dentry->d_inode->i_size == | 218 | (file->f_path.dentry->d_inode->i_size == |
219 | (loff_t)le64_to_cpu(buf->EndOfFile))) { | 219 | (loff_t)le64_to_cpu(buf->EndOfFile))) { |
220 | cFYI(1, ("inode unchanged on server")); | 220 | cFYI(1, "inode unchanged on server"); |
221 | } else { | 221 | } else { |
222 | if (file->f_path.dentry->d_inode->i_mapping) { | 222 | if (file->f_path.dentry->d_inode->i_mapping) { |
223 | /* BB no need to lock inode until after invalidate | 223 | /* BB no need to lock inode until after invalidate |
@@ -226,8 +226,8 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file, | |||
226 | if (rc != 0) | 226 | if (rc != 0) |
227 | CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; | 227 | CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; |
228 | } | 228 | } |
229 | cFYI(1, ("invalidating remote inode since open detected it " | 229 | cFYI(1, "invalidating remote inode since open detected it " |
230 | "changed")); | 230 | "changed"); |
231 | invalidate_remote_inode(file->f_path.dentry->d_inode); | 231 | invalidate_remote_inode(file->f_path.dentry->d_inode); |
232 | } | 232 | } |
233 | 233 | ||
@@ -242,8 +242,8 @@ client_can_cache: | |||
242 | if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 242 | if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
243 | pCifsInode->clientCanCacheAll = true; | 243 | pCifsInode->clientCanCacheAll = true; |
244 | pCifsInode->clientCanCacheRead = true; | 244 | pCifsInode->clientCanCacheRead = true; |
245 | cFYI(1, ("Exclusive Oplock granted on inode %p", | 245 | cFYI(1, "Exclusive Oplock granted on inode %p", |
246 | file->f_path.dentry->d_inode)); | 246 | file->f_path.dentry->d_inode); |
247 | } else if ((*oplock & 0xF) == OPLOCK_READ) | 247 | } else if ((*oplock & 0xF) == OPLOCK_READ) |
248 | pCifsInode->clientCanCacheRead = true; | 248 | pCifsInode->clientCanCacheRead = true; |
249 | 249 | ||
@@ -285,8 +285,8 @@ int cifs_open(struct inode *inode, struct file *file) | |||
285 | return rc; | 285 | return rc; |
286 | } | 286 | } |
287 | 287 | ||
288 | cFYI(1, ("inode = 0x%p file flags are 0x%x for %s", | 288 | cFYI(1, "inode = 0x%p file flags are 0x%x for %s", |
289 | inode, file->f_flags, full_path)); | 289 | inode, file->f_flags, full_path); |
290 | 290 | ||
291 | if (oplockEnabled) | 291 | if (oplockEnabled) |
292 | oplock = REQ_OPLOCK; | 292 | oplock = REQ_OPLOCK; |
@@ -303,7 +303,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
303 | cifs_sb->mnt_file_mode /* ignored */, | 303 | cifs_sb->mnt_file_mode /* ignored */, |
304 | oflags, &oplock, &netfid, xid); | 304 | oflags, &oplock, &netfid, xid); |
305 | if (rc == 0) { | 305 | if (rc == 0) { |
306 | cFYI(1, ("posix open succeeded")); | 306 | cFYI(1, "posix open succeeded"); |
307 | /* no need for special case handling of setting mode | 307 | /* no need for special case handling of setting mode |
308 | on read only files needed here */ | 308 | on read only files needed here */ |
309 | 309 | ||
@@ -313,12 +313,12 @@ int cifs_open(struct inode *inode, struct file *file) | |||
313 | goto out; | 313 | goto out; |
314 | } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { | 314 | } else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) { |
315 | if (tcon->ses->serverNOS) | 315 | if (tcon->ses->serverNOS) |
316 | cERROR(1, ("server %s of type %s returned" | 316 | cERROR(1, "server %s of type %s returned" |
317 | " unexpected error on SMB posix open" | 317 | " unexpected error on SMB posix open" |
318 | ", disabling posix open support." | 318 | ", disabling posix open support." |
319 | " Check if server update available.", | 319 | " Check if server update available.", |
320 | tcon->ses->serverName, | 320 | tcon->ses->serverName, |
321 | tcon->ses->serverNOS)); | 321 | tcon->ses->serverNOS); |
322 | tcon->broken_posix_open = true; | 322 | tcon->broken_posix_open = true; |
323 | } else if ((rc != -EIO) && (rc != -EREMOTE) && | 323 | } else if ((rc != -EIO) && (rc != -EREMOTE) && |
324 | (rc != -EOPNOTSUPP)) /* path not found or net err */ | 324 | (rc != -EOPNOTSUPP)) /* path not found or net err */ |
@@ -386,7 +386,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
386 | & CIFS_MOUNT_MAP_SPECIAL_CHR); | 386 | & CIFS_MOUNT_MAP_SPECIAL_CHR); |
387 | } | 387 | } |
388 | if (rc) { | 388 | if (rc) { |
389 | cFYI(1, ("cifs_open returned 0x%x", rc)); | 389 | cFYI(1, "cifs_open returned 0x%x", rc); |
390 | goto out; | 390 | goto out; |
391 | } | 391 | } |
392 | 392 | ||
@@ -469,7 +469,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush) | |||
469 | } | 469 | } |
470 | 470 | ||
471 | if (file->f_path.dentry == NULL) { | 471 | if (file->f_path.dentry == NULL) { |
472 | cERROR(1, ("no valid name if dentry freed")); | 472 | cERROR(1, "no valid name if dentry freed"); |
473 | dump_stack(); | 473 | dump_stack(); |
474 | rc = -EBADF; | 474 | rc = -EBADF; |
475 | goto reopen_error_exit; | 475 | goto reopen_error_exit; |
@@ -477,7 +477,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush) | |||
477 | 477 | ||
478 | inode = file->f_path.dentry->d_inode; | 478 | inode = file->f_path.dentry->d_inode; |
479 | if (inode == NULL) { | 479 | if (inode == NULL) { |
480 | cERROR(1, ("inode not valid")); | 480 | cERROR(1, "inode not valid"); |
481 | dump_stack(); | 481 | dump_stack(); |
482 | rc = -EBADF; | 482 | rc = -EBADF; |
483 | goto reopen_error_exit; | 483 | goto reopen_error_exit; |
@@ -499,8 +499,8 @@ reopen_error_exit: | |||
499 | return rc; | 499 | return rc; |
500 | } | 500 | } |
501 | 501 | ||
502 | cFYI(1, ("inode = 0x%p file flags 0x%x for %s", | 502 | cFYI(1, "inode = 0x%p file flags 0x%x for %s", |
503 | inode, file->f_flags, full_path)); | 503 | inode, file->f_flags, full_path); |
504 | 504 | ||
505 | if (oplockEnabled) | 505 | if (oplockEnabled) |
506 | oplock = REQ_OPLOCK; | 506 | oplock = REQ_OPLOCK; |
@@ -516,7 +516,7 @@ reopen_error_exit: | |||
516 | cifs_sb->mnt_file_mode /* ignored */, | 516 | cifs_sb->mnt_file_mode /* ignored */, |
517 | oflags, &oplock, &netfid, xid); | 517 | oflags, &oplock, &netfid, xid); |
518 | if (rc == 0) { | 518 | if (rc == 0) { |
519 | cFYI(1, ("posix reopen succeeded")); | 519 | cFYI(1, "posix reopen succeeded"); |
520 | goto reopen_success; | 520 | goto reopen_success; |
521 | } | 521 | } |
522 | /* fallthrough to retry open the old way on errors, especially | 522 | /* fallthrough to retry open the old way on errors, especially |
@@ -537,8 +537,8 @@ reopen_error_exit: | |||
537 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 537 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
538 | if (rc) { | 538 | if (rc) { |
539 | mutex_unlock(&pCifsFile->fh_mutex); | 539 | mutex_unlock(&pCifsFile->fh_mutex); |
540 | cFYI(1, ("cifs_open returned 0x%x", rc)); | 540 | cFYI(1, "cifs_open returned 0x%x", rc); |
541 | cFYI(1, ("oplock: %d", oplock)); | 541 | cFYI(1, "oplock: %d", oplock); |
542 | } else { | 542 | } else { |
543 | reopen_success: | 543 | reopen_success: |
544 | pCifsFile->netfid = netfid; | 544 | pCifsFile->netfid = netfid; |
@@ -570,8 +570,8 @@ reopen_success: | |||
570 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 570 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
571 | pCifsInode->clientCanCacheAll = true; | 571 | pCifsInode->clientCanCacheAll = true; |
572 | pCifsInode->clientCanCacheRead = true; | 572 | pCifsInode->clientCanCacheRead = true; |
573 | cFYI(1, ("Exclusive Oplock granted on inode %p", | 573 | cFYI(1, "Exclusive Oplock granted on inode %p", |
574 | file->f_path.dentry->d_inode)); | 574 | file->f_path.dentry->d_inode); |
575 | } else if ((oplock & 0xF) == OPLOCK_READ) { | 575 | } else if ((oplock & 0xF) == OPLOCK_READ) { |
576 | pCifsInode->clientCanCacheRead = true; | 576 | pCifsInode->clientCanCacheRead = true; |
577 | pCifsInode->clientCanCacheAll = false; | 577 | pCifsInode->clientCanCacheAll = false; |
@@ -619,8 +619,7 @@ int cifs_close(struct inode *inode, struct file *file) | |||
619 | the struct would be in each open file, | 619 | the struct would be in each open file, |
620 | but this should give enough time to | 620 | but this should give enough time to |
621 | clear the socket */ | 621 | clear the socket */ |
622 | cFYI(DBG2, | 622 | cFYI(DBG2, "close delay, write pending"); |
623 | ("close delay, write pending")); | ||
624 | msleep(timeout); | 623 | msleep(timeout); |
625 | timeout *= 4; | 624 | timeout *= 4; |
626 | } | 625 | } |
@@ -653,7 +652,7 @@ int cifs_close(struct inode *inode, struct file *file) | |||
653 | 652 | ||
654 | read_lock(&GlobalSMBSeslock); | 653 | read_lock(&GlobalSMBSeslock); |
655 | if (list_empty(&(CIFS_I(inode)->openFileList))) { | 654 | if (list_empty(&(CIFS_I(inode)->openFileList))) { |
656 | cFYI(1, ("closing last open instance for inode %p", inode)); | 655 | cFYI(1, "closing last open instance for inode %p", inode); |
657 | /* if the file is not open we do not know if we can cache info | 656 | /* if the file is not open we do not know if we can cache info |
658 | on this inode, much less write behind and read ahead */ | 657 | on this inode, much less write behind and read ahead */ |
659 | CIFS_I(inode)->clientCanCacheRead = false; | 658 | CIFS_I(inode)->clientCanCacheRead = false; |
@@ -674,7 +673,7 @@ int cifs_closedir(struct inode *inode, struct file *file) | |||
674 | (struct cifsFileInfo *)file->private_data; | 673 | (struct cifsFileInfo *)file->private_data; |
675 | char *ptmp; | 674 | char *ptmp; |
676 | 675 | ||
677 | cFYI(1, ("Closedir inode = 0x%p", inode)); | 676 | cFYI(1, "Closedir inode = 0x%p", inode); |
678 | 677 | ||
679 | xid = GetXid(); | 678 | xid = GetXid(); |
680 | 679 | ||
@@ -685,22 +684,22 @@ int cifs_closedir(struct inode *inode, struct file *file) | |||
685 | 684 | ||
686 | pTcon = cifs_sb->tcon; | 685 | pTcon = cifs_sb->tcon; |
687 | 686 | ||
688 | cFYI(1, ("Freeing private data in close dir")); | 687 | cFYI(1, "Freeing private data in close dir"); |
689 | write_lock(&GlobalSMBSeslock); | 688 | write_lock(&GlobalSMBSeslock); |
690 | if (!pCFileStruct->srch_inf.endOfSearch && | 689 | if (!pCFileStruct->srch_inf.endOfSearch && |
691 | !pCFileStruct->invalidHandle) { | 690 | !pCFileStruct->invalidHandle) { |
692 | pCFileStruct->invalidHandle = true; | 691 | pCFileStruct->invalidHandle = true; |
693 | write_unlock(&GlobalSMBSeslock); | 692 | write_unlock(&GlobalSMBSeslock); |
694 | rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); | 693 | rc = CIFSFindClose(xid, pTcon, pCFileStruct->netfid); |
695 | cFYI(1, ("Closing uncompleted readdir with rc %d", | 694 | cFYI(1, "Closing uncompleted readdir with rc %d", |
696 | rc)); | 695 | rc); |
697 | /* not much we can do if it fails anyway, ignore rc */ | 696 | /* not much we can do if it fails anyway, ignore rc */ |
698 | rc = 0; | 697 | rc = 0; |
699 | } else | 698 | } else |
700 | write_unlock(&GlobalSMBSeslock); | 699 | write_unlock(&GlobalSMBSeslock); |
701 | ptmp = pCFileStruct->srch_inf.ntwrk_buf_start; | 700 | ptmp = pCFileStruct->srch_inf.ntwrk_buf_start; |
702 | if (ptmp) { | 701 | if (ptmp) { |
703 | cFYI(1, ("closedir free smb buf in srch struct")); | 702 | cFYI(1, "closedir free smb buf in srch struct"); |
704 | pCFileStruct->srch_inf.ntwrk_buf_start = NULL; | 703 | pCFileStruct->srch_inf.ntwrk_buf_start = NULL; |
705 | if (pCFileStruct->srch_inf.smallBuf) | 704 | if (pCFileStruct->srch_inf.smallBuf) |
706 | cifs_small_buf_release(ptmp); | 705 | cifs_small_buf_release(ptmp); |
@@ -748,49 +747,49 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) | |||
748 | rc = -EACCES; | 747 | rc = -EACCES; |
749 | xid = GetXid(); | 748 | xid = GetXid(); |
750 | 749 | ||
751 | cFYI(1, ("Lock parm: 0x%x flockflags: " | 750 | cFYI(1, "Lock parm: 0x%x flockflags: " |
752 | "0x%x flocktype: 0x%x start: %lld end: %lld", | 751 | "0x%x flocktype: 0x%x start: %lld end: %lld", |
753 | cmd, pfLock->fl_flags, pfLock->fl_type, pfLock->fl_start, | 752 | cmd, pfLock->fl_flags, pfLock->fl_type, pfLock->fl_start, |
754 | pfLock->fl_end)); | 753 | pfLock->fl_end); |
755 | 754 | ||
756 | if (pfLock->fl_flags & FL_POSIX) | 755 | if (pfLock->fl_flags & FL_POSIX) |
757 | cFYI(1, ("Posix")); | 756 | cFYI(1, "Posix"); |
758 | if (pfLock->fl_flags & FL_FLOCK) | 757 | if (pfLock->fl_flags & FL_FLOCK) |
759 | cFYI(1, ("Flock")); | 758 | cFYI(1, "Flock"); |
760 | if (pfLock->fl_flags & FL_SLEEP) { | 759 | if (pfLock->fl_flags & FL_SLEEP) { |
761 | cFYI(1, ("Blocking lock")); | 760 | cFYI(1, "Blocking lock"); |
762 | wait_flag = true; | 761 | wait_flag = true; |
763 | } | 762 | } |
764 | if (pfLock->fl_flags & FL_ACCESS) | 763 | if (pfLock->fl_flags & FL_ACCESS) |
765 | cFYI(1, ("Process suspended by mandatory locking - " | 764 | cFYI(1, "Process suspended by mandatory locking - " |
766 | "not implemented yet")); | 765 | "not implemented yet"); |
767 | if (pfLock->fl_flags & FL_LEASE) | 766 | if (pfLock->fl_flags & FL_LEASE) |
768 | cFYI(1, ("Lease on file - not implemented yet")); | 767 | cFYI(1, "Lease on file - not implemented yet"); |
769 | if (pfLock->fl_flags & | 768 | if (pfLock->fl_flags & |
770 | (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE))) | 769 | (~(FL_POSIX | FL_FLOCK | FL_SLEEP | FL_ACCESS | FL_LEASE))) |
771 | cFYI(1, ("Unknown lock flags 0x%x", pfLock->fl_flags)); | 770 | cFYI(1, "Unknown lock flags 0x%x", pfLock->fl_flags); |
772 | 771 | ||
773 | if (pfLock->fl_type == F_WRLCK) { | 772 | if (pfLock->fl_type == F_WRLCK) { |
774 | cFYI(1, ("F_WRLCK ")); | 773 | cFYI(1, "F_WRLCK "); |
775 | numLock = 1; | 774 | numLock = 1; |
776 | } else if (pfLock->fl_type == F_UNLCK) { | 775 | } else if (pfLock->fl_type == F_UNLCK) { |
777 | cFYI(1, ("F_UNLCK")); | 776 | cFYI(1, "F_UNLCK"); |
778 | numUnlock = 1; | 777 | numUnlock = 1; |
779 | /* Check if unlock includes more than | 778 | /* Check if unlock includes more than |
780 | one lock range */ | 779 | one lock range */ |
781 | } else if (pfLock->fl_type == F_RDLCK) { | 780 | } else if (pfLock->fl_type == F_RDLCK) { |
782 | cFYI(1, ("F_RDLCK")); | 781 | cFYI(1, "F_RDLCK"); |
783 | lockType |= LOCKING_ANDX_SHARED_LOCK; | 782 | lockType |= LOCKING_ANDX_SHARED_LOCK; |
784 | numLock = 1; | 783 | numLock = 1; |
785 | } else if (pfLock->fl_type == F_EXLCK) { | 784 | } else if (pfLock->fl_type == F_EXLCK) { |
786 | cFYI(1, ("F_EXLCK")); | 785 | cFYI(1, "F_EXLCK"); |
787 | numLock = 1; | 786 | numLock = 1; |
788 | } else if (pfLock->fl_type == F_SHLCK) { | 787 | } else if (pfLock->fl_type == F_SHLCK) { |
789 | cFYI(1, ("F_SHLCK")); | 788 | cFYI(1, "F_SHLCK"); |
790 | lockType |= LOCKING_ANDX_SHARED_LOCK; | 789 | lockType |= LOCKING_ANDX_SHARED_LOCK; |
791 | numLock = 1; | 790 | numLock = 1; |
792 | } else | 791 | } else |
793 | cFYI(1, ("Unknown type of lock")); | 792 | cFYI(1, "Unknown type of lock"); |
794 | 793 | ||
795 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 794 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
796 | tcon = cifs_sb->tcon; | 795 | tcon = cifs_sb->tcon; |
@@ -833,8 +832,8 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) | |||
833 | 0 /* wait flag */ ); | 832 | 0 /* wait flag */ ); |
834 | pfLock->fl_type = F_UNLCK; | 833 | pfLock->fl_type = F_UNLCK; |
835 | if (rc != 0) | 834 | if (rc != 0) |
836 | cERROR(1, ("Error unlocking previously locked " | 835 | cERROR(1, "Error unlocking previously locked " |
837 | "range %d during test of lock", rc)); | 836 | "range %d during test of lock", rc); |
838 | rc = 0; | 837 | rc = 0; |
839 | 838 | ||
840 | } else { | 839 | } else { |
@@ -988,9 +987,8 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, | |||
988 | 987 | ||
989 | pTcon = cifs_sb->tcon; | 988 | pTcon = cifs_sb->tcon; |
990 | 989 | ||
991 | /* cFYI(1, | 990 | /* cFYI(1, " write %d bytes to offset %lld of %s", write_size, |
992 | (" write %d bytes to offset %lld of %s", write_size, | 991 | *poffset, file->f_path.dentry->d_name.name); */ |
993 | *poffset, file->f_path.dentry->d_name.name)); */ | ||
994 | 992 | ||
995 | if (file->private_data == NULL) | 993 | if (file->private_data == NULL) |
996 | return -EBADF; | 994 | return -EBADF; |
@@ -1091,8 +1089,8 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
1091 | 1089 | ||
1092 | pTcon = cifs_sb->tcon; | 1090 | pTcon = cifs_sb->tcon; |
1093 | 1091 | ||
1094 | cFYI(1, ("write %zd bytes to offset %lld of %s", write_size, | 1092 | cFYI(1, "write %zd bytes to offset %lld of %s", write_size, |
1095 | *poffset, file->f_path.dentry->d_name.name)); | 1093 | *poffset, file->f_path.dentry->d_name.name); |
1096 | 1094 | ||
1097 | if (file->private_data == NULL) | 1095 | if (file->private_data == NULL) |
1098 | return -EBADF; | 1096 | return -EBADF; |
@@ -1233,7 +1231,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode) | |||
1233 | it being zero) during stress testcases so we need to check for it */ | 1231 | it being zero) during stress testcases so we need to check for it */ |
1234 | 1232 | ||
1235 | if (cifs_inode == NULL) { | 1233 | if (cifs_inode == NULL) { |
1236 | cERROR(1, ("Null inode passed to cifs_writeable_file")); | 1234 | cERROR(1, "Null inode passed to cifs_writeable_file"); |
1237 | dump_stack(); | 1235 | dump_stack(); |
1238 | return NULL; | 1236 | return NULL; |
1239 | } | 1237 | } |
@@ -1277,7 +1275,7 @@ refind_writable: | |||
1277 | again. Note that it would be bad | 1275 | again. Note that it would be bad |
1278 | to hold up writepages here (rather than | 1276 | to hold up writepages here (rather than |
1279 | in caller) with continuous retries */ | 1277 | in caller) with continuous retries */ |
1280 | cFYI(1, ("wp failed on reopen file")); | 1278 | cFYI(1, "wp failed on reopen file"); |
1281 | read_lock(&GlobalSMBSeslock); | 1279 | read_lock(&GlobalSMBSeslock); |
1282 | /* can not use this handle, no write | 1280 | /* can not use this handle, no write |
1283 | pending on this one after all */ | 1281 | pending on this one after all */ |
@@ -1353,7 +1351,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) | |||
1353 | else if (bytes_written < 0) | 1351 | else if (bytes_written < 0) |
1354 | rc = bytes_written; | 1352 | rc = bytes_written; |
1355 | } else { | 1353 | } else { |
1356 | cFYI(1, ("No writeable filehandles for inode")); | 1354 | cFYI(1, "No writeable filehandles for inode"); |
1357 | rc = -EIO; | 1355 | rc = -EIO; |
1358 | } | 1356 | } |
1359 | 1357 | ||
@@ -1525,7 +1523,7 @@ retry: | |||
1525 | */ | 1523 | */ |
1526 | open_file = find_writable_file(CIFS_I(mapping->host)); | 1524 | open_file = find_writable_file(CIFS_I(mapping->host)); |
1527 | if (!open_file) { | 1525 | if (!open_file) { |
1528 | cERROR(1, ("No writable handles for inode")); | 1526 | cERROR(1, "No writable handles for inode"); |
1529 | rc = -EBADF; | 1527 | rc = -EBADF; |
1530 | } else { | 1528 | } else { |
1531 | long_op = cifs_write_timeout(cifsi, offset); | 1529 | long_op = cifs_write_timeout(cifsi, offset); |
@@ -1538,8 +1536,8 @@ retry: | |||
1538 | cifs_update_eof(cifsi, offset, bytes_written); | 1536 | cifs_update_eof(cifsi, offset, bytes_written); |
1539 | 1537 | ||
1540 | if (rc || bytes_written < bytes_to_write) { | 1538 | if (rc || bytes_written < bytes_to_write) { |
1541 | cERROR(1, ("Write2 ret %d, wrote %d", | 1539 | cERROR(1, "Write2 ret %d, wrote %d", |
1542 | rc, bytes_written)); | 1540 | rc, bytes_written); |
1543 | /* BB what if continued retry is | 1541 | /* BB what if continued retry is |
1544 | requested via mount flags? */ | 1542 | requested via mount flags? */ |
1545 | if (rc == -ENOSPC) | 1543 | if (rc == -ENOSPC) |
@@ -1600,7 +1598,7 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc) | |||
1600 | /* BB add check for wbc flags */ | 1598 | /* BB add check for wbc flags */ |
1601 | page_cache_get(page); | 1599 | page_cache_get(page); |
1602 | if (!PageUptodate(page)) | 1600 | if (!PageUptodate(page)) |
1603 | cFYI(1, ("ppw - page not up to date")); | 1601 | cFYI(1, "ppw - page not up to date"); |
1604 | 1602 | ||
1605 | /* | 1603 | /* |
1606 | * Set the "writeback" flag, and clear "dirty" in the radix tree. | 1604 | * Set the "writeback" flag, and clear "dirty" in the radix tree. |
@@ -1629,8 +1627,8 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, | |||
1629 | int rc; | 1627 | int rc; |
1630 | struct inode *inode = mapping->host; | 1628 | struct inode *inode = mapping->host; |
1631 | 1629 | ||
1632 | cFYI(1, ("write_end for page %p from pos %lld with %d bytes", | 1630 | cFYI(1, "write_end for page %p from pos %lld with %d bytes", |
1633 | page, pos, copied)); | 1631 | page, pos, copied); |
1634 | 1632 | ||
1635 | if (PageChecked(page)) { | 1633 | if (PageChecked(page)) { |
1636 | if (copied == len) | 1634 | if (copied == len) |
@@ -1686,8 +1684,8 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
1686 | 1684 | ||
1687 | xid = GetXid(); | 1685 | xid = GetXid(); |
1688 | 1686 | ||
1689 | cFYI(1, ("Sync file - name: %s datasync: 0x%x", | 1687 | cFYI(1, "Sync file - name: %s datasync: 0x%x", |
1690 | dentry->d_name.name, datasync)); | 1688 | dentry->d_name.name, datasync); |
1691 | 1689 | ||
1692 | rc = filemap_write_and_wait(inode->i_mapping); | 1690 | rc = filemap_write_and_wait(inode->i_mapping); |
1693 | if (rc == 0) { | 1691 | if (rc == 0) { |
@@ -1711,7 +1709,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
1711 | unsigned int rpages = 0; | 1709 | unsigned int rpages = 0; |
1712 | int rc = 0; | 1710 | int rc = 0; |
1713 | 1711 | ||
1714 | cFYI(1, ("sync page %p",page)); | 1712 | cFYI(1, "sync page %p",page); |
1715 | mapping = page->mapping; | 1713 | mapping = page->mapping; |
1716 | if (!mapping) | 1714 | if (!mapping) |
1717 | return 0; | 1715 | return 0; |
@@ -1722,7 +1720,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
1722 | /* fill in rpages then | 1720 | /* fill in rpages then |
1723 | result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */ | 1721 | result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */ |
1724 | 1722 | ||
1725 | /* cFYI(1, ("rpages is %d for sync page of Index %ld", rpages, index)); | 1723 | /* cFYI(1, "rpages is %d for sync page of Index %ld", rpages, index); |
1726 | 1724 | ||
1727 | #if 0 | 1725 | #if 0 |
1728 | if (rc < 0) | 1726 | if (rc < 0) |
@@ -1756,7 +1754,7 @@ int cifs_flush(struct file *file, fl_owner_t id) | |||
1756 | CIFS_I(inode)->write_behind_rc = 0; | 1754 | CIFS_I(inode)->write_behind_rc = 0; |
1757 | } | 1755 | } |
1758 | 1756 | ||
1759 | cFYI(1, ("Flush inode %p file %p rc %d", inode, file, rc)); | 1757 | cFYI(1, "Flush inode %p file %p rc %d", inode, file, rc); |
1760 | 1758 | ||
1761 | return rc; | 1759 | return rc; |
1762 | } | 1760 | } |
@@ -1788,7 +1786,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1788 | open_file = (struct cifsFileInfo *)file->private_data; | 1786 | open_file = (struct cifsFileInfo *)file->private_data; |
1789 | 1787 | ||
1790 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) | 1788 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) |
1791 | cFYI(1, ("attempting read on write only file instance")); | 1789 | cFYI(1, "attempting read on write only file instance"); |
1792 | 1790 | ||
1793 | for (total_read = 0, current_offset = read_data; | 1791 | for (total_read = 0, current_offset = read_data; |
1794 | read_size > total_read; | 1792 | read_size > total_read; |
@@ -1869,7 +1867,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
1869 | open_file = (struct cifsFileInfo *)file->private_data; | 1867 | open_file = (struct cifsFileInfo *)file->private_data; |
1870 | 1868 | ||
1871 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) | 1869 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) |
1872 | cFYI(1, ("attempting read on write only file instance")); | 1870 | cFYI(1, "attempting read on write only file instance"); |
1873 | 1871 | ||
1874 | for (total_read = 0, current_offset = read_data; | 1872 | for (total_read = 0, current_offset = read_data; |
1875 | read_size > total_read; | 1873 | read_size > total_read; |
@@ -1920,7 +1918,7 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) | |||
1920 | xid = GetXid(); | 1918 | xid = GetXid(); |
1921 | rc = cifs_revalidate_file(file); | 1919 | rc = cifs_revalidate_file(file); |
1922 | if (rc) { | 1920 | if (rc) { |
1923 | cFYI(1, ("Validation prior to mmap failed, error=%d", rc)); | 1921 | cFYI(1, "Validation prior to mmap failed, error=%d", rc); |
1924 | FreeXid(xid); | 1922 | FreeXid(xid); |
1925 | return rc; | 1923 | return rc; |
1926 | } | 1924 | } |
@@ -1946,7 +1944,7 @@ static void cifs_copy_cache_pages(struct address_space *mapping, | |||
1946 | if (add_to_page_cache_lru(page, mapping, page->index, | 1944 | if (add_to_page_cache_lru(page, mapping, page->index, |
1947 | GFP_KERNEL)) { | 1945 | GFP_KERNEL)) { |
1948 | page_cache_release(page); | 1946 | page_cache_release(page); |
1949 | cFYI(1, ("Add page cache failed")); | 1947 | cFYI(1, "Add page cache failed"); |
1950 | data += PAGE_CACHE_SIZE; | 1948 | data += PAGE_CACHE_SIZE; |
1951 | bytes_read -= PAGE_CACHE_SIZE; | 1949 | bytes_read -= PAGE_CACHE_SIZE; |
1952 | continue; | 1950 | continue; |
@@ -2033,8 +2031,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
2033 | /* Read size needs to be in multiples of one page */ | 2031 | /* Read size needs to be in multiples of one page */ |
2034 | read_size = min_t(const unsigned int, read_size, | 2032 | read_size = min_t(const unsigned int, read_size, |
2035 | cifs_sb->rsize & PAGE_CACHE_MASK); | 2033 | cifs_sb->rsize & PAGE_CACHE_MASK); |
2036 | cFYI(DBG2, ("rpages: read size 0x%x contiguous pages %d", | 2034 | cFYI(DBG2, "rpages: read size 0x%x contiguous pages %d", |
2037 | read_size, contig_pages)); | 2035 | read_size, contig_pages); |
2038 | rc = -EAGAIN; | 2036 | rc = -EAGAIN; |
2039 | while (rc == -EAGAIN) { | 2037 | while (rc == -EAGAIN) { |
2040 | if ((open_file->invalidHandle) && | 2038 | if ((open_file->invalidHandle) && |
@@ -2061,7 +2059,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
2061 | } | 2059 | } |
2062 | } | 2060 | } |
2063 | if ((rc < 0) || (smb_read_data == NULL)) { | 2061 | if ((rc < 0) || (smb_read_data == NULL)) { |
2064 | cFYI(1, ("Read error in readpages: %d", rc)); | 2062 | cFYI(1, "Read error in readpages: %d", rc); |
2065 | break; | 2063 | break; |
2066 | } else if (bytes_read > 0) { | 2064 | } else if (bytes_read > 0) { |
2067 | task_io_account_read(bytes_read); | 2065 | task_io_account_read(bytes_read); |
@@ -2084,9 +2082,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
2084 | /* break; */ | 2082 | /* break; */ |
2085 | } | 2083 | } |
2086 | } else { | 2084 | } else { |
2087 | cFYI(1, ("No bytes read (%d) at offset %lld . " | 2085 | cFYI(1, "No bytes read (%d) at offset %lld . " |
2088 | "Cleaning remaining pages from readahead list", | 2086 | "Cleaning remaining pages from readahead list", |
2089 | bytes_read, offset)); | 2087 | bytes_read, offset); |
2090 | /* BB turn off caching and do new lookup on | 2088 | /* BB turn off caching and do new lookup on |
2091 | file size at server? */ | 2089 | file size at server? */ |
2092 | break; | 2090 | break; |
@@ -2129,7 +2127,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
2129 | if (rc < 0) | 2127 | if (rc < 0) |
2130 | goto io_error; | 2128 | goto io_error; |
2131 | else | 2129 | else |
2132 | cFYI(1, ("Bytes read %d", rc)); | 2130 | cFYI(1, "Bytes read %d", rc); |
2133 | 2131 | ||
2134 | file->f_path.dentry->d_inode->i_atime = | 2132 | file->f_path.dentry->d_inode->i_atime = |
2135 | current_fs_time(file->f_path.dentry->d_inode->i_sb); | 2133 | current_fs_time(file->f_path.dentry->d_inode->i_sb); |
@@ -2161,8 +2159,8 @@ static int cifs_readpage(struct file *file, struct page *page) | |||
2161 | return rc; | 2159 | return rc; |
2162 | } | 2160 | } |
2163 | 2161 | ||
2164 | cFYI(1, ("readpage %p at offset %d 0x%x\n", | 2162 | cFYI(1, "readpage %p at offset %d 0x%x\n", |
2165 | page, (int)offset, (int)offset)); | 2163 | page, (int)offset, (int)offset); |
2166 | 2164 | ||
2167 | rc = cifs_readpage_worker(file, page, &offset); | 2165 | rc = cifs_readpage_worker(file, page, &offset); |
2168 | 2166 | ||
@@ -2232,7 +2230,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping, | |||
2232 | struct page *page; | 2230 | struct page *page; |
2233 | int rc = 0; | 2231 | int rc = 0; |
2234 | 2232 | ||
2235 | cFYI(1, ("write_begin from %lld len %d", (long long)pos, len)); | 2233 | cFYI(1, "write_begin from %lld len %d", (long long)pos, len); |
2236 | 2234 | ||
2237 | page = grab_cache_page_write_begin(mapping, index, flags); | 2235 | page = grab_cache_page_write_begin(mapping, index, flags); |
2238 | if (!page) { | 2236 | if (!page) { |
@@ -2319,7 +2317,7 @@ cifs_oplock_break(struct slow_work *work) | |||
2319 | rc = waitrc; | 2317 | rc = waitrc; |
2320 | if (rc) | 2318 | if (rc) |
2321 | cinode->write_behind_rc = rc; | 2319 | cinode->write_behind_rc = rc; |
2322 | cFYI(1, ("Oplock flush inode %p rc %d", inode, rc)); | 2320 | cFYI(1, "Oplock flush inode %p rc %d", inode, rc); |
2323 | } | 2321 | } |
2324 | 2322 | ||
2325 | /* | 2323 | /* |
@@ -2331,7 +2329,7 @@ cifs_oplock_break(struct slow_work *work) | |||
2331 | if (!cfile->closePend && !cfile->oplock_break_cancelled) { | 2329 | if (!cfile->closePend && !cfile->oplock_break_cancelled) { |
2332 | rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0, | 2330 | rc = CIFSSMBLock(0, cifs_sb->tcon, cfile->netfid, 0, 0, 0, 0, |
2333 | LOCKING_ANDX_OPLOCK_RELEASE, false); | 2331 | LOCKING_ANDX_OPLOCK_RELEASE, false); |
2334 | cFYI(1, ("Oplock release rc = %d", rc)); | 2332 | cFYI(1, "Oplock release rc = %d", rc); |
2335 | } | 2333 | } |
2336 | } | 2334 | } |
2337 | 2335 | ||