summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.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/dir.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/dir.c')
-rw-r--r--fs/cifs/dir.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 1cd016217448..46e455ece573 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -102,7 +102,7 @@ cifs_bp_rename_retry:
102 namelen += (1 + temp->d_name.len); 102 namelen += (1 + temp->d_name.len);
103 temp = temp->d_parent; 103 temp = temp->d_parent;
104 if (temp == NULL) { 104 if (temp == NULL) {
105 cERROR(1, "corrupt dentry"); 105 cifs_dbg(VFS, "corrupt dentry\n");
106 rcu_read_unlock(); 106 rcu_read_unlock();
107 return NULL; 107 return NULL;
108 } 108 }
@@ -124,12 +124,12 @@ cifs_bp_rename_retry:
124 full_path[namelen] = dirsep; 124 full_path[namelen] = dirsep;
125 strncpy(full_path + namelen + 1, temp->d_name.name, 125 strncpy(full_path + namelen + 1, temp->d_name.name,
126 temp->d_name.len); 126 temp->d_name.len);
127 cFYI(0, "name: %s", full_path + namelen); 127 cifs_dbg(FYI, "name: %s\n", full_path + namelen);
128 } 128 }
129 spin_unlock(&temp->d_lock); 129 spin_unlock(&temp->d_lock);
130 temp = temp->d_parent; 130 temp = temp->d_parent;
131 if (temp == NULL) { 131 if (temp == NULL) {
132 cERROR(1, "corrupt dentry"); 132 cifs_dbg(VFS, "corrupt dentry\n");
133 rcu_read_unlock(); 133 rcu_read_unlock();
134 kfree(full_path); 134 kfree(full_path);
135 return NULL; 135 return NULL;
@@ -137,8 +137,8 @@ cifs_bp_rename_retry:
137 } 137 }
138 rcu_read_unlock(); 138 rcu_read_unlock();
139 if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) { 139 if (namelen != dfsplen || read_seqretry(&rename_lock, seq)) {
140 cFYI(1, "did not end path lookup where expected. namelen=%d " 140 cifs_dbg(FYI, "did not end path lookup where expected. namelen=%ddfsplen=%d\n",
141 "dfsplen=%d", namelen, dfsplen); 141 namelen, dfsplen);
142 /* presumably this is only possible if racing with a rename 142 /* presumably this is only possible if racing with a rename
143 of one of the parent directories (we can not lock the dentries 143 of one of the parent directories (we can not lock the dentries
144 above us to prevent this, but retrying should be harmless) */ 144 above us to prevent this, but retrying should be harmless) */
@@ -178,7 +178,7 @@ check_name(struct dentry *direntry)
178 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) { 178 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)) {
179 for (i = 0; i < direntry->d_name.len; i++) { 179 for (i = 0; i < direntry->d_name.len; i++) {
180 if (direntry->d_name.name[i] == '\\') { 180 if (direntry->d_name.name[i] == '\\') {
181 cFYI(1, "Invalid file name"); 181 cifs_dbg(FYI, "Invalid file name\n");
182 return -EINVAL; 182 return -EINVAL;
183 } 183 }
184 } 184 }
@@ -291,7 +291,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
291 else if ((oflags & O_CREAT) == O_CREAT) 291 else if ((oflags & O_CREAT) == O_CREAT)
292 disposition = FILE_OPEN_IF; 292 disposition = FILE_OPEN_IF;
293 else 293 else
294 cFYI(1, "Create flag not set in create function"); 294 cifs_dbg(FYI, "Create flag not set in create function\n");
295 295
296 /* 296 /*
297 * BB add processing to set equivalent of mode - e.g. via CreateX with 297 * BB add processing to set equivalent of mode - e.g. via CreateX with
@@ -323,7 +323,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
323 desired_access, create_options, fid, oplock, 323 desired_access, create_options, fid, oplock,
324 buf, cifs_sb); 324 buf, cifs_sb);
325 if (rc) { 325 if (rc) {
326 cFYI(1, "cifs_create returned 0x%x", rc); 326 cifs_dbg(FYI, "cifs_create returned 0x%x\n", rc);
327 goto out; 327 goto out;
328 } 328 }
329 329
@@ -389,7 +389,8 @@ cifs_create_get_file_info:
389 389
390cifs_create_set_dentry: 390cifs_create_set_dentry:
391 if (rc != 0) { 391 if (rc != 0) {
392 cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); 392 cifs_dbg(FYI, "Create worked, get_inode_info failed rc = %d\n",
393 rc);
393 if (server->ops->close) 394 if (server->ops->close)
394 server->ops->close(xid, tcon, fid); 395 server->ops->close(xid, tcon, fid);
395 goto out; 396 goto out;
@@ -452,8 +453,8 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
452 453
453 xid = get_xid(); 454 xid = get_xid();
454 455
455 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 456 cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
456 inode, direntry->d_name.name, direntry); 457 inode, direntry->d_name.name, direntry);
457 458
458 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 459 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
459 if (IS_ERR(tlink)) 460 if (IS_ERR(tlink))
@@ -518,8 +519,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
518 __u32 oplock; 519 __u32 oplock;
519 int created = FILE_CREATED; 520 int created = FILE_CREATED;
520 521
521 cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p", 522 cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n",
522 inode, direntry->d_name.name, direntry); 523 inode, direntry->d_name.name, direntry);
523 524
524 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 525 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
525 rc = PTR_ERR(tlink); 526 rc = PTR_ERR(tlink);
@@ -613,7 +614,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
613 goto mknod_out; 614 goto mknod_out;
614 615
615 616
616 cFYI(1, "sfu compat create special file"); 617 cifs_dbg(FYI, "sfu compat create special file\n");
617 618
618 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 619 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
619 if (buf == NULL) { 620 if (buf == NULL) {
@@ -688,8 +689,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
688 689
689 xid = get_xid(); 690 xid = get_xid();
690 691
691 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 692 cifs_dbg(FYI, "parent inode = 0x%p name is: %s and dentry = 0x%p\n",
692 parent_dir_inode, direntry->d_name.name, direntry); 693 parent_dir_inode, direntry->d_name.name, direntry);
693 694
694 /* check whether path exists */ 695 /* check whether path exists */
695 696
@@ -715,11 +716,12 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
715 } 716 }
716 717
717 if (direntry->d_inode != NULL) { 718 if (direntry->d_inode != NULL) {
718 cFYI(1, "non-NULL inode in lookup"); 719 cifs_dbg(FYI, "non-NULL inode in lookup\n");
719 } else { 720 } else {
720 cFYI(1, "NULL inode in lookup"); 721 cifs_dbg(FYI, "NULL inode in lookup\n");
721 } 722 }
722 cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode); 723 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
724 full_path, direntry->d_inode);
723 725
724 if (pTcon->unix_ext) { 726 if (pTcon->unix_ext) {
725 rc = cifs_get_inode_info_unix(&newInode, full_path, 727 rc = cifs_get_inode_info_unix(&newInode, full_path,
@@ -742,7 +744,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
742 /* if it was once a directory (but how can we tell?) we could do 744 /* if it was once a directory (but how can we tell?) we could do
743 shrink_dcache_parent(direntry); */ 745 shrink_dcache_parent(direntry); */
744 } else if (rc != -EACCES) { 746 } else if (rc != -EACCES) {
745 cERROR(1, "Unexpected lookup error %d", rc); 747 cifs_dbg(VFS, "Unexpected lookup error %d\n", rc);
746 /* We special case check for Access Denied - since that 748 /* We special case check for Access Denied - since that
747 is a common return code */ 749 is a common return code */
748 } 750 }
@@ -807,7 +809,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
807{ 809{
808 int rc = 0; 810 int rc = 0;
809 811
810 cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name); 812 cifs_dbg(FYI, "In cifs d_delete, name = %s\n", direntry->d_name.name);
811 813
812 return rc; 814 return rc;
813} */ 815} */