aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-28 06:16:31 -0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 13:55:18 -0400
commit44c581866e2ae4bbc3c8eea5a3e3c7a0f639e12d (patch)
tree00673c45c35bcc8d79bc79c77f23b395e5ad9b79 /fs/cifs/cifssmb.c
parent9094fad1ed90caebd25b1bdec3c8982d079356ee (diff)
CIFS: Move clear/print_stats code to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index fe30bb5dd2d8..cabc7a01f5df 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -893,7 +893,7 @@ PsxDelete:
893 cFYI(1, "Posix delete returned %d", rc); 893 cFYI(1, "Posix delete returned %d", rc);
894 cifs_buf_release(pSMB); 894 cifs_buf_release(pSMB);
895 895
896 cifs_stats_inc(&tcon->num_deletes); 896 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
897 897
898 if (rc == -EAGAIN) 898 if (rc == -EAGAIN)
899 goto PsxDelete; 899 goto PsxDelete;
@@ -936,7 +936,7 @@ DelFileRetry:
936 pSMB->ByteCount = cpu_to_le16(name_len + 1); 936 pSMB->ByteCount = cpu_to_le16(name_len + 1);
937 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 937 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
938 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 938 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
939 cifs_stats_inc(&tcon->num_deletes); 939 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
940 if (rc) 940 if (rc)
941 cFYI(1, "Error in RMFile = %d", rc); 941 cFYI(1, "Error in RMFile = %d", rc);
942 942
@@ -981,7 +981,7 @@ RmDirRetry:
981 pSMB->ByteCount = cpu_to_le16(name_len + 1); 981 pSMB->ByteCount = cpu_to_le16(name_len + 1);
982 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 982 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
983 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 983 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
984 cifs_stats_inc(&tcon->num_rmdirs); 984 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs);
985 if (rc) 985 if (rc)
986 cFYI(1, "Error in RMDir = %d", rc); 986 cFYI(1, "Error in RMDir = %d", rc);
987 987
@@ -1024,7 +1024,7 @@ MkDirRetry:
1024 pSMB->ByteCount = cpu_to_le16(name_len + 1); 1024 pSMB->ByteCount = cpu_to_le16(name_len + 1);
1025 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1025 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1026 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1026 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1027 cifs_stats_inc(&tcon->num_mkdirs); 1027 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs);
1028 if (rc) 1028 if (rc)
1029 cFYI(1, "Error in Mkdir = %d", rc); 1029 cFYI(1, "Error in Mkdir = %d", rc);
1030 1030
@@ -1147,9 +1147,9 @@ psx_create_err:
1147 cifs_buf_release(pSMB); 1147 cifs_buf_release(pSMB);
1148 1148
1149 if (posix_flags & SMB_O_DIRECTORY) 1149 if (posix_flags & SMB_O_DIRECTORY)
1150 cifs_stats_inc(&tcon->num_posixmkdirs); 1150 cifs_stats_inc(&tcon->stats.cifs_stats.num_posixmkdirs);
1151 else 1151 else
1152 cifs_stats_inc(&tcon->num_posixopens); 1152 cifs_stats_inc(&tcon->stats.cifs_stats.num_posixopens);
1153 1153
1154 if (rc == -EAGAIN) 1154 if (rc == -EAGAIN)
1155 goto PsxCreat; 1155 goto PsxCreat;
@@ -1270,7 +1270,7 @@ OldOpenRetry:
1270 /* long_op set to 1 to allow for oplock break timeouts */ 1270 /* long_op set to 1 to allow for oplock break timeouts */
1271 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1271 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1272 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1272 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1273 cifs_stats_inc(&tcon->num_opens); 1273 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1274 if (rc) { 1274 if (rc) {
1275 cFYI(1, "Error in Open = %d", rc); 1275 cFYI(1, "Error in Open = %d", rc);
1276 } else { 1276 } else {
@@ -1383,7 +1383,7 @@ openRetry:
1383 /* long_op set to 1 to allow for oplock break timeouts */ 1383 /* long_op set to 1 to allow for oplock break timeouts */
1384 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1384 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1385 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1385 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1386 cifs_stats_inc(&tcon->num_opens); 1386 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1387 if (rc) { 1387 if (rc) {
1388 cFYI(1, "Error in Open = %d", rc); 1388 cFYI(1, "Error in Open = %d", rc);
1389 } else { 1389 } else {
@@ -1650,7 +1650,7 @@ cifs_async_readv(struct cifs_readdata *rdata)
1650 rdata, 0); 1650 rdata, 0);
1651 1651
1652 if (rc == 0) 1652 if (rc == 0)
1653 cifs_stats_inc(&tcon->num_reads); 1653 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1654 else 1654 else
1655 kref_put(&rdata->refcount, cifs_readdata_release); 1655 kref_put(&rdata->refcount, cifs_readdata_release);
1656 1656
@@ -1720,7 +1720,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1720 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4; 1720 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4;
1721 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */, 1721 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
1722 &resp_buf_type, CIFS_LOG_ERROR); 1722 &resp_buf_type, CIFS_LOG_ERROR);
1723 cifs_stats_inc(&tcon->num_reads); 1723 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1724 pSMBr = (READ_RSP *)iov[0].iov_base; 1724 pSMBr = (READ_RSP *)iov[0].iov_base;
1725 if (rc) { 1725 if (rc) {
1726 cERROR(1, "Send error in read = %d", rc); 1726 cERROR(1, "Send error in read = %d", rc);
@@ -1872,7 +1872,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1872 1872
1873 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1873 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1874 (struct smb_hdr *) pSMBr, &bytes_returned, long_op); 1874 (struct smb_hdr *) pSMBr, &bytes_returned, long_op);
1875 cifs_stats_inc(&tcon->num_writes); 1875 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
1876 if (rc) { 1876 if (rc) {
1877 cFYI(1, "Send error in write = %d", rc); 1877 cFYI(1, "Send error in write = %d", rc);
1878 } else { 1878 } else {
@@ -2123,7 +2123,7 @@ cifs_async_writev(struct cifs_writedata *wdata)
2123 NULL, cifs_writev_callback, wdata, 0); 2123 NULL, cifs_writev_callback, wdata, 0);
2124 2124
2125 if (rc == 0) 2125 if (rc == 0)
2126 cifs_stats_inc(&tcon->num_writes); 2126 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2127 else 2127 else
2128 kref_put(&wdata->refcount, cifs_writedata_release); 2128 kref_put(&wdata->refcount, cifs_writedata_release);
2129 2129
@@ -2213,7 +2213,7 @@ CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2213 2213
2214 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 2214 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type,
2215 long_op); 2215 long_op);
2216 cifs_stats_inc(&tcon->num_writes); 2216 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2217 if (rc) { 2217 if (rc) {
2218 cFYI(1, "Send error Write2 = %d", rc); 2218 cFYI(1, "Send error Write2 = %d", rc);
2219 } else if (resp_buf_type == 0) { 2219 } else if (resp_buf_type == 0) {
@@ -2279,7 +2279,7 @@ int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2279 iov[1].iov_base = (char *)buf; 2279 iov[1].iov_base = (char *)buf;
2280 iov[1].iov_len = (num_unlock + num_lock) * sizeof(LOCKING_ANDX_RANGE); 2280 iov[1].iov_len = (num_unlock + num_lock) * sizeof(LOCKING_ANDX_RANGE);
2281 2281
2282 cifs_stats_inc(&tcon->num_locks); 2282 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2283 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); 2283 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
2284 if (rc) 2284 if (rc)
2285 cFYI(1, "Send error in cifs_lockv = %d", rc); 2285 cFYI(1, "Send error in cifs_lockv = %d", rc);
@@ -2348,7 +2348,7 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2348 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, flags); 2348 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, flags);
2349 /* SMB buffer freed by function above */ 2349 /* SMB buffer freed by function above */
2350 } 2350 }
2351 cifs_stats_inc(&tcon->num_locks); 2351 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2352 if (rc) 2352 if (rc)
2353 cFYI(1, "Send error in Lock = %d", rc); 2353 cFYI(1, "Send error in Lock = %d", rc);
2354 2354
@@ -2511,7 +2511,7 @@ CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2511 pSMB->LastWriteTime = 0xFFFFFFFF; 2511 pSMB->LastWriteTime = 0xFFFFFFFF;
2512 pSMB->ByteCount = 0; 2512 pSMB->ByteCount = 0;
2513 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2513 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2514 cifs_stats_inc(&tcon->num_closes); 2514 cifs_stats_inc(&tcon->stats.cifs_stats.num_closes);
2515 if (rc) { 2515 if (rc) {
2516 if (rc != -EINTR) { 2516 if (rc != -EINTR) {
2517 /* EINTR is expected when user ctl-c to kill app */ 2517 /* EINTR is expected when user ctl-c to kill app */
@@ -2540,7 +2540,7 @@ CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2540 pSMB->FileID = (__u16) smb_file_id; 2540 pSMB->FileID = (__u16) smb_file_id;
2541 pSMB->ByteCount = 0; 2541 pSMB->ByteCount = 0;
2542 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2542 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2543 cifs_stats_inc(&tcon->num_flushes); 2543 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes);
2544 if (rc) 2544 if (rc)
2545 cERROR(1, "Send error in Flush = %d", rc); 2545 cERROR(1, "Send error in Flush = %d", rc);
2546 2546
@@ -2603,7 +2603,7 @@ renameRetry:
2603 2603
2604 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2604 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2605 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2605 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2606 cifs_stats_inc(&tcon->num_renames); 2606 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames);
2607 if (rc) 2607 if (rc)
2608 cFYI(1, "Send error in rename = %d", rc); 2608 cFYI(1, "Send error in rename = %d", rc);
2609 2609
@@ -2684,7 +2684,7 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2684 pSMB->ByteCount = cpu_to_le16(byte_count); 2684 pSMB->ByteCount = cpu_to_le16(byte_count);
2685 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, 2685 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB,
2686 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2686 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2687 cifs_stats_inc(&pTcon->num_t2renames); 2687 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames);
2688 if (rc) 2688 if (rc)
2689 cFYI(1, "Send error in Rename (by file handle) = %d", rc); 2689 cFYI(1, "Send error in Rename (by file handle) = %d", rc);
2690 2690
@@ -2841,7 +2841,7 @@ createSymLinkRetry:
2841 pSMB->ByteCount = cpu_to_le16(byte_count); 2841 pSMB->ByteCount = cpu_to_le16(byte_count);
2842 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2842 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2843 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2843 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2844 cifs_stats_inc(&tcon->num_symlinks); 2844 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks);
2845 if (rc) 2845 if (rc)
2846 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc); 2846 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc);
2847 2847
@@ -2927,7 +2927,7 @@ createHardLinkRetry:
2927 pSMB->ByteCount = cpu_to_le16(byte_count); 2927 pSMB->ByteCount = cpu_to_le16(byte_count);
2928 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2928 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2929 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2929 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2930 cifs_stats_inc(&tcon->num_hardlinks); 2930 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2931 if (rc) 2931 if (rc)
2932 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc); 2932 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc);
2933 2933
@@ -2999,7 +2999,7 @@ winCreateHardLinkRetry:
2999 2999
3000 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3000 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3001 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3001 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3002 cifs_stats_inc(&tcon->num_hardlinks); 3002 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
3003 if (rc) 3003 if (rc)
3004 cFYI(1, "Send error in hard link (NT rename) = %d", rc); 3004 cFYI(1, "Send error in hard link (NT rename) = %d", rc);
3005 3005
@@ -3417,7 +3417,7 @@ queryAclRetry:
3417 3417
3418 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3418 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3419 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3419 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3420 cifs_stats_inc(&tcon->num_acl_get); 3420 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3421 if (rc) { 3421 if (rc) {
3422 cFYI(1, "Send error in Query POSIX ACL = %d", rc); 3422 cFYI(1, "Send error in Query POSIX ACL = %d", rc);
3423 } else { 3423 } else {
@@ -3728,7 +3728,7 @@ CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3728 3728
3729 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type, 3729 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,
3730 0); 3730 0);
3731 cifs_stats_inc(&tcon->num_acl_get); 3731 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3732 if (rc) { 3732 if (rc) {
3733 cFYI(1, "Send error in QuerySecDesc = %d", rc); 3733 cFYI(1, "Send error in QuerySecDesc = %d", rc);
3734 } else { /* decode response */ 3734 } else { /* decode response */
@@ -4330,7 +4330,7 @@ findFirstRetry:
4330 4330
4331 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4331 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4332 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4332 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4333 cifs_stats_inc(&tcon->num_ffirst); 4333 cifs_stats_inc(&tcon->stats.cifs_stats.num_ffirst);
4334 4334
4335 if (rc) {/* BB add logic to retry regular search if Unix search 4335 if (rc) {/* BB add logic to retry regular search if Unix search
4336 rejected unexpectedly by server */ 4336 rejected unexpectedly by server */
@@ -4457,7 +4457,7 @@ int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4457 4457
4458 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4458 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4459 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4459 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4460 cifs_stats_inc(&tcon->num_fnext); 4460 cifs_stats_inc(&tcon->stats.cifs_stats.num_fnext);
4461 if (rc) { 4461 if (rc) {
4462 if (rc == -EBADF) { 4462 if (rc == -EBADF) {
4463 psrch_inf->endOfSearch = true; 4463 psrch_inf->endOfSearch = true;
@@ -4548,7 +4548,7 @@ CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4548 if (rc) 4548 if (rc)
4549 cERROR(1, "Send error in FindClose = %d", rc); 4549 cERROR(1, "Send error in FindClose = %d", rc);
4550 4550
4551 cifs_stats_inc(&tcon->num_fclose); 4551 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose);
4552 4552
4553 /* Since session is dead, search handle closed on server already */ 4553 /* Since session is dead, search handle closed on server already */
4554 if (rc == -EAGAIN) 4554 if (rc == -EAGAIN)