aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.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/netmisc.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/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index c0b25b28be6c..af847e1cf1c1 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -150,8 +150,8 @@ cifs_inet_pton(const int address_family, const char *cp, int len, void *dst)
150 else if (address_family == AF_INET6) 150 else if (address_family == AF_INET6)
151 ret = in6_pton(cp, len, dst , '\\', NULL); 151 ret = in6_pton(cp, len, dst , '\\', NULL);
152 152
153 cFYI(DBG2, "address conversion returned %d for %*.*s", 153 cifs_dbg(NOISY, "address conversion returned %d for %*.*s\n",
154 ret, len, len, cp); 154 ret, len, len, cp);
155 if (ret > 0) 155 if (ret > 0)
156 ret = 1; 156 ret = 1;
157 return ret; 157 return ret;
@@ -887,7 +887,7 @@ map_smb_to_linux_error(char *buf, bool logErr)
887 } 887 }
888 /* else ERRHRD class errors or junk - return EIO */ 888 /* else ERRHRD class errors or junk - return EIO */
889 889
890 cFYI(1, "Mapping smb error code 0x%x to POSIX err %d", 890 cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
891 le32_to_cpu(smb->Status.CifsError), rc); 891 le32_to_cpu(smb->Status.CifsError), rc);
892 892
893 /* generic corrective action e.g. reconnect SMB session on 893 /* generic corrective action e.g. reconnect SMB session on
@@ -951,20 +951,20 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
951 SMB_TIME *st = (SMB_TIME *)&time; 951 SMB_TIME *st = (SMB_TIME *)&time;
952 SMB_DATE *sd = (SMB_DATE *)&date; 952 SMB_DATE *sd = (SMB_DATE *)&date;
953 953
954 cFYI(1, "date %d time %d", date, time); 954 cifs_dbg(FYI, "date %d time %d\n", date, time);
955 955
956 sec = 2 * st->TwoSeconds; 956 sec = 2 * st->TwoSeconds;
957 min = st->Minutes; 957 min = st->Minutes;
958 if ((sec > 59) || (min > 59)) 958 if ((sec > 59) || (min > 59))
959 cERROR(1, "illegal time min %d sec %d", min, sec); 959 cifs_dbg(VFS, "illegal time min %d sec %d\n", min, sec);
960 sec += (min * 60); 960 sec += (min * 60);
961 sec += 60 * 60 * st->Hours; 961 sec += 60 * 60 * st->Hours;
962 if (st->Hours > 24) 962 if (st->Hours > 24)
963 cERROR(1, "illegal hours %d", st->Hours); 963 cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
964 days = sd->Day; 964 days = sd->Day;
965 month = sd->Month; 965 month = sd->Month;
966 if ((days > 31) || (month > 12)) { 966 if ((days > 31) || (month > 12)) {
967 cERROR(1, "illegal date, month %d day: %d", month, days); 967 cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
968 if (month > 12) 968 if (month > 12)
969 month = 12; 969 month = 12;
970 } 970 }
@@ -990,7 +990,7 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
990 990
991 ts.tv_sec = sec + offset; 991 ts.tv_sec = sec + offset;
992 992
993 /* cFYI(1, "sec after cnvrt dos to unix time %d",sec); */ 993 /* cifs_dbg(FYI, "sec after cnvrt dos to unix time %d\n",sec); */
994 994
995 ts.tv_nsec = 0; 995 ts.tv_nsec = 0;
996 return ts; 996 return ts;