diff options
author | Joe Perches <joe@perches.com> | 2013-06-04 19:39:15 -0400 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2013-06-05 15:47:19 -0400 |
commit | eb8630d7d2fd13589e6a7a3ae2fe1f75f867fbed (patch) | |
tree | 16a5040af9b8df061385de9e0ab8e13e51790ddf /fs/jfs/jfs_dtree.c | |
parent | 21d1101f013c12d1dd78cfdf263d619c80975b47 (diff) |
jfs: Update jfs_error
Use a more current logging style.
Add __printf format and argument verification.
Remove embedded function names from formats.
Add %pf, __builtin_return_address(0) to jfs_error.
Add newlines to formats for kernel style consistency.
(One format already had an erroneous newline)
Coalesce formats and align arguments.
Object size reduced ~1KiB.
$ size fs/jfs/built-in.o*
text data bss dec hex filename
201891 35488 63936 301315 49903 fs/jfs/built-in.o.new
202821 35488 64192 302501 49da5 fs/jfs/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Diffstat (limited to 'fs/jfs/jfs_dtree.c')
-rw-r--r-- | fs/jfs/jfs_dtree.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 0ddbeceafc62..c89424e71a0a 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c | |||
@@ -124,21 +124,21 @@ struct dtsplit { | |||
124 | #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot) | 124 | #define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot) |
125 | 125 | ||
126 | /* get page buffer for specified block address */ | 126 | /* get page buffer for specified block address */ |
127 | #define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)\ | 127 | #define DT_GETPAGE(IP, BN, MP, SIZE, P, RC) \ |
128 | {\ | 128 | do { \ |
129 | BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot)\ | 129 | BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot); \ |
130 | if (!(RC))\ | 130 | if (!(RC)) { \ |
131 | {\ | 131 | if (((P)->header.nextindex > \ |
132 | if (((P)->header.nextindex > (((BN)==0)?DTROOTMAXSLOT:(P)->header.maxslot)) ||\ | 132 | (((BN) == 0) ? DTROOTMAXSLOT : (P)->header.maxslot)) || \ |
133 | ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT)))\ | 133 | ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT))) { \ |
134 | {\ | 134 | BT_PUTPAGE(MP); \ |
135 | BT_PUTPAGE(MP);\ | 135 | jfs_error((IP)->i_sb, \ |
136 | jfs_error((IP)->i_sb, "DT_GETPAGE: dtree page corrupt");\ | 136 | "DT_GETPAGE: dtree page corrupt\n"); \ |
137 | MP = NULL;\ | 137 | MP = NULL; \ |
138 | RC = -EIO;\ | 138 | RC = -EIO; \ |
139 | }\ | 139 | } \ |
140 | }\ | 140 | } \ |
141 | } | 141 | } while (0) |
142 | 142 | ||
143 | /* for consistency */ | 143 | /* for consistency */ |
144 | #define DT_PUTPAGE(MP) BT_PUTPAGE(MP) | 144 | #define DT_PUTPAGE(MP) BT_PUTPAGE(MP) |
@@ -776,7 +776,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data, | |||
776 | /* Something's corrupted, mark filesystem dirty so | 776 | /* Something's corrupted, mark filesystem dirty so |
777 | * chkdsk will fix it. | 777 | * chkdsk will fix it. |
778 | */ | 778 | */ |
779 | jfs_error(sb, "stack overrun in dtSearch!"); | 779 | jfs_error(sb, "stack overrun!\n"); |
780 | BT_STACK_DUMP(btstack); | 780 | BT_STACK_DUMP(btstack); |
781 | rc = -EIO; | 781 | rc = -EIO; |
782 | goto out; | 782 | goto out; |
@@ -3252,8 +3252,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
3252 | /* Sanity Check */ | 3252 | /* Sanity Check */ |
3253 | if (d_namleft == 0) { | 3253 | if (d_namleft == 0) { |
3254 | jfs_error(ip->i_sb, | 3254 | jfs_error(ip->i_sb, |
3255 | "JFS:Dtree error: ino = " | 3255 | "JFS:Dtree error: ino = %ld, bn=%lld, index = %d\n", |
3256 | "%ld, bn=%Ld, index = %d", | ||
3257 | (long)ip->i_ino, | 3256 | (long)ip->i_ino, |
3258 | (long long)bn, | 3257 | (long long)bn, |
3259 | i); | 3258 | i); |
@@ -3373,7 +3372,7 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack) | |||
3373 | */ | 3372 | */ |
3374 | if (BT_STACK_FULL(btstack)) { | 3373 | if (BT_STACK_FULL(btstack)) { |
3375 | DT_PUTPAGE(mp); | 3374 | DT_PUTPAGE(mp); |
3376 | jfs_error(ip->i_sb, "dtReadFirst: btstack overrun"); | 3375 | jfs_error(ip->i_sb, "btstack overrun\n"); |
3377 | BT_STACK_DUMP(btstack); | 3376 | BT_STACK_DUMP(btstack); |
3378 | return -EIO; | 3377 | return -EIO; |
3379 | } | 3378 | } |