aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-16 12:04:54 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-16 12:04:54 -0400
commit7c46d0ae29ba880963db283706950de7aa86c0a0 (patch)
tree1ba1ba22f2281dda27116443db50ebbcfc84cc09
parent1bdcc63112a0fe10030abee6ad71aaecd091e68e (diff)
UBIFS: get rid of dbg_dump_stack
In case of errors we almost always need the stack dump - it makes no sense to compile it out. Remove the 'dbg_dump_stack()' function completely. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r--fs/ubifs/debug.c2
-rw-r--r--fs/ubifs/debug.h5
-rw-r--r--fs/ubifs/io.c20
-rw-r--r--fs/ubifs/journal.c2
-rw-r--r--fs/ubifs/lprops.c2
-rw-r--r--fs/ubifs/lpt.c8
-rw-r--r--fs/ubifs/orphan.c2
-rw-r--r--fs/ubifs/tnc.c10
8 files changed, 24 insertions, 27 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 1934084e2088..139025ad2ec8 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -1160,7 +1160,7 @@ int dbg_check_synced_i_size(const struct ubifs_info *c, struct inode *inode)
1160 "is clean", ui->ui_size, ui->synced_i_size); 1160 "is clean", ui->ui_size, ui->synced_i_size);
1161 ubifs_err("i_ino %lu, i_mode %#x, i_size %lld", inode->i_ino, 1161 ubifs_err("i_ino %lu, i_mode %#x, i_size %lld", inode->i_ino,
1162 inode->i_mode, i_size_read(inode)); 1162 inode->i_mode, i_size_read(inode));
1163 dbg_dump_stack(); 1163 dump_stack();
1164 err = -EINVAL; 1164 err = -EINVAL;
1165 } 1165 }
1166 spin_unlock(&ui->ui_lock); 1166 spin_unlock(&ui->ui_lock);
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index 9f717655df18..6e5d345a0f7e 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -149,7 +149,7 @@ struct ubifs_global_debug_info {
149 if (unlikely(!(expr))) { \ 149 if (unlikely(!(expr))) { \
150 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \ 150 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
151 __func__, __LINE__, current->pid); \ 151 __func__, __LINE__, current->pid); \
152 dbg_dump_stack(); \ 152 dump_stack(); \
153 } \ 153 } \
154} while (0) 154} while (0)
155 155
@@ -161,8 +161,6 @@ struct ubifs_global_debug_info {
161 } \ 161 } \
162} while (0) 162} while (0)
163 163
164#define dbg_dump_stack() dump_stack()
165
166#define dbg_err(fmt, ...) do { \ 164#define dbg_err(fmt, ...) do { \
167 ubifs_err(fmt, ##__VA_ARGS__); \ 165 ubifs_err(fmt, ##__VA_ARGS__); \
168} while (0) 166} while (0)
@@ -341,7 +339,6 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c);
341 printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ 339 printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
342} while (0) 340} while (0)
343 341
344#define dbg_dump_stack()
345#define ubifs_assert_cmt_locked(c) 342#define ubifs_assert_cmt_locked(c)
346 343
347#define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) 344#define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
index 9228950a658f..16d4065da7d6 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -109,7 +109,7 @@ int ubifs_leb_read(const struct ubifs_info *c, int lnum, void *buf, int offs,
109 if (err && (err != -EBADMSG || even_ebadmsg)) { 109 if (err && (err != -EBADMSG || even_ebadmsg)) {
110 ubifs_err("reading %d bytes from LEB %d:%d failed, error %d", 110 ubifs_err("reading %d bytes from LEB %d:%d failed, error %d",
111 len, lnum, offs, err); 111 len, lnum, offs, err);
112 dbg_dump_stack(); 112 dump_stack();
113 } 113 }
114 return err; 114 return err;
115} 115}
@@ -130,7 +130,7 @@ int ubifs_leb_write(struct ubifs_info *c, int lnum, const void *buf, int offs,
130 ubifs_err("writing %d bytes to LEB %d:%d failed, error %d", 130 ubifs_err("writing %d bytes to LEB %d:%d failed, error %d",
131 len, lnum, offs, err); 131 len, lnum, offs, err);
132 ubifs_ro_mode(c, err); 132 ubifs_ro_mode(c, err);
133 dbg_dump_stack(); 133 dump_stack();
134 } 134 }
135 return err; 135 return err;
136} 136}
@@ -151,7 +151,7 @@ int ubifs_leb_change(struct ubifs_info *c, int lnum, const void *buf, int len,
151 ubifs_err("changing %d bytes in LEB %d failed, error %d", 151 ubifs_err("changing %d bytes in LEB %d failed, error %d",
152 len, lnum, err); 152 len, lnum, err);
153 ubifs_ro_mode(c, err); 153 ubifs_ro_mode(c, err);
154 dbg_dump_stack(); 154 dump_stack();
155 } 155 }
156 return err; 156 return err;
157} 157}
@@ -170,7 +170,7 @@ int ubifs_leb_unmap(struct ubifs_info *c, int lnum)
170 if (err) { 170 if (err) {
171 ubifs_err("unmap LEB %d failed, error %d", lnum, err); 171 ubifs_err("unmap LEB %d failed, error %d", lnum, err);
172 ubifs_ro_mode(c, err); 172 ubifs_ro_mode(c, err);
173 dbg_dump_stack(); 173 dump_stack();
174 } 174 }
175 return err; 175 return err;
176} 176}
@@ -189,7 +189,7 @@ int ubifs_leb_map(struct ubifs_info *c, int lnum, int dtype)
189 if (err) { 189 if (err) {
190 ubifs_err("mapping LEB %d failed, error %d", lnum, err); 190 ubifs_err("mapping LEB %d failed, error %d", lnum, err);
191 ubifs_ro_mode(c, err); 191 ubifs_ro_mode(c, err);
192 dbg_dump_stack(); 192 dump_stack();
193 } 193 }
194 return err; 194 return err;
195} 195}
@@ -202,7 +202,7 @@ int ubifs_is_mapped(const struct ubifs_info *c, int lnum)
202 if (err < 0) { 202 if (err < 0) {
203 ubifs_err("ubi_is_mapped failed for LEB %d, error %d", 203 ubifs_err("ubi_is_mapped failed for LEB %d, error %d",
204 lnum, err); 204 lnum, err);
205 dbg_dump_stack(); 205 dump_stack();
206 } 206 }
207 return err; 207 return err;
208} 208}
@@ -295,7 +295,7 @@ out:
295 if (!quiet) { 295 if (!quiet) {
296 ubifs_err("bad node at LEB %d:%d", lnum, offs); 296 ubifs_err("bad node at LEB %d:%d", lnum, offs);
297 dbg_dump_node(c, buf); 297 dbg_dump_node(c, buf);
298 dbg_dump_stack(); 298 dump_stack();
299 } 299 }
300 return err; 300 return err;
301} 301}
@@ -842,7 +842,7 @@ out:
842 ubifs_err("cannot write %d bytes to LEB %d:%d, error %d", 842 ubifs_err("cannot write %d bytes to LEB %d:%d, error %d",
843 len, wbuf->lnum, wbuf->offs, err); 843 len, wbuf->lnum, wbuf->offs, err);
844 dbg_dump_node(c, buf); 844 dbg_dump_node(c, buf);
845 dbg_dump_stack(); 845 dump_stack();
846 dbg_dump_leb(c, wbuf->lnum); 846 dbg_dump_leb(c, wbuf->lnum);
847 return err; 847 return err;
848} 848}
@@ -961,7 +961,7 @@ int ubifs_read_node_wbuf(struct ubifs_wbuf *wbuf, void *buf, int type, int len,
961out: 961out:
962 ubifs_err("bad node at LEB %d:%d", lnum, offs); 962 ubifs_err("bad node at LEB %d:%d", lnum, offs);
963 dbg_dump_node(c, buf); 963 dbg_dump_node(c, buf);
964 dbg_dump_stack(); 964 dump_stack();
965 return -EINVAL; 965 return -EINVAL;
966} 966}
967 967
@@ -1018,7 +1018,7 @@ out:
1018 ubifs_err("bad node at LEB %d:%d, LEB mapping status %d", lnum, offs, 1018 ubifs_err("bad node at LEB %d:%d, LEB mapping status %d", lnum, offs,
1019 ubi_is_mapped(c->ubi, lnum)); 1019 ubi_is_mapped(c->ubi, lnum));
1020 dbg_dump_node(c, buf); 1020 dbg_dump_node(c, buf);
1021 dbg_dump_stack(); 1021 dump_stack();
1022 return -EINVAL; 1022 return -EINVAL;
1023} 1023}
1024 1024
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c
index bc75e9dfab92..bad8b5fe47c7 100644
--- a/fs/ubifs/journal.c
+++ b/fs/ubifs/journal.c
@@ -385,7 +385,7 @@ out:
385 if (err == -ENOSPC) { 385 if (err == -ENOSPC) {
386 /* This are some budgeting problems, print useful information */ 386 /* This are some budgeting problems, print useful information */
387 down_write(&c->commit_sem); 387 down_write(&c->commit_sem);
388 dbg_dump_stack(); 388 dump_stack();
389 dbg_dump_budg(c, &c->bi); 389 dbg_dump_budg(c, &c->bi);
390 dbg_dump_lprops(c); 390 dbg_dump_lprops(c);
391 cmt_retries = dbg_check_lprops(c); 391 cmt_retries = dbg_check_lprops(c);
diff --git a/fs/ubifs/lprops.c b/fs/ubifs/lprops.c
index b5c95a69d95f..2e4bc27fb02a 100644
--- a/fs/ubifs/lprops.c
+++ b/fs/ubifs/lprops.c
@@ -1001,7 +1001,7 @@ void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
1001out: 1001out:
1002 if (err) { 1002 if (err) {
1003 dbg_msg("failed cat %d hpos %d err %d", cat, i, err); 1003 dbg_msg("failed cat %d hpos %d err %d", cat, i, err);
1004 dbg_dump_stack(); 1004 dump_stack();
1005 dbg_dump_heap(c, heap, cat); 1005 dbg_dump_heap(c, heap, cat);
1006 } 1006 }
1007} 1007}
diff --git a/fs/ubifs/lpt.c b/fs/ubifs/lpt.c
index 66d59d0a1402..4b62998697df 100644
--- a/fs/ubifs/lpt.c
+++ b/fs/ubifs/lpt.c
@@ -926,7 +926,7 @@ static int check_lpt_crc(void *buf, int len)
926 if (crc != calc_crc) { 926 if (crc != calc_crc) {
927 ubifs_err("invalid crc in LPT node: crc %hx calc %hx", crc, 927 ubifs_err("invalid crc in LPT node: crc %hx calc %hx", crc,
928 calc_crc); 928 calc_crc);
929 dbg_dump_stack(); 929 dump_stack();
930 return -EINVAL; 930 return -EINVAL;
931 } 931 }
932 return 0; 932 return 0;
@@ -949,7 +949,7 @@ static int check_lpt_type(uint8_t **addr, int *pos, int type)
949 if (node_type != type) { 949 if (node_type != type) {
950 ubifs_err("invalid type (%d) in LPT node type %d", node_type, 950 ubifs_err("invalid type (%d) in LPT node type %d", node_type,
951 type); 951 type);
952 dbg_dump_stack(); 952 dump_stack();
953 return -EINVAL; 953 return -EINVAL;
954 } 954 }
955 return 0; 955 return 0;
@@ -1247,7 +1247,7 @@ int ubifs_read_nnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
1247 1247
1248out: 1248out:
1249 ubifs_err("error %d reading nnode at %d:%d", err, lnum, offs); 1249 ubifs_err("error %d reading nnode at %d:%d", err, lnum, offs);
1250 dbg_dump_stack(); 1250 dump_stack();
1251 kfree(nnode); 1251 kfree(nnode);
1252 return err; 1252 return err;
1253} 1253}
@@ -1313,7 +1313,7 @@ static int read_pnode(struct ubifs_info *c, struct ubifs_nnode *parent, int iip)
1313out: 1313out:
1314 ubifs_err("error %d reading pnode at %d:%d", err, lnum, offs); 1314 ubifs_err("error %d reading pnode at %d:%d", err, lnum, offs);
1315 dbg_dump_pnode(c, pnode, parent, iip); 1315 dbg_dump_pnode(c, pnode, parent, iip);
1316 dbg_dump_stack(); 1316 dump_stack();
1317 dbg_msg("calc num: %d", calc_pnode_num_from_parent(c, parent, iip)); 1317 dbg_msg("calc num: %d", calc_pnode_num_from_parent(c, parent, iip));
1318 kfree(pnode); 1318 kfree(pnode);
1319 return err; 1319 return err;
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c
index c542c73cfa3c..be18de8f4efc 100644
--- a/fs/ubifs/orphan.c
+++ b/fs/ubifs/orphan.c
@@ -159,7 +159,7 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum)
159 } 159 }
160 spin_unlock(&c->orphan_lock); 160 spin_unlock(&c->orphan_lock);
161 dbg_err("missing orphan ino %lu", (unsigned long)inum); 161 dbg_err("missing orphan ino %lu", (unsigned long)inum);
162 dbg_dump_stack(); 162 dump_stack();
163} 163}
164 164
165/** 165/**
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c
index 16ad84d8402f..2e0bc4efb70e 100644
--- a/fs/ubifs/tnc.c
+++ b/fs/ubifs/tnc.c
@@ -339,7 +339,7 @@ static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr,
339 339
340 err = ubifs_validate_entry(c, dent); 340 err = ubifs_validate_entry(c, dent);
341 if (err) { 341 if (err) {
342 dbg_dump_stack(); 342 dump_stack();
343 dbg_dump_node(c, dent); 343 dbg_dump_node(c, dent);
344 return err; 344 return err;
345 } 345 }
@@ -372,7 +372,7 @@ static int lnc_add_directly(struct ubifs_info *c, struct ubifs_zbranch *zbr,
372 372
373 err = ubifs_validate_entry(c, node); 373 err = ubifs_validate_entry(c, node);
374 if (err) { 374 if (err) {
375 dbg_dump_stack(); 375 dump_stack();
376 dbg_dump_node(c, node); 376 dbg_dump_node(c, node);
377 return err; 377 return err;
378 } 378 }
@@ -1734,7 +1734,7 @@ out_err:
1734out: 1734out:
1735 ubifs_err("bad node at LEB %d:%d", zbr->lnum, zbr->offs); 1735 ubifs_err("bad node at LEB %d:%d", zbr->lnum, zbr->offs);
1736 dbg_dump_node(c, buf); 1736 dbg_dump_node(c, buf);
1737 dbg_dump_stack(); 1737 dump_stack();
1738 return err; 1738 return err;
1739} 1739}
1740 1740
@@ -1775,7 +1775,7 @@ int ubifs_tnc_bulk_read(struct ubifs_info *c, struct bu_info *bu)
1775 if (err && err != -EBADMSG) { 1775 if (err && err != -EBADMSG) {
1776 ubifs_err("failed to read from LEB %d:%d, error %d", 1776 ubifs_err("failed to read from LEB %d:%d, error %d",
1777 lnum, offs, err); 1777 lnum, offs, err);
1778 dbg_dump_stack(); 1778 dump_stack();
1779 dbg_tnck(&bu->key, "key "); 1779 dbg_tnck(&bu->key, "key ");
1780 return err; 1780 return err;
1781 } 1781 }
@@ -3336,7 +3336,7 @@ out_dump:
3336 ((loff_t)block) << UBIFS_BLOCK_SHIFT); 3336 ((loff_t)block) << UBIFS_BLOCK_SHIFT);
3337 mutex_unlock(&c->tnc_mutex); 3337 mutex_unlock(&c->tnc_mutex);
3338 dbg_dump_inode(c, inode); 3338 dbg_dump_inode(c, inode);
3339 dbg_dump_stack(); 3339 dump_stack();
3340 return -EINVAL; 3340 return -EINVAL;
3341 3341
3342out_unlock: 3342out_unlock: