diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-15 08:03:51 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-15 10:05:06 -0400 |
commit | 77a7ae580c6cc8a0f0d5d7a7d61eb7e9fe8d99dc (patch) | |
tree | 299adfb136ca146d9bbfd7e171351ab971c1b93d /fs/ubifs/debug.c | |
parent | d6d140097beb554daa967d3fb576e94ad2f82dcd (diff) |
UBIFS: improve journal head debugging prints
Convert the journal head integer into the head name when printing
debugging information.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r-- | fs/ubifs/debug.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 8183ee0d4f9d..96900049bcd6 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -210,6 +210,20 @@ const char *dbg_cstate(int cmt_state) | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | const char *dbg_jhead(int jhead) | ||
214 | { | ||
215 | switch (jhead) { | ||
216 | case GCHD: | ||
217 | return "0 (GC)"; | ||
218 | case BASEHD: | ||
219 | return "1 (base)"; | ||
220 | case DATAHD: | ||
221 | return "2 (data)"; | ||
222 | default: | ||
223 | return "unknown journal head"; | ||
224 | } | ||
225 | } | ||
226 | |||
213 | static void dump_ch(const struct ubifs_ch *ch) | 227 | static void dump_ch(const struct ubifs_ch *ch) |
214 | { | 228 | { |
215 | printk(KERN_DEBUG "\tmagic %#x\n", le32_to_cpu(ch->magic)); | 229 | printk(KERN_DEBUG "\tmagic %#x\n", le32_to_cpu(ch->magic)); |
@@ -623,8 +637,9 @@ void dbg_dump_budg(struct ubifs_info *c) | |||
623 | /* If we are in R/O mode, journal heads do not exist */ | 637 | /* If we are in R/O mode, journal heads do not exist */ |
624 | if (c->jheads) | 638 | if (c->jheads) |
625 | for (i = 0; i < c->jhead_cnt; i++) | 639 | for (i = 0; i < c->jhead_cnt; i++) |
626 | printk(KERN_DEBUG "\tjhead %d\t LEB %d\n", | 640 | printk(KERN_DEBUG "\tjhead %s\t LEB %d\n", |
627 | c->jheads[i].wbuf.jhead, c->jheads[i].wbuf.lnum); | 641 | dbg_jhead(c->jheads[i].wbuf.jhead), |
642 | c->jheads[i].wbuf.lnum); | ||
628 | for (rb = rb_first(&c->buds); rb; rb = rb_next(rb)) { | 643 | for (rb = rb_first(&c->buds); rb; rb = rb_next(rb)) { |
629 | bud = rb_entry(rb, struct ubifs_bud, rb); | 644 | bud = rb_entry(rb, struct ubifs_bud, rb); |
630 | printk(KERN_DEBUG "\tbud LEB %d\n", bud->lnum); | 645 | printk(KERN_DEBUG "\tbud LEB %d\n", bud->lnum); |