diff options
author | Joe Perches <joe@perches.com> | 2010-04-20 23:50:45 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-04-20 23:50:45 -0400 |
commit | b6b38f704a8193daba520493ebdaf7e819962fc8 (patch) | |
tree | c38f4557b51b33573e36817888afa2accf3da9ca /fs/cifs/dir.c | |
parent | 315e995c63a15cb4d4efdbfd70fe2db191917f7a (diff) |
[CIFS] Neaten cERROR and cFYI macros, reduce text space
Neaten cERROR and cFYI macros, reduce text space
~2.5K
Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
Surround macros with do {} while
Add parentheses to macros
Make statement expression macro from macro with assign
Remove now unnecessary parentheses from cFYI and cERROR uses
defconfig with CIFS support old
$ size fs/cifs/built-in.o
text data bss dec hex filename
156012 1760 148 157920 268e0 fs/cifs/built-in.o
defconfig with CIFS support old
$ size fs/cifs/built-in.o
text data bss dec hex filename
153508 1760 148 155416 25f18 fs/cifs/built-in.o
allyesconfig old:
$ size fs/cifs/built-in.o
text data bss dec hex filename
309138 3864 74824 387826 5eaf2 fs/cifs/built-in.o
allyesconfig new
$ size fs/cifs/built-in.o
text data bss dec hex filename
305655 3864 74824 384343 5dd57 fs/cifs/built-in.o
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index e9f7ecc2714b..4aa2fe3f535f 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -73,7 +73,7 @@ cifs_bp_rename_retry: | |||
73 | namelen += (1 + temp->d_name.len); | 73 | namelen += (1 + temp->d_name.len); |
74 | temp = temp->d_parent; | 74 | temp = temp->d_parent; |
75 | if (temp == NULL) { | 75 | if (temp == NULL) { |
76 | cERROR(1, ("corrupt dentry")); | 76 | cERROR(1, "corrupt dentry"); |
77 | return NULL; | 77 | return NULL; |
78 | } | 78 | } |
79 | } | 79 | } |
@@ -90,19 +90,18 @@ cifs_bp_rename_retry: | |||
90 | full_path[namelen] = dirsep; | 90 | full_path[namelen] = dirsep; |
91 | strncpy(full_path + namelen + 1, temp->d_name.name, | 91 | strncpy(full_path + namelen + 1, temp->d_name.name, |
92 | temp->d_name.len); | 92 | temp->d_name.len); |
93 | cFYI(0, ("name: %s", full_path + namelen)); | 93 | cFYI(0, "name: %s", full_path + namelen); |
94 | } | 94 | } |
95 | temp = temp->d_parent; | 95 | temp = temp->d_parent; |
96 | if (temp == NULL) { | 96 | if (temp == NULL) { |
97 | cERROR(1, ("corrupt dentry")); | 97 | cERROR(1, "corrupt dentry"); |
98 | kfree(full_path); | 98 | kfree(full_path); |
99 | return NULL; | 99 | return NULL; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | if (namelen != pplen + dfsplen) { | 102 | if (namelen != pplen + dfsplen) { |
103 | cERROR(1, | 103 | cERROR(1, "did not end path lookup where expected namelen is %d", |
104 | ("did not end path lookup where expected namelen is %d", | 104 | namelen); |
105 | namelen)); | ||
106 | /* presumably this is only possible if racing with a rename | 105 | /* presumably this is only possible if racing with a rename |
107 | of one of the parent directories (we can not lock the dentries | 106 | of one of the parent directories (we can not lock the dentries |
108 | above us to prevent this, but retrying should be harmless) */ | 107 | above us to prevent this, but retrying should be harmless) */ |
@@ -173,7 +172,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | |||
173 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 172 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
174 | pCifsInode->clientCanCacheAll = true; | 173 | pCifsInode->clientCanCacheAll = true; |
175 | pCifsInode->clientCanCacheRead = true; | 174 | pCifsInode->clientCanCacheRead = true; |
176 | cFYI(1, ("Exclusive Oplock inode %p", newinode)); | 175 | cFYI(1, "Exclusive Oplock inode %p", newinode); |
177 | } else if ((oplock & 0xF) == OPLOCK_READ) | 176 | } else if ((oplock & 0xF) == OPLOCK_READ) |
178 | pCifsInode->clientCanCacheRead = true; | 177 | pCifsInode->clientCanCacheRead = true; |
179 | } | 178 | } |
@@ -192,7 +191,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode, | |||
192 | struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb); | 191 | struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb); |
193 | struct cifs_fattr fattr; | 192 | struct cifs_fattr fattr; |
194 | 193 | ||
195 | cFYI(1, ("posix open %s", full_path)); | 194 | cFYI(1, "posix open %s", full_path); |
196 | 195 | ||
197 | presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); | 196 | presp_data = kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); |
198 | if (presp_data == NULL) | 197 | if (presp_data == NULL) |
@@ -358,7 +357,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
358 | else if ((oflags & O_CREAT) == O_CREAT) | 357 | else if ((oflags & O_CREAT) == O_CREAT) |
359 | disposition = FILE_OPEN_IF; | 358 | disposition = FILE_OPEN_IF; |
360 | else | 359 | else |
361 | cFYI(1, ("Create flag not set in create function")); | 360 | cFYI(1, "Create flag not set in create function"); |
362 | } | 361 | } |
363 | 362 | ||
364 | /* BB add processing to set equivalent of mode - e.g. via CreateX with | 363 | /* BB add processing to set equivalent of mode - e.g. via CreateX with |
@@ -394,7 +393,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
394 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 393 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
395 | } | 394 | } |
396 | if (rc) { | 395 | if (rc) { |
397 | cFYI(1, ("cifs_create returned 0x%x", rc)); | 396 | cFYI(1, "cifs_create returned 0x%x", rc); |
398 | goto cifs_create_out; | 397 | goto cifs_create_out; |
399 | } | 398 | } |
400 | 399 | ||
@@ -457,7 +456,7 @@ cifs_create_set_dentry: | |||
457 | if (rc == 0) | 456 | if (rc == 0) |
458 | setup_cifs_dentry(tcon, direntry, newinode); | 457 | setup_cifs_dentry(tcon, direntry, newinode); |
459 | else | 458 | else |
460 | cFYI(1, ("Create worked, get_inode_info failed rc = %d", rc)); | 459 | cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); |
461 | 460 | ||
462 | /* nfsd case - nfs srv does not set nd */ | 461 | /* nfsd case - nfs srv does not set nd */ |
463 | if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { | 462 | if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { |
@@ -531,7 +530,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
531 | u16 fileHandle; | 530 | u16 fileHandle; |
532 | FILE_ALL_INFO *buf; | 531 | FILE_ALL_INFO *buf; |
533 | 532 | ||
534 | cFYI(1, ("sfu compat create special file")); | 533 | cFYI(1, "sfu compat create special file"); |
535 | 534 | ||
536 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); | 535 | buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); |
537 | if (buf == NULL) { | 536 | if (buf == NULL) { |
@@ -616,8 +615,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
616 | 615 | ||
617 | xid = GetXid(); | 616 | xid = GetXid(); |
618 | 617 | ||
619 | cFYI(1, ("parent inode = 0x%p name is: %s and dentry = 0x%p", | 618 | cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", |
620 | parent_dir_inode, direntry->d_name.name, direntry)); | 619 | parent_dir_inode, direntry->d_name.name, direntry); |
621 | 620 | ||
622 | /* check whether path exists */ | 621 | /* check whether path exists */ |
623 | 622 | ||
@@ -632,7 +631,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
632 | int i; | 631 | int i; |
633 | for (i = 0; i < direntry->d_name.len; i++) | 632 | for (i = 0; i < direntry->d_name.len; i++) |
634 | if (direntry->d_name.name[i] == '\\') { | 633 | if (direntry->d_name.name[i] == '\\') { |
635 | cFYI(1, ("Invalid file name")); | 634 | cFYI(1, "Invalid file name"); |
636 | FreeXid(xid); | 635 | FreeXid(xid); |
637 | return ERR_PTR(-EINVAL); | 636 | return ERR_PTR(-EINVAL); |
638 | } | 637 | } |
@@ -657,11 +656,11 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
657 | } | 656 | } |
658 | 657 | ||
659 | if (direntry->d_inode != NULL) { | 658 | if (direntry->d_inode != NULL) { |
660 | cFYI(1, ("non-NULL inode in lookup")); | 659 | cFYI(1, "non-NULL inode in lookup"); |
661 | } else { | 660 | } else { |
662 | cFYI(1, ("NULL inode in lookup")); | 661 | cFYI(1, "NULL inode in lookup"); |
663 | } | 662 | } |
664 | cFYI(1, ("Full path: %s inode = 0x%p", full_path, direntry->d_inode)); | 663 | cFYI(1, "Full path: %s inode = 0x%p", full_path, direntry->d_inode); |
665 | 664 | ||
666 | /* Posix open is only called (at lookup time) for file create now. | 665 | /* Posix open is only called (at lookup time) for file create now. |
667 | * For opens (rather than creates), because we do not know if it | 666 | * For opens (rather than creates), because we do not know if it |
@@ -723,7 +722,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
723 | /* if it was once a directory (but how can we tell?) we could do | 722 | /* if it was once a directory (but how can we tell?) we could do |
724 | shrink_dcache_parent(direntry); */ | 723 | shrink_dcache_parent(direntry); */ |
725 | } else if (rc != -EACCES) { | 724 | } else if (rc != -EACCES) { |
726 | cERROR(1, ("Unexpected lookup error %d", rc)); | 725 | cERROR(1, "Unexpected lookup error %d", rc); |
727 | /* We special case check for Access Denied - since that | 726 | /* We special case check for Access Denied - since that |
728 | is a common return code */ | 727 | is a common return code */ |
729 | } | 728 | } |
@@ -742,8 +741,8 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | |||
742 | if (cifs_revalidate_dentry(direntry)) | 741 | if (cifs_revalidate_dentry(direntry)) |
743 | return 0; | 742 | return 0; |
744 | } else { | 743 | } else { |
745 | cFYI(1, ("neg dentry 0x%p name = %s", | 744 | cFYI(1, "neg dentry 0x%p name = %s", |
746 | direntry, direntry->d_name.name)); | 745 | direntry, direntry->d_name.name); |
747 | if (time_after(jiffies, direntry->d_time + HZ) || | 746 | if (time_after(jiffies, direntry->d_time + HZ) || |
748 | !lookupCacheEnabled) { | 747 | !lookupCacheEnabled) { |
749 | d_drop(direntry); | 748 | d_drop(direntry); |
@@ -758,7 +757,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | |||
758 | { | 757 | { |
759 | int rc = 0; | 758 | int rc = 0; |
760 | 759 | ||
761 | cFYI(1, ("In cifs d_delete, name = %s", direntry->d_name.name)); | 760 | cFYI(1, "In cifs d_delete, name = %s", direntry->d_name.name); |
762 | 761 | ||
763 | return rc; | 762 | return rc; |
764 | } */ | 763 | } */ |