diff options
author | Artem B. Bityutskiy <dedekind@infradead.org> | 2005-09-22 07:25:00 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 16:20:33 -0500 |
commit | 733802d974e5af42acb7cd61b16c0ce6dd03b7ed (patch) | |
tree | 56f77d78d9a2df474bb1686f5d060ee1e84a4d68 /fs/jffs2/readinode.c | |
parent | b523b3bac3a745fefd6f604082f2ffa09b808e5e (diff) |
[JFFS2] Debug code simplification, update TODO
Simplify the debugging code further.
Update the TODO list
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/readinode.c')
-rw-r--r-- | fs/jffs2/readinode.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 6f1e4a7ecd9f..08f8c5ec6118 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: readinode.c,v 1.141 2005/08/17 14:57:39 dedekind Exp $ | 10 | * $Id: readinode.c,v 1.142 2005/09/20 14:27:34 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -97,7 +97,7 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r | |||
97 | while (ref && ref->next_in_ino) { | 97 | while (ref && ref->next_in_ino) { |
98 | if (!ref_obsolete(ref)) | 98 | if (!ref_obsolete(ref)) |
99 | return ref; | 99 | return ref; |
100 | JFFS2_DBG_NODEREF("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref)); | 100 | dbg_noderef("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref)); |
101 | ref = ref->next_in_ino; | 101 | ref = ref->next_in_ino; |
102 | } | 102 | } |
103 | return NULL; | 103 | return NULL; |
@@ -274,7 +274,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref | |||
274 | len = min_t(uint32_t, rdlen - sizeof(*rd), csize); | 274 | len = min_t(uint32_t, rdlen - sizeof(*rd), csize); |
275 | tn->partial_crc = crc32(0, buf, len); | 275 | tn->partial_crc = crc32(0, buf, len); |
276 | 276 | ||
277 | JFFS2_DBG_READINODE("Calculates CRC (%#08x) for %d bytes, csize %d\n", tn->partial_crc, len, csize); | 277 | dbg_readinode("Calculates CRC (%#08x) for %d bytes, csize %d\n", tn->partial_crc, len, csize); |
278 | 278 | ||
279 | /* If we actually calculated the whole data CRC | 279 | /* If we actually calculated the whole data CRC |
280 | * and it is wrong, drop the node. */ | 280 | * and it is wrong, drop the node. */ |
@@ -293,7 +293,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref | |||
293 | */ | 293 | */ |
294 | struct jffs2_eraseblock *jeb; | 294 | struct jffs2_eraseblock *jeb; |
295 | 295 | ||
296 | JFFS2_DBG_READINODE("the node has no data.\n"); | 296 | dbg_readinode("the node has no data.\n"); |
297 | jeb = &c->blocks[ref->flash_offset / c->sector_size]; | 297 | jeb = &c->blocks[ref->flash_offset / c->sector_size]; |
298 | len = ref_totlen(c, jeb, ref); | 298 | len = ref_totlen(c, jeb, ref); |
299 | 299 | ||
@@ -327,7 +327,7 @@ static inline int read_dnode(struct jffs2_sb_info *c, struct jffs2_raw_node_ref | |||
327 | else // normal case... | 327 | else // normal case... |
328 | tn->fn->size = je32_to_cpu(rd->dsize); | 328 | tn->fn->size = je32_to_cpu(rd->dsize); |
329 | 329 | ||
330 | JFFS2_DBG_READINODE("dnode @%08x: ver %u, offset %#04x, dsize %#04x, csize %#04x\n", | 330 | dbg_readinode("dnode @%08x: ver %u, offset %#04x, dsize %#04x, csize %#04x\n", |
331 | ref_offset(ref), je32_to_cpu(rd->version), je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize), csize); | 331 | ref_offset(ref), je32_to_cpu(rd->version), je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize), csize); |
332 | 332 | ||
333 | jffs2_add_tn_to_tree(tn, tnp); | 333 | jffs2_add_tn_to_tree(tn, tnp); |
@@ -424,7 +424,7 @@ static int read_more(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref, | |||
424 | len = right_size - *rdlen; | 424 | len = right_size - *rdlen; |
425 | } | 425 | } |
426 | 426 | ||
427 | JFFS2_DBG_READINODE("read more %d bytes\n", len); | 427 | dbg_readinode("read more %d bytes\n", len); |
428 | 428 | ||
429 | err = jffs2_flash_read(c, offs, len, &retlen, bufstart); | 429 | err = jffs2_flash_read(c, offs, len, &retlen, bufstart); |
430 | if (err) { | 430 | if (err) { |
@@ -461,7 +461,7 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
461 | 461 | ||
462 | *mctime_ver = 0; | 462 | *mctime_ver = 0; |
463 | 463 | ||
464 | JFFS2_DBG_READINODE("ino #%u\n", f->inocache->ino); | 464 | dbg_readinode("ino #%u\n", f->inocache->ino); |
465 | 465 | ||
466 | if (jffs2_is_writebuffered(c)) { | 466 | if (jffs2_is_writebuffered(c)) { |
467 | /* | 467 | /* |
@@ -531,7 +531,7 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
531 | len = JFFS2_MIN_NODE_HEADER; | 531 | len = JFFS2_MIN_NODE_HEADER; |
532 | } | 532 | } |
533 | 533 | ||
534 | JFFS2_DBG_READINODE("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref)); | 534 | dbg_readinode("read %d bytes at %#08x(%d).\n", len, ref_offset(ref), ref_flags(ref)); |
535 | 535 | ||
536 | /* FIXME: point() */ | 536 | /* FIXME: point() */ |
537 | err = jffs2_flash_read(c, ref_offset(ref), len, | 537 | err = jffs2_flash_read(c, ref_offset(ref), len, |
@@ -614,7 +614,7 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
614 | *fdp = ret_fd; | 614 | *fdp = ret_fd; |
615 | kfree(buf); | 615 | kfree(buf); |
616 | 616 | ||
617 | JFFS2_DBG_READINODE("nodes of inode #%u were read, the highest version is %u, latest_mctime %u, mctime_ver %u.\n", | 617 | dbg_readinode("nodes of inode #%u were read, the highest version is %u, latest_mctime %u, mctime_ver %u.\n", |
618 | f->inocache->ino, *highest_version, *latest_mctime, *mctime_ver); | 618 | f->inocache->ino, *highest_version, *latest_mctime, *mctime_ver); |
619 | return 0; | 619 | return 0; |
620 | 620 | ||
@@ -639,7 +639,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
639 | size_t retlen; | 639 | size_t retlen; |
640 | int ret; | 640 | int ret; |
641 | 641 | ||
642 | JFFS2_DBG_READINODE("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink); | 642 | dbg_readinode("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink); |
643 | 643 | ||
644 | /* Grab all nodes relevant to this ino */ | 644 | /* Grab all nodes relevant to this ino */ |
645 | ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver); | 645 | ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver); |
@@ -659,7 +659,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
659 | tn = rb_entry(rb, struct jffs2_tmp_dnode_info, rb); | 659 | tn = rb_entry(rb, struct jffs2_tmp_dnode_info, rb); |
660 | fn = tn->fn; | 660 | fn = tn->fn; |
661 | ret = 1; | 661 | ret = 1; |
662 | JFFS2_DBG_READINODE("consider node ver %u, phys offset " | 662 | dbg_readinode("consider node ver %u, phys offset " |
663 | "%#08x(%d), range %u-%u.\n", tn->version, | 663 | "%#08x(%d), range %u-%u.\n", tn->version, |
664 | ref_offset(fn->raw), ref_flags(fn->raw), | 664 | ref_offset(fn->raw), ref_flags(fn->raw), |
665 | fn->ofs, fn->ofs + fn->size); | 665 | fn->ofs, fn->ofs + fn->size); |
@@ -703,7 +703,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
703 | 703 | ||
704 | jffs2_free_tmp_dnode_info(tn); | 704 | jffs2_free_tmp_dnode_info(tn); |
705 | if (ret) { | 705 | if (ret) { |
706 | JFFS2_DBG_READINODE("delete dnode %u-%u.\n", | 706 | dbg_readinode("delete dnode %u-%u.\n", |
707 | fn->ofs, fn->ofs + fn->size); | 707 | fn->ofs, fn->ofs + fn->size); |
708 | jffs2_free_full_dnode(fn); | 708 | jffs2_free_full_dnode(fn); |
709 | } | 709 | } |
@@ -803,7 +803,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
803 | } | 803 | } |
804 | 804 | ||
805 | f->target[je32_to_cpu(latest_node->csize)] = '\0'; | 805 | f->target[je32_to_cpu(latest_node->csize)] = '\0'; |
806 | JFFS2_DBG_READINODE("symlink's target '%s' cached\n", f->target); | 806 | dbg_readinode("symlink's target '%s' cached\n", f->target); |
807 | } | 807 | } |
808 | 808 | ||
809 | /* fall through... */ | 809 | /* fall through... */ |
@@ -851,7 +851,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
851 | int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | 851 | int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, |
852 | uint32_t ino, struct jffs2_raw_inode *latest_node) | 852 | uint32_t ino, struct jffs2_raw_inode *latest_node) |
853 | { | 853 | { |
854 | JFFS2_DBG_READINODE("read inode #%u\n", ino); | 854 | dbg_readinode("read inode #%u\n", ino); |
855 | 855 | ||
856 | retry_inocache: | 856 | retry_inocache: |
857 | spin_lock(&c->inocache_lock); | 857 | spin_lock(&c->inocache_lock); |
@@ -870,7 +870,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
870 | /* If it's in either of these states, we need | 870 | /* If it's in either of these states, we need |
871 | to wait for whoever's got it to finish and | 871 | to wait for whoever's got it to finish and |
872 | put it back. */ | 872 | put it back. */ |
873 | JFFS2_DBG_READINODE("waiting for ino #%u in state %d\n", ino, f->inocache->state); | 873 | dbg_readinode("waiting for ino #%u in state %d\n", ino, f->inocache->state); |
874 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); | 874 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); |
875 | goto retry_inocache; | 875 | goto retry_inocache; |
876 | 876 | ||
@@ -897,7 +897,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
897 | JFFS2_ERROR("cannot allocate inocache for root inode\n"); | 897 | JFFS2_ERROR("cannot allocate inocache for root inode\n"); |
898 | return -ENOMEM; | 898 | return -ENOMEM; |
899 | } | 899 | } |
900 | JFFS2_DBG_READINODE("creating inocache for root inode\n"); | 900 | dbg_readinode("creating inocache for root inode\n"); |
901 | memset(f->inocache, 0, sizeof(struct jffs2_inode_cache)); | 901 | memset(f->inocache, 0, sizeof(struct jffs2_inode_cache)); |
902 | f->inocache->ino = f->inocache->nlink = 1; | 902 | f->inocache->ino = f->inocache->nlink = 1; |
903 | f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; | 903 | f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; |