diff options
author | Steve French <sfrench@us.ibm.com> | 2005-08-21 00:42:53 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-08-21 00:42:53 -0400 |
commit | a5a2b489bae8f66559a531df99a26eb16b42299e (patch) | |
tree | 080a579fe5e5382dc3493e302174b9c584964be4 /fs/cifs | |
parent | 646352319b6cd369750a706706810d87f6b6efa7 (diff) |
[CIFS] Make CIFS statistics more accurate and add some stats that were
missing. Most importantly SMB reads were undercounted.
Signed-off-by: Steve French (sfrench@us.ibm.com)
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifs_debug.c | 30 | ||||
-rw-r--r-- | fs/cifs/cifsglob.h | 20 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 89 | ||||
-rw-r--r-- | fs/cifs/file.c | 5 | ||||
-rw-r--r-- | fs/cifs/transport.c | 2 |
5 files changed, 91 insertions, 55 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 838171328076..f4c6544468ab 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -254,36 +254,46 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
254 | buf += sprintf(buf, "\tDISCONNECTED "); | 254 | buf += sprintf(buf, "\tDISCONNECTED "); |
255 | length += 14; | 255 | length += 14; |
256 | } | 256 | } |
257 | item_length = sprintf(buf,"\nSMBs: %d Oplock Breaks: %d", | 257 | item_length = sprintf(buf, "\nSMBs: %d Oplock Breaks: %d", |
258 | atomic_read(&tcon->num_smbs_sent), | 258 | atomic_read(&tcon->num_smbs_sent), |
259 | atomic_read(&tcon->num_oplock_brks)); | 259 | atomic_read(&tcon->num_oplock_brks)); |
260 | buf += item_length; | 260 | buf += item_length; |
261 | length += item_length; | 261 | length += item_length; |
262 | item_length = sprintf(buf,"\nReads: %d Bytes %lld", | 262 | item_length = sprintf(buf, "\nReads: %d Bytes %lld", |
263 | atomic_read(&tcon->num_reads), | 263 | atomic_read(&tcon->num_reads), |
264 | (long long)(tcon->bytes_read)); | 264 | (long long)(tcon->bytes_read)); |
265 | buf += item_length; | 265 | buf += item_length; |
266 | length += item_length; | 266 | length += item_length; |
267 | item_length = sprintf(buf,"\nWrites: %d Bytes: %lld", | 267 | item_length = sprintf(buf, "\nWrites: %d Bytes: %lld", |
268 | atomic_read(&tcon->num_writes), | 268 | atomic_read(&tcon->num_writes), |
269 | (long long)(tcon->bytes_written)); | 269 | (long long)(tcon->bytes_written)); |
270 | buf += item_length; | ||
271 | length += item_length; | ||
272 | item_length = sprintf(buf, | ||
273 | "\nLocks: %d HardLinks: %d Symlinks: %d", | ||
274 | atomic_read(&tcon->num_locks), | ||
275 | atomic_read(&tcon->num_hardlinks), | ||
276 | atomic_read(&tcon->num_symlinks)); | ||
277 | buf += item_length; | ||
278 | length += item_length; | ||
279 | |||
280 | item_length = sprintf(buf, "\nOpens: %d Closes: %d Deletes: %d", | ||
281 | atomic_read(&tcon->num_opens), | ||
282 | atomic_read(&tcon->num_closes), | ||
283 | atomic_read(&tcon->num_deletes)); | ||
270 | buf += item_length; | 284 | buf += item_length; |
271 | length += item_length; | 285 | length += item_length; |
272 | item_length = sprintf(buf, | 286 | item_length = sprintf(buf, "\nMkdirs: %d Rmdirs: %d", |
273 | "\nOpens: %d Deletes: %d\nMkdirs: %d Rmdirs: %d", | ||
274 | atomic_read(&tcon->num_opens), | ||
275 | atomic_read(&tcon->num_deletes), | ||
276 | atomic_read(&tcon->num_mkdirs), | 287 | atomic_read(&tcon->num_mkdirs), |
277 | atomic_read(&tcon->num_rmdirs)); | 288 | atomic_read(&tcon->num_rmdirs)); |
278 | buf += item_length; | 289 | buf += item_length; |
279 | length += item_length; | 290 | length += item_length; |
280 | item_length = sprintf(buf, | 291 | item_length = sprintf(buf, "\nRenames: %d T2 Renames %d", |
281 | "\nRenames: %d T2 Renames %d", | ||
282 | atomic_read(&tcon->num_renames), | 292 | atomic_read(&tcon->num_renames), |
283 | atomic_read(&tcon->num_t2renames)); | 293 | atomic_read(&tcon->num_t2renames)); |
284 | buf += item_length; | 294 | buf += item_length; |
285 | length += item_length; | 295 | length += item_length; |
286 | item_length = sprintf(buf,"\nFindFirst: %d FNext %d FClose %d", | 296 | item_length = sprintf(buf, "\nFindFirst: %d FNext %d FClose %d", |
287 | atomic_read(&tcon->num_ffirst), | 297 | atomic_read(&tcon->num_ffirst), |
288 | atomic_read(&tcon->num_fnext), | 298 | atomic_read(&tcon->num_fnext), |
289 | atomic_read(&tcon->num_fclose)); | 299 | atomic_read(&tcon->num_fclose)); |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index e7ba48c61a7a..6a8c7d1bee8c 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -215,6 +215,7 @@ struct cifsTconInfo { | |||
215 | atomic_t num_reads; | 215 | atomic_t num_reads; |
216 | atomic_t num_oplock_brks; | 216 | atomic_t num_oplock_brks; |
217 | atomic_t num_opens; | 217 | atomic_t num_opens; |
218 | atomic_t num_closes; | ||
218 | atomic_t num_deletes; | 219 | atomic_t num_deletes; |
219 | atomic_t num_mkdirs; | 220 | atomic_t num_mkdirs; |
220 | atomic_t num_rmdirs; | 221 | atomic_t num_rmdirs; |
@@ -223,10 +224,27 @@ struct cifsTconInfo { | |||
223 | atomic_t num_ffirst; | 224 | atomic_t num_ffirst; |
224 | atomic_t num_fnext; | 225 | atomic_t num_fnext; |
225 | atomic_t num_fclose; | 226 | atomic_t num_fclose; |
227 | atomic_t num_hardlinks; | ||
228 | atomic_t num_symlinks; | ||
229 | atomic_t num_locks; | ||
230 | #ifdef CONFIG_CIFS_STATS2 | ||
231 | unsigned long long time_writes; | ||
232 | unsigned long long time_reads; | ||
233 | unsigned long long time_opens; | ||
234 | unsigned long long time_deletes; | ||
235 | unsigned long long time_closes; | ||
236 | unsigned long long time_mkdirs; | ||
237 | unsigned long long time_rmdirs; | ||
238 | unsigned long long time_renames; | ||
239 | unsigned long long time_t2renames; | ||
240 | unsigned long long time_ffirst; | ||
241 | unsigned long long time_fnext; | ||
242 | unsigned long long time_fclose; | ||
243 | #endif /* CONFIG_CIFS_STATS2 */ | ||
226 | __u64 bytes_read; | 244 | __u64 bytes_read; |
227 | __u64 bytes_written; | 245 | __u64 bytes_written; |
228 | spinlock_t stat_lock; | 246 | spinlock_t stat_lock; |
229 | #endif | 247 | #endif /* CONFIG_CIFS_STATS */ |
230 | FILE_SYSTEM_DEVICE_INFO fsDevInfo; | 248 | FILE_SYSTEM_DEVICE_INFO fsDevInfo; |
231 | FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if file system name truncated */ | 249 | FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if file system name truncated */ |
232 | FILE_SYSTEM_UNIX_INFO fsUnixInfo; | 250 | FILE_SYSTEM_UNIX_INFO fsUnixInfo; |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 930be0927de2..1292db50fe65 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -584,14 +584,12 @@ DelFileRetry: | |||
584 | pSMB->ByteCount = cpu_to_le16(name_len + 1); | 584 | pSMB->ByteCount = cpu_to_le16(name_len + 1); |
585 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 585 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
586 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 586 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
587 | #ifdef CONFIG_CIFS_STATS | ||
588 | atomic_inc(&tcon->num_deletes); | ||
589 | #endif | ||
587 | if (rc) { | 590 | if (rc) { |
588 | cFYI(1, ("Error in RMFile = %d", rc)); | 591 | cFYI(1, ("Error in RMFile = %d", rc)); |
589 | } | 592 | } |
590 | #ifdef CONFIG_CIFS_STATS | ||
591 | else { | ||
592 | atomic_inc(&tcon->num_deletes); | ||
593 | } | ||
594 | #endif | ||
595 | 593 | ||
596 | cifs_buf_release(pSMB); | 594 | cifs_buf_release(pSMB); |
597 | if (rc == -EAGAIN) | 595 | if (rc == -EAGAIN) |
@@ -633,14 +631,12 @@ RmDirRetry: | |||
633 | pSMB->ByteCount = cpu_to_le16(name_len + 1); | 631 | pSMB->ByteCount = cpu_to_le16(name_len + 1); |
634 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 632 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
635 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 633 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
634 | #ifdef CONFIG_CIFS_STATS | ||
635 | atomic_inc(&tcon->num_rmdirs); | ||
636 | #endif | ||
636 | if (rc) { | 637 | if (rc) { |
637 | cFYI(1, ("Error in RMDir = %d", rc)); | 638 | cFYI(1, ("Error in RMDir = %d", rc)); |
638 | } | 639 | } |
639 | #ifdef CONFIG_CIFS_STATS | ||
640 | else { | ||
641 | atomic_inc(&tcon->num_rmdirs); | ||
642 | } | ||
643 | #endif | ||
644 | 640 | ||
645 | cifs_buf_release(pSMB); | 641 | cifs_buf_release(pSMB); |
646 | if (rc == -EAGAIN) | 642 | if (rc == -EAGAIN) |
@@ -681,14 +677,13 @@ MkDirRetry: | |||
681 | pSMB->ByteCount = cpu_to_le16(name_len + 1); | 677 | pSMB->ByteCount = cpu_to_le16(name_len + 1); |
682 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 678 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
683 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 679 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
680 | #ifdef CONFIG_CIFS_STATS | ||
681 | atomic_inc(&tcon->num_mkdirs); | ||
682 | #endif | ||
684 | if (rc) { | 683 | if (rc) { |
685 | cFYI(1, ("Error in Mkdir = %d", rc)); | 684 | cFYI(1, ("Error in Mkdir = %d", rc)); |
686 | } | 685 | } |
687 | #ifdef CONFIG_CIFS_STATS | 686 | |
688 | else { | ||
689 | atomic_inc(&tcon->num_mkdirs); | ||
690 | } | ||
691 | #endif | ||
692 | cifs_buf_release(pSMB); | 687 | cifs_buf_release(pSMB); |
693 | if (rc == -EAGAIN) | 688 | if (rc == -EAGAIN) |
694 | goto MkDirRetry; | 689 | goto MkDirRetry; |
@@ -772,6 +767,9 @@ openRetry: | |||
772 | /* long_op set to 1 to allow for oplock break timeouts */ | 767 | /* long_op set to 1 to allow for oplock break timeouts */ |
773 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 768 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
774 | (struct smb_hdr *) pSMBr, &bytes_returned, 1); | 769 | (struct smb_hdr *) pSMBr, &bytes_returned, 1); |
770 | #ifdef CONFIG_CIFS_STATS | ||
771 | atomic_inc(&tcon->num_opens); | ||
772 | #endif | ||
775 | if (rc) { | 773 | if (rc) { |
776 | cFYI(1, ("Error in Open = %d", rc)); | 774 | cFYI(1, ("Error in Open = %d", rc)); |
777 | } else { | 775 | } else { |
@@ -789,11 +787,8 @@ openRetry: | |||
789 | pfile_info->EndOfFile = pSMBr->EndOfFile; | 787 | pfile_info->EndOfFile = pSMBr->EndOfFile; |
790 | pfile_info->NumberOfLinks = cpu_to_le32(1); | 788 | pfile_info->NumberOfLinks = cpu_to_le32(1); |
791 | } | 789 | } |
792 | |||
793 | #ifdef CONFIG_CIFS_STATS | ||
794 | atomic_inc(&tcon->num_opens); | ||
795 | #endif | ||
796 | } | 790 | } |
791 | |||
797 | cifs_buf_release(pSMB); | 792 | cifs_buf_release(pSMB); |
798 | if (rc == -EAGAIN) | 793 | if (rc == -EAGAIN) |
799 | goto openRetry; | 794 | goto openRetry; |
@@ -838,6 +833,9 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon, | |||
838 | 833 | ||
839 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 834 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
840 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 835 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
836 | #ifdef CONFIG_CIFS_STATS | ||
837 | atomic_inc(&tcon->num_reads); | ||
838 | #endif | ||
841 | if (rc) { | 839 | if (rc) { |
842 | cERROR(1, ("Send error in read = %d", rc)); | 840 | cERROR(1, ("Send error in read = %d", rc)); |
843 | } else { | 841 | } else { |
@@ -940,6 +938,9 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, | |||
940 | 938 | ||
941 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 939 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
942 | (struct smb_hdr *) pSMBr, &bytes_returned, long_op); | 940 | (struct smb_hdr *) pSMBr, &bytes_returned, long_op); |
941 | #ifdef CONFIG_CIFS_STATS | ||
942 | atomic_inc(&tcon->num_writes); | ||
943 | #endif | ||
943 | if (rc) { | 944 | if (rc) { |
944 | cFYI(1, ("Send error in write = %d", rc)); | 945 | cFYI(1, ("Send error in write = %d", rc)); |
945 | *nbytes = 0; | 946 | *nbytes = 0; |
@@ -1012,6 +1013,9 @@ CIFSSMBWrite2(const int xid, struct cifsTconInfo *tcon, | |||
1012 | 1013 | ||
1013 | rc = SendReceive2(xid, tcon->ses, (struct smb_hdr *) pSMB, smb_hdr_len, | 1014 | rc = SendReceive2(xid, tcon->ses, (struct smb_hdr *) pSMB, smb_hdr_len, |
1014 | buf, bytes_sent, &bytes_returned, long_op); | 1015 | buf, bytes_sent, &bytes_returned, long_op); |
1016 | #ifdef CONFIG_CIFS_STATS | ||
1017 | atomic_inc(&tcon->num_writes); | ||
1018 | #endif | ||
1015 | if (rc) { | 1019 | if (rc) { |
1016 | cFYI(1, ("Send error in write = %d", rc)); | 1020 | cFYI(1, ("Send error in write = %d", rc)); |
1017 | *nbytes = 0; | 1021 | *nbytes = 0; |
@@ -1087,7 +1091,9 @@ CIFSSMBLock(const int xid, struct cifsTconInfo *tcon, | |||
1087 | 1091 | ||
1088 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1092 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1089 | (struct smb_hdr *) pSMBr, &bytes_returned, timeout); | 1093 | (struct smb_hdr *) pSMBr, &bytes_returned, timeout); |
1090 | 1094 | #ifdef CONFIG_CIFS_STATS | |
1095 | atomic_inc(&tcon->num_locks); | ||
1096 | #endif | ||
1091 | if (rc) { | 1097 | if (rc) { |
1092 | cFYI(1, ("Send error in Lock = %d", rc)); | 1098 | cFYI(1, ("Send error in Lock = %d", rc)); |
1093 | } | 1099 | } |
@@ -1121,6 +1127,9 @@ CIFSSMBClose(const int xid, struct cifsTconInfo *tcon, int smb_file_id) | |||
1121 | pSMB->ByteCount = 0; | 1127 | pSMB->ByteCount = 0; |
1122 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1128 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1123 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1129 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1130 | #ifdef CONFIG_CIFS_STATS | ||
1131 | atomic_inc(&tcon->num_closes); | ||
1132 | #endif | ||
1124 | if (rc) { | 1133 | if (rc) { |
1125 | if(rc!=-EINTR) { | 1134 | if(rc!=-EINTR) { |
1126 | /* EINTR is expected when user ctl-c to kill app */ | 1135 | /* EINTR is expected when user ctl-c to kill app */ |
@@ -1193,16 +1202,13 @@ renameRetry: | |||
1193 | 1202 | ||
1194 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1203 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1195 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1204 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1205 | #ifdef CONFIG_CIFS_STATS | ||
1206 | atomic_inc(&tcon->num_renames); | ||
1207 | #endif | ||
1196 | if (rc) { | 1208 | if (rc) { |
1197 | cFYI(1, ("Send error in rename = %d", rc)); | 1209 | cFYI(1, ("Send error in rename = %d", rc)); |
1198 | } | 1210 | } |
1199 | 1211 | ||
1200 | #ifdef CONFIG_CIFS_STATS | ||
1201 | else { | ||
1202 | atomic_inc(&tcon->num_renames); | ||
1203 | } | ||
1204 | #endif | ||
1205 | |||
1206 | cifs_buf_release(pSMB); | 1212 | cifs_buf_release(pSMB); |
1207 | 1213 | ||
1208 | if (rc == -EAGAIN) | 1214 | if (rc == -EAGAIN) |
@@ -1277,14 +1283,13 @@ int CIFSSMBRenameOpenFile(const int xid,struct cifsTconInfo *pTcon, | |||
1277 | pSMB->ByteCount = cpu_to_le16(byte_count); | 1283 | pSMB->ByteCount = cpu_to_le16(byte_count); |
1278 | rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, | 1284 | rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, |
1279 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1285 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1286 | #ifdef CONFIG_CIFS_STATS | ||
1287 | atomic_inc(&pTcon->num_t2renames); | ||
1288 | #endif | ||
1280 | if (rc) { | 1289 | if (rc) { |
1281 | cFYI(1,("Send error in Rename (by file handle) = %d", rc)); | 1290 | cFYI(1,("Send error in Rename (by file handle) = %d", rc)); |
1282 | } | 1291 | } |
1283 | #ifdef CONFIG_CIFS_STATS | 1292 | |
1284 | else { | ||
1285 | atomic_inc(&pTcon->num_t2renames); | ||
1286 | } | ||
1287 | #endif | ||
1288 | cifs_buf_release(pSMB); | 1293 | cifs_buf_release(pSMB); |
1289 | 1294 | ||
1290 | /* Note: On -EAGAIN error only caller can retry on handle based calls | 1295 | /* Note: On -EAGAIN error only caller can retry on handle based calls |
@@ -1438,6 +1443,9 @@ createSymLinkRetry: | |||
1438 | pSMB->ByteCount = cpu_to_le16(byte_count); | 1443 | pSMB->ByteCount = cpu_to_le16(byte_count); |
1439 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1444 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1440 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1445 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1446 | #ifdef CONFIG_CIFS_STATS | ||
1447 | atomic_inc(&tcon->num_symlinks); | ||
1448 | #endif | ||
1441 | if (rc) { | 1449 | if (rc) { |
1442 | cFYI(1, | 1450 | cFYI(1, |
1443 | ("Send error in SetPathInfo (create symlink) = %d", | 1451 | ("Send error in SetPathInfo (create symlink) = %d", |
@@ -1527,6 +1535,9 @@ createHardLinkRetry: | |||
1527 | pSMB->ByteCount = cpu_to_le16(byte_count); | 1535 | pSMB->ByteCount = cpu_to_le16(byte_count); |
1528 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1536 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1529 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1537 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1538 | #ifdef CONFIG_CIFS_STATS | ||
1539 | atomic_inc(&tcon->num_hardlinks); | ||
1540 | #endif | ||
1530 | if (rc) { | 1541 | if (rc) { |
1531 | cFYI(1, ("Send error in SetPathInfo (hard link) = %d", rc)); | 1542 | cFYI(1, ("Send error in SetPathInfo (hard link) = %d", rc)); |
1532 | } | 1543 | } |
@@ -1597,6 +1608,9 @@ winCreateHardLinkRetry: | |||
1597 | 1608 | ||
1598 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 1609 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
1599 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 1610 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
1611 | #ifdef CONFIG_CIFS_STATS | ||
1612 | atomic_inc(&tcon->num_hardlinks); | ||
1613 | #endif | ||
1600 | if (rc) { | 1614 | if (rc) { |
1601 | cFYI(1, ("Send error in hard link (NT rename) = %d", rc)); | 1615 | cFYI(1, ("Send error in hard link (NT rename) = %d", rc)); |
1602 | } | 1616 | } |
@@ -2519,6 +2533,9 @@ findFirstRetry: | |||
2519 | 2533 | ||
2520 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2534 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2521 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2535 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2536 | #ifdef CONFIG_CIFS_STATS | ||
2537 | atomic_inc(&tcon->num_ffirst); | ||
2538 | #endif | ||
2522 | 2539 | ||
2523 | if (rc) {/* BB add logic to retry regular search if Unix search rejected unexpectedly by server */ | 2540 | if (rc) {/* BB add logic to retry regular search if Unix search rejected unexpectedly by server */ |
2524 | /* BB Add code to handle unsupported level rc */ | 2541 | /* BB Add code to handle unsupported level rc */ |
@@ -2532,9 +2549,6 @@ findFirstRetry: | |||
2532 | if (rc == -EAGAIN) | 2549 | if (rc == -EAGAIN) |
2533 | goto findFirstRetry; | 2550 | goto findFirstRetry; |
2534 | } else { /* decode response */ | 2551 | } else { /* decode response */ |
2535 | #ifdef CONFIG_CIFS_STATS | ||
2536 | atomic_inc(&tcon->num_ffirst); | ||
2537 | #endif | ||
2538 | /* BB remember to free buffer if error BB */ | 2552 | /* BB remember to free buffer if error BB */ |
2539 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 2553 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
2540 | if(rc == 0) { | 2554 | if(rc == 0) { |
@@ -2643,7 +2657,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
2643 | 2657 | ||
2644 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, | 2658 | rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, |
2645 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); | 2659 | (struct smb_hdr *) pSMBr, &bytes_returned, 0); |
2646 | 2660 | #ifdef CONFIG_CIFS_STATS | |
2661 | atomic_inc(&tcon->num_fnext); | ||
2662 | #endif | ||
2647 | if (rc) { | 2663 | if (rc) { |
2648 | if (rc == -EBADF) { | 2664 | if (rc == -EBADF) { |
2649 | psrch_inf->endOfSearch = TRUE; | 2665 | psrch_inf->endOfSearch = TRUE; |
@@ -2651,9 +2667,6 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
2651 | } else | 2667 | } else |
2652 | cFYI(1, ("FindNext returned = %d", rc)); | 2668 | cFYI(1, ("FindNext returned = %d", rc)); |
2653 | } else { /* decode response */ | 2669 | } else { /* decode response */ |
2654 | #ifdef CONFIG_CIFS_STATS | ||
2655 | atomic_inc(&tcon->num_fnext); | ||
2656 | #endif | ||
2657 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 2670 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
2658 | 2671 | ||
2659 | if(rc == 0) { | 2672 | if(rc == 0) { |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index ddb25a0a63d5..b054df2dee1e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -746,7 +746,6 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data, | |||
746 | 746 | ||
747 | #ifdef CONFIG_CIFS_STATS | 747 | #ifdef CONFIG_CIFS_STATS |
748 | if (total_written > 0) { | 748 | if (total_written > 0) { |
749 | atomic_inc(&pTcon->num_writes); | ||
750 | spin_lock(&pTcon->stat_lock); | 749 | spin_lock(&pTcon->stat_lock); |
751 | pTcon->bytes_written += total_written; | 750 | pTcon->bytes_written += total_written; |
752 | spin_unlock(&pTcon->stat_lock); | 751 | spin_unlock(&pTcon->stat_lock); |
@@ -881,7 +880,6 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
881 | 880 | ||
882 | #ifdef CONFIG_CIFS_STATS | 881 | #ifdef CONFIG_CIFS_STATS |
883 | if (total_written > 0) { | 882 | if (total_written > 0) { |
884 | atomic_inc(&pTcon->num_writes); | ||
885 | spin_lock(&pTcon->stat_lock); | 883 | spin_lock(&pTcon->stat_lock); |
886 | pTcon->bytes_written += total_written; | 884 | pTcon->bytes_written += total_written; |
887 | spin_unlock(&pTcon->stat_lock); | 885 | spin_unlock(&pTcon->stat_lock); |
@@ -1248,7 +1246,6 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1248 | } | 1246 | } |
1249 | } else { | 1247 | } else { |
1250 | #ifdef CONFIG_CIFS_STATS | 1248 | #ifdef CONFIG_CIFS_STATS |
1251 | atomic_inc(&pTcon->num_reads); | ||
1252 | spin_lock(&pTcon->stat_lock); | 1249 | spin_lock(&pTcon->stat_lock); |
1253 | pTcon->bytes_read += total_read; | 1250 | pTcon->bytes_read += total_read; |
1254 | spin_unlock(&pTcon->stat_lock); | 1251 | spin_unlock(&pTcon->stat_lock); |
@@ -1316,7 +1313,6 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size, | |||
1316 | } | 1313 | } |
1317 | } else { | 1314 | } else { |
1318 | #ifdef CONFIG_CIFS_STATS | 1315 | #ifdef CONFIG_CIFS_STATS |
1319 | atomic_inc(&pTcon->num_reads); | ||
1320 | spin_lock(&pTcon->stat_lock); | 1316 | spin_lock(&pTcon->stat_lock); |
1321 | pTcon->bytes_read += total_read; | 1317 | pTcon->bytes_read += total_read; |
1322 | spin_unlock(&pTcon->stat_lock); | 1318 | spin_unlock(&pTcon->stat_lock); |
@@ -1493,7 +1489,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, | |||
1493 | 1489 | ||
1494 | i += bytes_read >> PAGE_CACHE_SHIFT; | 1490 | i += bytes_read >> PAGE_CACHE_SHIFT; |
1495 | #ifdef CONFIG_CIFS_STATS | 1491 | #ifdef CONFIG_CIFS_STATS |
1496 | atomic_inc(&pTcon->num_reads); | ||
1497 | spin_lock(&pTcon->stat_lock); | 1492 | spin_lock(&pTcon->stat_lock); |
1498 | pTcon->bytes_read += bytes_read; | 1493 | pTcon->bytes_read += bytes_read; |
1499 | spin_unlock(&pTcon->stat_lock); | 1494 | spin_unlock(&pTcon->stat_lock); |
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index 496a2738bbe3..96f89eb66040 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c | |||
@@ -735,7 +735,7 @@ SendReceive(const unsigned int xid, struct cifsSesInfo *ses, | |||
735 | BCC(out_buf) = le16_to_cpu(BCC(out_buf)); | 735 | BCC(out_buf) = le16_to_cpu(BCC(out_buf)); |
736 | } else { | 736 | } else { |
737 | rc = -EIO; | 737 | rc = -EIO; |
738 | cFYI(1,("Bad MID state? ")); | 738 | cERROR(1,("Bad MID state? ")); |
739 | } | 739 | } |
740 | } | 740 | } |
741 | cifs_no_response_exit: | 741 | cifs_no_response_exit: |