aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-06-25 17:59:06 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:25:04 -0400
commit94c9eca223048ae15df1989fae50eefda9daae7e (patch)
treefe366a89ab391ab36d4b5ee0ac0ceb9485afa3d3
parentf15313bf42337ade55376303932d8b6a62e6be43 (diff)
[PATCH] fs/jffs/: cleanups
This patch contains the following cleanups: - make needlessly global functions static - provide some debugging helper functions only for appropriate values of CONFIG_JFFS_FS_VERBOSE Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/jffs/intrep.c114
-rw-r--r--fs/jffs/intrep.h2
-rw-r--r--fs/jffs/jffs_fm.c105
-rw-r--r--fs/jffs/jffs_fm.h3
4 files changed, 112 insertions, 112 deletions
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c
index 8cc6893fc56c..fc589ddd0762 100644
--- a/fs/jffs/intrep.c
+++ b/fs/jffs/intrep.c
@@ -175,8 +175,64 @@ jffs_hexdump(struct mtd_info *mtd, loff_t pos, int size)
175 } 175 }
176} 176}
177 177
178/* Print the contents of a node. */
179static void
180jffs_print_node(struct jffs_node *n)
181{
182 D(printk("jffs_node: 0x%p\n", n));
183 D(printk("{\n"));
184 D(printk(" 0x%08x, /* version */\n", n->version));
185 D(printk(" 0x%08x, /* data_offset */\n", n->data_offset));
186 D(printk(" 0x%08x, /* data_size */\n", n->data_size));
187 D(printk(" 0x%08x, /* removed_size */\n", n->removed_size));
188 D(printk(" 0x%08x, /* fm_offset */\n", n->fm_offset));
189 D(printk(" 0x%02x, /* name_size */\n", n->name_size));
190 D(printk(" 0x%p, /* fm, fm->offset: %u */\n",
191 n->fm, (n->fm ? n->fm->offset : 0)));
192 D(printk(" 0x%p, /* version_prev */\n", n->version_prev));
193 D(printk(" 0x%p, /* version_next */\n", n->version_next));
194 D(printk(" 0x%p, /* range_prev */\n", n->range_prev));
195 D(printk(" 0x%p, /* range_next */\n", n->range_next));
196 D(printk("}\n"));
197}
198
178#endif 199#endif
179 200
201/* Print the contents of a raw inode. */
202static void
203jffs_print_raw_inode(struct jffs_raw_inode *raw_inode)
204{
205 D(printk("jffs_raw_inode: inode number: %u\n", raw_inode->ino));
206 D(printk("{\n"));
207 D(printk(" 0x%08x, /* magic */\n", raw_inode->magic));
208 D(printk(" 0x%08x, /* ino */\n", raw_inode->ino));
209 D(printk(" 0x%08x, /* pino */\n", raw_inode->pino));
210 D(printk(" 0x%08x, /* version */\n", raw_inode->version));
211 D(printk(" 0x%08x, /* mode */\n", raw_inode->mode));
212 D(printk(" 0x%04x, /* uid */\n", raw_inode->uid));
213 D(printk(" 0x%04x, /* gid */\n", raw_inode->gid));
214 D(printk(" 0x%08x, /* atime */\n", raw_inode->atime));
215 D(printk(" 0x%08x, /* mtime */\n", raw_inode->mtime));
216 D(printk(" 0x%08x, /* ctime */\n", raw_inode->ctime));
217 D(printk(" 0x%08x, /* offset */\n", raw_inode->offset));
218 D(printk(" 0x%08x, /* dsize */\n", raw_inode->dsize));
219 D(printk(" 0x%08x, /* rsize */\n", raw_inode->rsize));
220 D(printk(" 0x%02x, /* nsize */\n", raw_inode->nsize));
221 D(printk(" 0x%02x, /* nlink */\n", raw_inode->nlink));
222 D(printk(" 0x%02x, /* spare */\n",
223 raw_inode->spare));
224 D(printk(" %u, /* rename */\n",
225 raw_inode->rename));
226 D(printk(" %u, /* deleted */\n",
227 raw_inode->deleted));
228 D(printk(" 0x%02x, /* accurate */\n",
229 raw_inode->accurate));
230 D(printk(" 0x%08x, /* dchksum */\n", raw_inode->dchksum));
231 D(printk(" 0x%04x, /* nchksum */\n", raw_inode->nchksum));
232 D(printk(" 0x%04x, /* chksum */\n", raw_inode->chksum));
233 D(printk("}\n"));
234}
235
180#define flash_safe_acquire(arg) 236#define flash_safe_acquire(arg)
181#define flash_safe_release(arg) 237#define flash_safe_release(arg)
182 238
@@ -2507,64 +2563,6 @@ jffs_update_file(struct jffs_file *f, struct jffs_node *node)
2507 return 0; 2563 return 0;
2508} 2564}
2509 2565
2510/* Print the contents of a node. */
2511void
2512jffs_print_node(struct jffs_node *n)
2513{
2514 D(printk("jffs_node: 0x%p\n", n));
2515 D(printk("{\n"));
2516 D(printk(" 0x%08x, /* version */\n", n->version));
2517 D(printk(" 0x%08x, /* data_offset */\n", n->data_offset));
2518 D(printk(" 0x%08x, /* data_size */\n", n->data_size));
2519 D(printk(" 0x%08x, /* removed_size */\n", n->removed_size));
2520 D(printk(" 0x%08x, /* fm_offset */\n", n->fm_offset));
2521 D(printk(" 0x%02x, /* name_size */\n", n->name_size));
2522 D(printk(" 0x%p, /* fm, fm->offset: %u */\n",
2523 n->fm, (n->fm ? n->fm->offset : 0)));
2524 D(printk(" 0x%p, /* version_prev */\n", n->version_prev));
2525 D(printk(" 0x%p, /* version_next */\n", n->version_next));
2526 D(printk(" 0x%p, /* range_prev */\n", n->range_prev));
2527 D(printk(" 0x%p, /* range_next */\n", n->range_next));
2528 D(printk("}\n"));
2529}
2530
2531
2532/* Print the contents of a raw inode. */
2533void
2534jffs_print_raw_inode(struct jffs_raw_inode *raw_inode)
2535{
2536 D(printk("jffs_raw_inode: inode number: %u\n", raw_inode->ino));
2537 D(printk("{\n"));
2538 D(printk(" 0x%08x, /* magic */\n", raw_inode->magic));
2539 D(printk(" 0x%08x, /* ino */\n", raw_inode->ino));
2540 D(printk(" 0x%08x, /* pino */\n", raw_inode->pino));
2541 D(printk(" 0x%08x, /* version */\n", raw_inode->version));
2542 D(printk(" 0x%08x, /* mode */\n", raw_inode->mode));
2543 D(printk(" 0x%04x, /* uid */\n", raw_inode->uid));
2544 D(printk(" 0x%04x, /* gid */\n", raw_inode->gid));
2545 D(printk(" 0x%08x, /* atime */\n", raw_inode->atime));
2546 D(printk(" 0x%08x, /* mtime */\n", raw_inode->mtime));
2547 D(printk(" 0x%08x, /* ctime */\n", raw_inode->ctime));
2548 D(printk(" 0x%08x, /* offset */\n", raw_inode->offset));
2549 D(printk(" 0x%08x, /* dsize */\n", raw_inode->dsize));
2550 D(printk(" 0x%08x, /* rsize */\n", raw_inode->rsize));
2551 D(printk(" 0x%02x, /* nsize */\n", raw_inode->nsize));
2552 D(printk(" 0x%02x, /* nlink */\n", raw_inode->nlink));
2553 D(printk(" 0x%02x, /* spare */\n",
2554 raw_inode->spare));
2555 D(printk(" %u, /* rename */\n",
2556 raw_inode->rename));
2557 D(printk(" %u, /* deleted */\n",
2558 raw_inode->deleted));
2559 D(printk(" 0x%02x, /* accurate */\n",
2560 raw_inode->accurate));
2561 D(printk(" 0x%08x, /* dchksum */\n", raw_inode->dchksum));
2562 D(printk(" 0x%04x, /* nchksum */\n", raw_inode->nchksum));
2563 D(printk(" 0x%04x, /* chksum */\n", raw_inode->chksum));
2564 D(printk("}\n"));
2565}
2566
2567
2568/* Print the contents of a file. */ 2566/* Print the contents of a file. */
2569#if 0 2567#if 0
2570int 2568int
diff --git a/fs/jffs/intrep.h b/fs/jffs/intrep.h
index 4ae97b17911c..5c7abe0e2695 100644
--- a/fs/jffs/intrep.h
+++ b/fs/jffs/intrep.h
@@ -49,8 +49,6 @@ int jffs_garbage_collect_thread(void *c);
49void jffs_garbage_collect_trigger(struct jffs_control *c); 49void jffs_garbage_collect_trigger(struct jffs_control *c);
50 50
51/* For debugging purposes. */ 51/* For debugging purposes. */
52void jffs_print_node(struct jffs_node *n);
53void jffs_print_raw_inode(struct jffs_raw_inode *raw_inode);
54#if 0 52#if 0
55int jffs_print_file(struct jffs_file *f); 53int jffs_print_file(struct jffs_file *f);
56#endif /* 0 */ 54#endif /* 0 */
diff --git a/fs/jffs/jffs_fm.c b/fs/jffs/jffs_fm.c
index 0cab8da49d3c..053e3a98a276 100644
--- a/fs/jffs/jffs_fm.c
+++ b/fs/jffs/jffs_fm.c
@@ -31,6 +31,60 @@ static void jffs_free_fm(struct jffs_fm *n);
31extern kmem_cache_t *fm_cache; 31extern kmem_cache_t *fm_cache;
32extern kmem_cache_t *node_cache; 32extern kmem_cache_t *node_cache;
33 33
34#if CONFIG_JFFS_FS_VERBOSE > 0
35void
36jffs_print_fmcontrol(struct jffs_fmcontrol *fmc)
37{
38 D(printk("struct jffs_fmcontrol: 0x%p\n", fmc));
39 D(printk("{\n"));
40 D(printk(" %u, /* flash_size */\n", fmc->flash_size));
41 D(printk(" %u, /* used_size */\n", fmc->used_size));
42 D(printk(" %u, /* dirty_size */\n", fmc->dirty_size));
43 D(printk(" %u, /* free_size */\n", fmc->free_size));
44 D(printk(" %u, /* sector_size */\n", fmc->sector_size));
45 D(printk(" %u, /* min_free_size */\n", fmc->min_free_size));
46 D(printk(" %u, /* max_chunk_size */\n", fmc->max_chunk_size));
47 D(printk(" 0x%p, /* mtd */\n", fmc->mtd));
48 D(printk(" 0x%p, /* head */ "
49 "(head->offset = 0x%08x)\n",
50 fmc->head, (fmc->head ? fmc->head->offset : 0)));
51 D(printk(" 0x%p, /* tail */ "
52 "(tail->offset + tail->size = 0x%08x)\n",
53 fmc->tail,
54 (fmc->tail ? fmc->tail->offset + fmc->tail->size : 0)));
55 D(printk(" 0x%p, /* head_extra */\n", fmc->head_extra));
56 D(printk(" 0x%p, /* tail_extra */\n", fmc->tail_extra));
57 D(printk("}\n"));
58}
59#endif /* CONFIG_JFFS_FS_VERBOSE > 0 */
60
61#if CONFIG_JFFS_FS_VERBOSE > 2
62static void
63jffs_print_fm(struct jffs_fm *fm)
64{
65 D(printk("struct jffs_fm: 0x%p\n", fm));
66 D(printk("{\n"));
67 D(printk(" 0x%08x, /* offset */\n", fm->offset));
68 D(printk(" %u, /* size */\n", fm->size));
69 D(printk(" 0x%p, /* prev */\n", fm->prev));
70 D(printk(" 0x%p, /* next */\n", fm->next));
71 D(printk(" 0x%p, /* nodes */\n", fm->nodes));
72 D(printk("}\n"));
73}
74#endif /* CONFIG_JFFS_FS_VERBOSE > 2 */
75
76#if 0
77void
78jffs_print_node_ref(struct jffs_node_ref *ref)
79{
80 D(printk("struct jffs_node_ref: 0x%p\n", ref));
81 D(printk("{\n"));
82 D(printk(" 0x%p, /* node */\n", ref->node));
83 D(printk(" 0x%p, /* next */\n", ref->next));
84 D(printk("}\n"));
85}
86#endif /* 0 */
87
34/* This function creates a new shiny flash memory control structure. */ 88/* This function creates a new shiny flash memory control structure. */
35struct jffs_fmcontrol * 89struct jffs_fmcontrol *
36jffs_build_begin(struct jffs_control *c, int unit) 90jffs_build_begin(struct jffs_control *c, int unit)
@@ -742,54 +796,3 @@ int jffs_get_node_inuse(void)
742{ 796{
743 return no_jffs_node; 797 return no_jffs_node;
744} 798}
745
746void
747jffs_print_fmcontrol(struct jffs_fmcontrol *fmc)
748{
749 D(printk("struct jffs_fmcontrol: 0x%p\n", fmc));
750 D(printk("{\n"));
751 D(printk(" %u, /* flash_size */\n", fmc->flash_size));
752 D(printk(" %u, /* used_size */\n", fmc->used_size));
753 D(printk(" %u, /* dirty_size */\n", fmc->dirty_size));
754 D(printk(" %u, /* free_size */\n", fmc->free_size));
755 D(printk(" %u, /* sector_size */\n", fmc->sector_size));
756 D(printk(" %u, /* min_free_size */\n", fmc->min_free_size));
757 D(printk(" %u, /* max_chunk_size */\n", fmc->max_chunk_size));
758 D(printk(" 0x%p, /* mtd */\n", fmc->mtd));
759 D(printk(" 0x%p, /* head */ "
760 "(head->offset = 0x%08x)\n",
761 fmc->head, (fmc->head ? fmc->head->offset : 0)));
762 D(printk(" 0x%p, /* tail */ "
763 "(tail->offset + tail->size = 0x%08x)\n",
764 fmc->tail,
765 (fmc->tail ? fmc->tail->offset + fmc->tail->size : 0)));
766 D(printk(" 0x%p, /* head_extra */\n", fmc->head_extra));
767 D(printk(" 0x%p, /* tail_extra */\n", fmc->tail_extra));
768 D(printk("}\n"));
769}
770
771void
772jffs_print_fm(struct jffs_fm *fm)
773{
774 D(printk("struct jffs_fm: 0x%p\n", fm));
775 D(printk("{\n"));
776 D(printk(" 0x%08x, /* offset */\n", fm->offset));
777 D(printk(" %u, /* size */\n", fm->size));
778 D(printk(" 0x%p, /* prev */\n", fm->prev));
779 D(printk(" 0x%p, /* next */\n", fm->next));
780 D(printk(" 0x%p, /* nodes */\n", fm->nodes));
781 D(printk("}\n"));
782}
783
784#if 0
785void
786jffs_print_node_ref(struct jffs_node_ref *ref)
787{
788 D(printk("struct jffs_node_ref: 0x%p\n", ref));
789 D(printk("{\n"));
790 D(printk(" 0x%p, /* node */\n", ref->node));
791 D(printk(" 0x%p, /* next */\n", ref->next));
792 D(printk("}\n"));
793}
794#endif /* 0 */
795
diff --git a/fs/jffs/jffs_fm.h b/fs/jffs/jffs_fm.h
index bc291c431822..f64151e74122 100644
--- a/fs/jffs/jffs_fm.h
+++ b/fs/jffs/jffs_fm.h
@@ -139,8 +139,9 @@ int jffs_add_node(struct jffs_node *node);
139void jffs_fmfree_partly(struct jffs_fmcontrol *fmc, struct jffs_fm *fm, 139void jffs_fmfree_partly(struct jffs_fmcontrol *fmc, struct jffs_fm *fm,
140 __u32 size); 140 __u32 size);
141 141
142#if CONFIG_JFFS_FS_VERBOSE > 0
142void jffs_print_fmcontrol(struct jffs_fmcontrol *fmc); 143void jffs_print_fmcontrol(struct jffs_fmcontrol *fmc);
143void jffs_print_fm(struct jffs_fm *fm); 144#endif
144#if 0 145#if 0
145void jffs_print_node_ref(struct jffs_node_ref *ref); 146void jffs_print_node_ref(struct jffs_node_ref *ref);
146#endif /* 0 */ 147#endif /* 0 */