aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.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/link.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/link.c')
-rw-r--r--fs/cifs/link.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 9f6c4c45d21e..b83c3f5646bd 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
56 md5 = crypto_alloc_shash("md5", 0, 0); 56 md5 = crypto_alloc_shash("md5", 0, 0);
57 if (IS_ERR(md5)) { 57 if (IS_ERR(md5)) {
58 rc = PTR_ERR(md5); 58 rc = PTR_ERR(md5);
59 cERROR(1, "%s: Crypto md5 allocation error %d", __func__, rc); 59 cifs_dbg(VFS, "%s: Crypto md5 allocation error %d\n",
60 __func__, rc);
60 return rc; 61 return rc;
61 } 62 }
62 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); 63 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
63 sdescmd5 = kmalloc(size, GFP_KERNEL); 64 sdescmd5 = kmalloc(size, GFP_KERNEL);
64 if (!sdescmd5) { 65 if (!sdescmd5) {
65 rc = -ENOMEM; 66 rc = -ENOMEM;
66 cERROR(1, "%s: Memory allocation failure", __func__);
67 goto symlink_hash_err; 67 goto symlink_hash_err;
68 } 68 }
69 sdescmd5->shash.tfm = md5; 69 sdescmd5->shash.tfm = md5;
@@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
71 71
72 rc = crypto_shash_init(&sdescmd5->shash); 72 rc = crypto_shash_init(&sdescmd5->shash);
73 if (rc) { 73 if (rc) {
74 cERROR(1, "%s: Could not init md5 shash", __func__); 74 cifs_dbg(VFS, "%s: Could not init md5 shash\n", __func__);
75 goto symlink_hash_err; 75 goto symlink_hash_err;
76 } 76 }
77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len); 77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len);
78 if (rc) { 78 if (rc) {
79 cERROR(1, "%s: Could not update with link_str", __func__); 79 cifs_dbg(VFS, "%s: Could not update with link_str\n", __func__);
80 goto symlink_hash_err; 80 goto symlink_hash_err;
81 } 81 }
82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash); 82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash);
83 if (rc) 83 if (rc)
84 cERROR(1, "%s: Could not generate md5 hash", __func__); 84 cifs_dbg(VFS, "%s: Could not generate md5 hash\n", __func__);
85 85
86symlink_hash_err: 86symlink_hash_err:
87 crypto_free_shash(md5); 87 crypto_free_shash(md5);
@@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf,
115 115
116 rc = symlink_hash(link_len, link_str, md5_hash); 116 rc = symlink_hash(link_len, link_str, md5_hash);
117 if (rc) { 117 if (rc) {
118 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); 118 cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
119 return rc; 119 return rc;
120 } 120 }
121 121
@@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
154 154
155 rc = symlink_hash(link_len, link_str, md5_hash); 155 rc = symlink_hash(link_len, link_str, md5_hash);
156 if (rc) { 156 if (rc) {
157 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc); 157 cifs_dbg(FYI, "%s: MD5 hash failure: %d\n", __func__, rc);
158 return rc; 158 return rc;
159 } 159 }
160 160
@@ -521,7 +521,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
521 if (!full_path) 521 if (!full_path)
522 goto out; 522 goto out;
523 523
524 cFYI(1, "Full path: %s inode = 0x%p", full_path, inode); 524 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n", full_path, inode);
525 525
526 rc = -EACCES; 526 rc = -EACCES;
527 /* 527 /*
@@ -578,8 +578,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
578 goto symlink_exit; 578 goto symlink_exit;
579 } 579 }
580 580
581 cFYI(1, "Full path: %s", full_path); 581 cifs_dbg(FYI, "Full path: %s\n", full_path);
582 cFYI(1, "symname is %s", symname); 582 cifs_dbg(FYI, "symname is %s\n", symname);
583 583
584 /* BB what if DFS and this volume is on different share? BB */ 584 /* BB what if DFS and this volume is on different share? BB */
585 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 585 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS)
@@ -601,8 +601,8 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
601 inode->i_sb, xid, NULL); 601 inode->i_sb, xid, NULL);
602 602
603 if (rc != 0) { 603 if (rc != 0) {
604 cFYI(1, "Create symlink ok, getinodeinfo fail rc = %d", 604 cifs_dbg(FYI, "Create symlink ok, getinodeinfo fail rc = %d\n",
605 rc); 605 rc);
606 } else { 606 } else {
607 d_instantiate(direntry, newinode); 607 d_instantiate(direntry, newinode);
608 } 608 }