Commit f8d91e02 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Sasha Levin

cifs: convert printk(LEVEL...) to pr_<level>

[ Upstream commit 0b456f04 ]

The useful macros embed message level in the name. Thus, it cleans up the code
a bit. In cases when it was plain printk() the conversion was done to info
level.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSteve French <steve.french@primarydata.com>
Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
parent c4785348
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
void void
cifs_dump_mem(char *label, void *data, int length) cifs_dump_mem(char *label, void *data, int length)
{ {
printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n", pr_debug("%s: dump of %d bytes of data at 0x%p\n", label, length, data);
label, length, data);
print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 4, print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 16, 4,
data, length, true); data, length, true);
} }
...@@ -51,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...) ...@@ -51,7 +50,7 @@ void cifs_vfs_err(const char *fmt, ...)
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; vaf.va = &args;
printk(KERN_ERR "CIFS VFS: %pV", &vaf); pr_err("CIFS VFS: %pV", &vaf);
va_end(args); va_end(args);
} }
......
...@@ -53,13 +53,12 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...); ...@@ -53,13 +53,12 @@ __printf(1, 2) void cifs_vfs_err(const char *fmt, ...);
do { \ do { \
if (type == FYI) { \ if (type == FYI) { \
if (cifsFYI & CIFS_INFO) { \ if (cifsFYI & CIFS_INFO) { \
printk(KERN_DEBUG "%s: " fmt, \ pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__); \
__FILE__, ##__VA_ARGS__); \
} \ } \
} else if (type == VFS) { \ } else if (type == VFS) { \
cifs_vfs_err(fmt, ##__VA_ARGS__); \ cifs_vfs_err(fmt, ##__VA_ARGS__); \
} else if (type == NOISY && type != 0) { \ } else if (type == NOISY && type != 0) { \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ pr_debug(fmt, ##__VA_ARGS__); \
} \ } \
} while (0) } while (0)
...@@ -71,7 +70,7 @@ do { \ ...@@ -71,7 +70,7 @@ do { \
#define cifs_dbg(type, fmt, ...) \ #define cifs_dbg(type, fmt, ...) \
do { \ do { \
if (0) \ if (0) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ pr_debug(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
#endif #endif
......
...@@ -1466,9 +1466,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1466,9 +1466,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
vol->seal = 1; vol->seal = 1;
break; break;
case Opt_noac: case Opt_noac:
printk(KERN_WARNING "CIFS: Mount option noac not " pr_warn("CIFS: Mount option noac not supported. Instead set /proc/fs/cifs/LookupCacheEnabled to 0\n");
"supported. Instead set "
"/proc/fs/cifs/LookupCacheEnabled to 0\n");
break; break;
case Opt_fsc: case Opt_fsc:
#ifndef CONFIG_CIFS_FSCACHE #ifndef CONFIG_CIFS_FSCACHE
...@@ -1598,7 +1596,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1598,7 +1596,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
if (strnlen(string, CIFS_MAX_USERNAME_LEN) > if (strnlen(string, CIFS_MAX_USERNAME_LEN) >
CIFS_MAX_USERNAME_LEN) { CIFS_MAX_USERNAME_LEN) {
printk(KERN_WARNING "CIFS: username too long\n"); pr_warn("CIFS: username too long\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->username = kstrdup(string, GFP_KERNEL); vol->username = kstrdup(string, GFP_KERNEL);
...@@ -1662,8 +1660,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1662,8 +1660,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
temp_len = strlen(value); temp_len = strlen(value);
vol->password = kzalloc(temp_len+1, GFP_KERNEL); vol->password = kzalloc(temp_len+1, GFP_KERNEL);
if (vol->password == NULL) { if (vol->password == NULL) {
printk(KERN_WARNING "CIFS: no memory " pr_warn("CIFS: no memory for password\n");
"for password\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
...@@ -1687,8 +1684,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1687,8 +1684,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
if (!cifs_convert_address(dstaddr, string, if (!cifs_convert_address(dstaddr, string,
strlen(string))) { strlen(string))) {
printk(KERN_ERR "CIFS: bad ip= option (%s).\n", pr_err("CIFS: bad ip= option (%s).\n", string);
string);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
got_ip = true; got_ip = true;
...@@ -1700,15 +1696,13 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1700,15 +1696,13 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
if (strnlen(string, CIFS_MAX_DOMAINNAME_LEN) if (strnlen(string, CIFS_MAX_DOMAINNAME_LEN)
== CIFS_MAX_DOMAINNAME_LEN) { == CIFS_MAX_DOMAINNAME_LEN) {
printk(KERN_WARNING "CIFS: domain name too" pr_warn("CIFS: domain name too long\n");
" long\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
vol->domainname = kstrdup(string, GFP_KERNEL); vol->domainname = kstrdup(string, GFP_KERNEL);
if (!vol->domainname) { if (!vol->domainname) {
printk(KERN_WARNING "CIFS: no memory " pr_warn("CIFS: no memory for domainname\n");
"for domainname\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
cifs_dbg(FYI, "Domain name set\n"); cifs_dbg(FYI, "Domain name set\n");
...@@ -1721,8 +1715,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1721,8 +1715,8 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
if (!cifs_convert_address( if (!cifs_convert_address(
(struct sockaddr *)&vol->srcaddr, (struct sockaddr *)&vol->srcaddr,
string, strlen(string))) { string, strlen(string))) {
printk(KERN_WARNING "CIFS: Could not parse" pr_warn("CIFS: Could not parse srcaddr: %s\n",
" srcaddr: %s\n", string); string);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
break; break;
...@@ -1732,8 +1726,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1732,8 +1726,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
goto out_nomem; goto out_nomem;
if (strnlen(string, 1024) >= 65) { if (strnlen(string, 1024) >= 65) {
printk(KERN_WARNING "CIFS: iocharset name " pr_warn("CIFS: iocharset name too long.\n");
"too long.\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
...@@ -1741,8 +1734,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1741,8 +1734,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
vol->iocharset = kstrdup(string, vol->iocharset = kstrdup(string,
GFP_KERNEL); GFP_KERNEL);
if (!vol->iocharset) { if (!vol->iocharset) {
printk(KERN_WARNING "CIFS: no memory" pr_warn("CIFS: no memory for charset\n");
"for charset\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
} }
...@@ -1773,9 +1765,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1773,9 +1765,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
* set at top of the function * set at top of the function
*/ */
if (i == RFC1001_NAME_LEN && string[i] != 0) if (i == RFC1001_NAME_LEN && string[i] != 0)
printk(KERN_WARNING "CIFS: netbiosname" pr_warn("CIFS: netbiosname longer than 15 truncated.\n");
" longer than 15 truncated.\n");
break; break;
case Opt_servern: case Opt_servern:
/* servernetbiosname specified override *SMBSERVER */ /* servernetbiosname specified override *SMBSERVER */
...@@ -1801,8 +1791,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1801,8 +1791,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* The string has 16th byte zero still from /* The string has 16th byte zero still from
set at top of the function */ set at top of the function */
if (i == RFC1001_NAME_LEN && string[i] != 0) if (i == RFC1001_NAME_LEN && string[i] != 0)
printk(KERN_WARNING "CIFS: server net" pr_warn("CIFS: server netbiosname longer than 15 truncated.\n");
"biosname longer than 15 truncated.\n");
break; break;
case Opt_ver: case Opt_ver:
string = match_strdup(args); string = match_strdup(args);
...@@ -1814,8 +1803,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1814,8 +1803,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
break; break;
} }
/* For all other value, error */ /* For all other value, error */
printk(KERN_WARNING "CIFS: Invalid version" pr_warn("CIFS: Invalid version specified\n");
" specified\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
case Opt_vers: case Opt_vers:
string = match_strdup(args); string = match_strdup(args);
...@@ -1856,7 +1844,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1856,7 +1844,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
} }
if (!sloppy && invalid) { if (!sloppy && invalid) {
printk(KERN_ERR "CIFS: Unknown mount option \"%s\"\n", invalid); pr_err("CIFS: Unknown mount option \"%s\"\n", invalid);
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
...@@ -1882,8 +1870,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1882,8 +1870,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
/* No ip= option specified? Try to get it from UNC */ /* No ip= option specified? Try to get it from UNC */
if (!cifs_convert_address(dstaddr, &vol->UNC[2], if (!cifs_convert_address(dstaddr, &vol->UNC[2],
strlen(&vol->UNC[2]))) { strlen(&vol->UNC[2]))) {
printk(KERN_ERR "Unable to determine destination " pr_err("Unable to determine destination address.\n");
"address.\n");
goto cifs_parse_mount_err; goto cifs_parse_mount_err;
} }
} }
...@@ -1894,20 +1881,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, ...@@ -1894,20 +1881,18 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
if (uid_specified) if (uid_specified)
vol->override_uid = override_uid; vol->override_uid = override_uid;
else if (override_uid == 1) else if (override_uid == 1)
printk(KERN_NOTICE "CIFS: ignoring forceuid mount option " pr_notice("CIFS: ignoring forceuid mount option specified with no uid= option.\n");
"specified with no uid= option.\n");
if (gid_specified) if (gid_specified)
vol->override_gid = override_gid; vol->override_gid = override_gid;
else if (override_gid == 1) else if (override_gid == 1)
printk(KERN_NOTICE "CIFS: ignoring forcegid mount option " pr_notice("CIFS: ignoring forcegid mount option specified with no gid= option.\n");
"specified with no gid= option.\n");
kfree(mountdata_copy); kfree(mountdata_copy);
return 0; return 0;
out_nomem: out_nomem:
printk(KERN_WARNING "Could not allocate temporary buffer\n"); pr_warn("Could not allocate temporary buffer\n");
cifs_parse_mount_err: cifs_parse_mount_err:
kfree(string); kfree(string);
kfree(mountdata_copy); kfree(mountdata_copy);
......
...@@ -99,9 +99,9 @@ DeleteMidQEntry(struct mid_q_entry *midEntry) ...@@ -99,9 +99,9 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
something is wrong, unless it is quite a slow link or server */ something is wrong, unless it is quite a slow link or server */
if ((now - midEntry->when_alloc) > HZ) { if ((now - midEntry->when_alloc) > HZ) {
if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) { if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {
printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu", pr_debug(" CIFS slow rsp: cmd %d mid %llu",
midEntry->command, midEntry->mid); midEntry->command, midEntry->mid);
printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n", pr_info(" A: 0x%lx S: 0x%lx R: 0x%lx\n",
now - midEntry->when_alloc, now - midEntry->when_alloc,
now - midEntry->when_sent, now - midEntry->when_sent,
now - midEntry->when_received); now - midEntry->when_received);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment