aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2transport.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-05-04 23:12:25 -0400
committerSteve French <smfrench@gmail.com>2013-05-04 23:17:23 -0400
commitf96637be081141d6f8813429499f164260b49d70 (patch)
treec91f5a9b5a2b7a67bbeda15d7c9805655547a098 /fs/cifs/smb2transport.c
parentf7f7c1850eb98da758731ea7edfa830ebefe24cd (diff)
[CIFS] cifs: Rename cERROR and cFYI to cifs_dbg
It's not obvious from reading the macro names that these macros are for debugging. Convert the names to a single more typical kernel style cifs_dbg macro. cERROR(1, ...) -> cifs_dbg(VFS, ...) cFYI(1, ...) -> cifs_dbg(FYI, ...) cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...) Move the terminating format newline from the macro to the call site. Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the "CIFS VFS: " prefix for VFS messages. Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y) $ size fs/cifs/cifs.ko* text data bss dec hex filename 265245 2525 132 267902 4167e fs/cifs/cifs.ko.new 268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old Other miscellaneous changes around these conversions: o Miscellaneous typo fixes o Add terminating \n's to almost all formats and remove them from the macros to be more kernel style like. A few formats previously had defective \n's o Remove unnecessary OOM messages as kmalloc() calls dump_stack o Coalesce formats to make grep easier, added missing spaces when coalescing formats o Use %s, __func__ instead of embedded function name o Removed unnecessary "cifs: " prefixes o Convert kzalloc with multiply to kcalloc o Remove unused cifswarn macro Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2transport.c')
-rw-r--r--fs/cifs/smb2transport.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
index 8dd73e61d762..01f0ac800780 100644
--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -55,13 +55,13 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
55 rc = crypto_shash_setkey(server->secmech.hmacsha256, 55 rc = crypto_shash_setkey(server->secmech.hmacsha256,
56 server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE); 56 server->session_key.response, SMB2_NTLMV2_SESSKEY_SIZE);
57 if (rc) { 57 if (rc) {
58 cERROR(1, "%s: Could not update with response\n", __func__); 58 cifs_dbg(VFS, "%s: Could not update with response\n", __func__);
59 return rc; 59 return rc;
60 } 60 }
61 61
62 rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash); 62 rc = crypto_shash_init(&server->secmech.sdeschmacsha256->shash);
63 if (rc) { 63 if (rc) {
64 cERROR(1, "%s: Could not init md5\n", __func__); 64 cifs_dbg(VFS, "%s: Could not init md5\n", __func__);
65 return rc; 65 return rc;
66 } 66 }
67 67
@@ -69,7 +69,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
69 if (iov[i].iov_len == 0) 69 if (iov[i].iov_len == 0)
70 continue; 70 continue;
71 if (iov[i].iov_base == NULL) { 71 if (iov[i].iov_base == NULL) {
72 cERROR(1, "null iovec entry"); 72 cifs_dbg(VFS, "null iovec entry\n");
73 return -EIO; 73 return -EIO;
74 } 74 }
75 /* 75 /*
@@ -90,8 +90,8 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
90 iov[i].iov_base, iov[i].iov_len); 90 iov[i].iov_base, iov[i].iov_len);
91 } 91 }
92 if (rc) { 92 if (rc) {
93 cERROR(1, "%s: Could not update with payload\n", 93 cifs_dbg(VFS, "%s: Could not update with payload\n",
94 __func__); 94 __func__);
95 return rc; 95 return rc;
96 } 96 }
97 } 97 }
@@ -109,7 +109,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
109 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash, 109 rc = crypto_shash_final(&server->secmech.sdeschmacsha256->shash,
110 sigptr); 110 sigptr);
111 if (rc) 111 if (rc)
112 cERROR(1, "%s: Could not generate sha256 hash\n", __func__); 112 cifs_dbg(VFS, "%s: Could not generate sha256 hash\n", __func__);
113 113
114 memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE); 114 memcpy(smb2_pdu->Signature, sigptr, SMB2_SIGNATURE_SIZE);
115 115
@@ -119,7 +119,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
119int 119int
120smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) 120smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
121{ 121{
122 cFYI(1, "smb3 signatures not supported yet"); 122 cifs_dbg(FYI, "smb3 signatures not supported yet\n");
123 return -EOPNOTSUPP; 123 return -EOPNOTSUPP;
124} 124}
125 125
@@ -163,8 +163,8 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
163 163
164 /* Do not need to verify session setups with signature "BSRSPYL " */ 164 /* Do not need to verify session setups with signature "BSRSPYL " */
165 if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0) 165 if (memcmp(smb2_pdu->Signature, "BSRSPYL ", 8) == 0)
166 cFYI(1, "dummy signature received for smb command 0x%x", 166 cifs_dbg(FYI, "dummy signature received for smb command 0x%x\n",
167 smb2_pdu->Command); 167 smb2_pdu->Command);
168 168
169 /* 169 /*
170 * Save off the origiginal signature so we can modify the smb and check 170 * Save off the origiginal signature so we can modify the smb and check
@@ -205,7 +205,7 @@ smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer,
205 struct mid_q_entry *temp; 205 struct mid_q_entry *temp;
206 206
207 if (server == NULL) { 207 if (server == NULL) {
208 cERROR(1, "Null TCP session in smb2_mid_entry_alloc"); 208 cifs_dbg(VFS, "Null TCP session in smb2_mid_entry_alloc\n");
209 return NULL; 209 return NULL;
210 } 210 }
211 211
@@ -241,7 +241,7 @@ smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf,
241 return -ENOENT; 241 return -ENOENT;
242 242
243 if (ses->server->tcpStatus == CifsNeedReconnect) { 243 if (ses->server->tcpStatus == CifsNeedReconnect) {
244 cFYI(1, "tcp session dead - return to caller to retry"); 244 cifs_dbg(FYI, "tcp session dead - return to caller to retry\n");
245 return -EAGAIN; 245 return -EAGAIN;
246 } 246 }
247 247
@@ -281,8 +281,8 @@ smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
281 281
282 rc = smb2_verify_signature(&rqst, server); 282 rc = smb2_verify_signature(&rqst, server);
283 if (rc) 283 if (rc)
284 cERROR(1, "SMB signature verification returned error = " 284 cifs_dbg(VFS, "SMB signature verification returned error = %d\n",
285 "%d", rc); 285 rc);
286 } 286 }
287 287
288 return map_smb2_to_linux_error(mid->resp_buf, log_error); 288 return map_smb2_to_linux_error(mid->resp_buf, log_error);