diff options
author | Artem B. Bityutskiy <dedekind@infradead.org> | 2005-07-28 10:46:43 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-11-06 12:01:24 -0500 |
commit | e0d601373b1123ea43b1fdec08d9e58a079ae35c (patch) | |
tree | d3def6c56255fb3b2b98edbfdb522fa84e6741ca /fs | |
parent | f97117d15361b3a6aeaf9e347a287ef3f54b58f9 (diff) |
[JFFS2] Debug code clean up - step 5
Replace the D1(printk()) style debugging with the new debug macros
Signed-off-by: Artem B. Bityutskiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/nodelist.c | 126 | ||||
-rw-r--r-- | fs/jffs2/readinode.c | 134 |
2 files changed, 117 insertions, 143 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index 8373d312b195..7997f526c94b 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.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: nodelist.c,v 1.101 2005/07/27 14:46:11 dedekind Exp $ | 10 | * $Id: nodelist.c,v 1.102 2005/07/28 12:45:10 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -24,35 +24,31 @@ | |||
24 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) | 24 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) |
25 | { | 25 | { |
26 | struct jffs2_full_dirent **prev = list; | 26 | struct jffs2_full_dirent **prev = list; |
27 | D1(printk(KERN_DEBUG "jffs2_add_fd_to_list( %p, %p (->%p))\n", new, list, *list)); | 27 | |
28 | JFFS2_DBG_DENTLIST("add dirent \"%s\", ino #%u\n", new->name, new->ino); | ||
28 | 29 | ||
29 | while ((*prev) && (*prev)->nhash <= new->nhash) { | 30 | while ((*prev) && (*prev)->nhash <= new->nhash) { |
30 | if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) { | 31 | if ((*prev)->nhash == new->nhash && !strcmp((*prev)->name, new->name)) { |
31 | /* Duplicate. Free one */ | 32 | /* Duplicate. Free one */ |
32 | if (new->version < (*prev)->version) { | 33 | if (new->version < (*prev)->version) { |
33 | D1(printk(KERN_DEBUG "Eep! Marking new dirent node obsolete\n")); | 34 | JFFS2_DBG_DENTLIST("Eep! Marking new dirent node is obsolete, old is \"%s\", ino #%u\n", |
34 | D1(printk(KERN_DEBUG "New dirent is \"%s\"->ino #%u. Old is \"%s\"->ino #%u\n", new->name, new->ino, (*prev)->name, (*prev)->ino)); | 35 | (*prev)->name, (*prev)->ino); |
35 | jffs2_mark_node_obsolete(c, new->raw); | 36 | jffs2_mark_node_obsolete(c, new->raw); |
36 | jffs2_free_full_dirent(new); | 37 | jffs2_free_full_dirent(new); |
37 | } else { | 38 | } else { |
38 | D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) obsolete\n", (*prev)->ino)); | 39 | JFFS2_DBG_DENTLIST("marking old dirent \"%s\", ino #%u bsolete\n", |
40 | (*prev)->name, (*prev)->ino); | ||
39 | new->next = (*prev)->next; | 41 | new->next = (*prev)->next; |
40 | jffs2_mark_node_obsolete(c, ((*prev)->raw)); | 42 | jffs2_mark_node_obsolete(c, ((*prev)->raw)); |
41 | jffs2_free_full_dirent(*prev); | 43 | jffs2_free_full_dirent(*prev); |
42 | *prev = new; | 44 | *prev = new; |
43 | } | 45 | } |
44 | goto out; | 46 | return; |
45 | } | 47 | } |
46 | prev = &((*prev)->next); | 48 | prev = &((*prev)->next); |
47 | } | 49 | } |
48 | new->next = *prev; | 50 | new->next = *prev; |
49 | *prev = new; | 51 | *prev = new; |
50 | |||
51 | out: | ||
52 | D2(while(*list) { | ||
53 | printk(KERN_DEBUG "Dirent \"%s\" (hash 0x%08x, ino #%u\n", (*list)->name, (*list)->nhash, (*list)->ino); | ||
54 | list = &(*list)->next; | ||
55 | }); | ||
56 | } | 52 | } |
57 | 53 | ||
58 | void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) | 54 | void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) |
@@ -61,14 +57,13 @@ void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *t | |||
61 | this->node->frags--; | 57 | this->node->frags--; |
62 | if (!this->node->frags) { | 58 | if (!this->node->frags) { |
63 | /* The node has no valid frags left. It's totally obsoleted */ | 59 | /* The node has no valid frags left. It's totally obsoleted */ |
64 | D2(printk(KERN_DEBUG "Marking old node @0x%08x (0x%04x-0x%04x) obsolete\n", | 60 | JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) obsolete\n", |
65 | ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size)); | 61 | ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size); |
66 | jffs2_mark_node_obsolete(c, this->node->raw); | 62 | jffs2_mark_node_obsolete(c, this->node->raw); |
67 | jffs2_free_full_dnode(this->node); | 63 | jffs2_free_full_dnode(this->node); |
68 | } else { | 64 | } else { |
69 | D2(printk(KERN_DEBUG "Marking old node @0x%08x (0x%04x-0x%04x) REF_NORMAL. frags is %d\n", | 65 | JFFS2_DBG_FRAGTREE2("marking old node @0x%08x (0x%04x-0x%04x) REF_NORMAL. frags is %d\n", |
70 | ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size, | 66 | ref_offset(this->node->raw), this->node->ofs, this->node->ofs+this->node->size, this->node->frags); |
71 | this->node->frags)); | ||
72 | mark_ref_normal(this->node->raw); | 67 | mark_ref_normal(this->node->raw); |
73 | } | 68 | } |
74 | 69 | ||
@@ -81,20 +76,19 @@ static void jffs2_fragtree_insert(struct jffs2_node_frag *newfrag, struct jffs2_ | |||
81 | struct rb_node *parent = &base->rb; | 76 | struct rb_node *parent = &base->rb; |
82 | struct rb_node **link = &parent; | 77 | struct rb_node **link = &parent; |
83 | 78 | ||
84 | D2(printk(KERN_DEBUG "jffs2_fragtree_insert(%p; %d-%d, %p)\n", newfrag, | 79 | JFFS2_DBG_FRAGTREE2("insert frag (0x%04x-0x%04x)\n", newfrag->ofs, newfrag->ofs + newfrag->size); |
85 | newfrag->ofs, newfrag->ofs+newfrag->size, base)); | ||
86 | 80 | ||
87 | while (*link) { | 81 | while (*link) { |
88 | parent = *link; | 82 | parent = *link; |
89 | base = rb_entry(parent, struct jffs2_node_frag, rb); | 83 | base = rb_entry(parent, struct jffs2_node_frag, rb); |
90 | 84 | ||
91 | D2(printk(KERN_DEBUG "fragtree_insert considering frag at 0x%x\n", base->ofs)); | 85 | JFFS2_DBG_FRAGTREE2("considering frag at 0x%08x\n", base->ofs); |
92 | if (newfrag->ofs > base->ofs) | 86 | if (newfrag->ofs > base->ofs) |
93 | link = &base->rb.rb_right; | 87 | link = &base->rb.rb_right; |
94 | else if (newfrag->ofs < base->ofs) | 88 | else if (newfrag->ofs < base->ofs) |
95 | link = &base->rb.rb_left; | 89 | link = &base->rb.rb_left; |
96 | else { | 90 | else { |
97 | printk(KERN_CRIT "Duplicate frag at %08x (%p,%p)\n", newfrag->ofs, newfrag, base); | 91 | JFFS2_ERROR("duplicate frag at %08x (%p,%p)\n", newfrag->ofs, newfrag, base); |
98 | BUG(); | 92 | BUG(); |
99 | } | 93 | } |
100 | } | 94 | } |
@@ -112,11 +106,11 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
112 | this = jffs2_lookup_node_frag(list, newfrag->node->ofs); | 106 | this = jffs2_lookup_node_frag(list, newfrag->node->ofs); |
113 | 107 | ||
114 | if (this) { | 108 | if (this) { |
115 | D2(printk(KERN_DEBUG "j_a_f_d_t_f: Lookup gave frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", | 109 | JFFS2_DBG_FRAGTREE2("lookup gave frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", |
116 | this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this)); | 110 | this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this); |
117 | lastend = this->ofs + this->size; | 111 | lastend = this->ofs + this->size; |
118 | } else { | 112 | } else { |
119 | D2(printk(KERN_DEBUG "j_a_f_d_t_f: Lookup gave no frag\n")); | 113 | JFFS2_DBG_FRAGTREE2("lookup gave no frag\n"); |
120 | lastend = 0; | 114 | lastend = 0; |
121 | } | 115 | } |
122 | 116 | ||
@@ -148,10 +142,10 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
148 | /* By definition, the 'this' node has no right-hand child, | 142 | /* By definition, the 'this' node has no right-hand child, |
149 | because there are no frags with offset greater than it. | 143 | because there are no frags with offset greater than it. |
150 | So that's where we want to put the hole */ | 144 | So that's where we want to put the hole */ |
151 | D2(printk(KERN_DEBUG "Adding hole frag (%p) on right of node at (%p)\n", holefrag, this)); | 145 | JFFS2_DBG_FRAGTREE2("adding hole frag (%p) on right of node at (%p)\n", holefrag, this); |
152 | rb_link_node(&holefrag->rb, &this->rb, &this->rb.rb_right); | 146 | rb_link_node(&holefrag->rb, &this->rb, &this->rb.rb_right); |
153 | } else { | 147 | } else { |
154 | D2(printk(KERN_DEBUG "Adding hole frag (%p) at root of tree\n", holefrag)); | 148 | JFFS2_DBG_FRAGTREE2("adding hole frag (%p) at root of tree\n", holefrag); |
155 | rb_link_node(&holefrag->rb, NULL, &list->rb_node); | 149 | rb_link_node(&holefrag->rb, NULL, &list->rb_node); |
156 | } | 150 | } |
157 | rb_insert_color(&holefrag->rb, list); | 151 | rb_insert_color(&holefrag->rb, list); |
@@ -161,18 +155,18 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
161 | /* By definition, the 'this' node has no right-hand child, | 155 | /* By definition, the 'this' node has no right-hand child, |
162 | because there are no frags with offset greater than it. | 156 | because there are no frags with offset greater than it. |
163 | So that's where we want to put new fragment */ | 157 | So that's where we want to put new fragment */ |
164 | D2(printk(KERN_DEBUG "Adding new frag (%p) on right of node at (%p)\n", newfrag, this)); | 158 | JFFS2_DBG_FRAGTREE2("adding new frag (%p) on right of node at (%p)\n", newfrag, this); |
165 | rb_link_node(&newfrag->rb, &this->rb, &this->rb.rb_right); | 159 | rb_link_node(&newfrag->rb, &this->rb, &this->rb.rb_right); |
166 | } else { | 160 | } else { |
167 | D2(printk(KERN_DEBUG "Adding new frag (%p) at root of tree\n", newfrag)); | 161 | JFFS2_DBG_FRAGTREE2("adding new frag (%p) at root of tree\n", newfrag); |
168 | rb_link_node(&newfrag->rb, NULL, &list->rb_node); | 162 | rb_link_node(&newfrag->rb, NULL, &list->rb_node); |
169 | } | 163 | } |
170 | rb_insert_color(&newfrag->rb, list); | 164 | rb_insert_color(&newfrag->rb, list); |
171 | return 0; | 165 | return 0; |
172 | } | 166 | } |
173 | 167 | ||
174 | D2(printk(KERN_DEBUG "j_a_f_d_t_f: dealing with frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", | 168 | JFFS2_DBG_FRAGTREE2("dealing with frag 0x%04x-0x%04x; phys 0x%08x (*%p)\n", |
175 | this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this)); | 169 | this->ofs, this->ofs+this->size, this->node?(ref_offset(this->node->raw)):0xffffffff, this); |
176 | 170 | ||
177 | /* OK. 'this' is pointing at the first frag that newfrag->ofs at least partially obsoletes, | 171 | /* OK. 'this' is pointing at the first frag that newfrag->ofs at least partially obsoletes, |
178 | * - i.e. newfrag->ofs < this->ofs+this->size && newfrag->ofs >= this->ofs | 172 | * - i.e. newfrag->ofs < this->ofs+this->size && newfrag->ofs >= this->ofs |
@@ -193,12 +187,12 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
193 | jffs2_free_node_frag(newfrag); | 187 | jffs2_free_node_frag(newfrag); |
194 | return -ENOMEM; | 188 | return -ENOMEM; |
195 | } | 189 | } |
196 | D2(printk(KERN_DEBUG "split old frag 0x%04x-0x%04x -->", this->ofs, this->ofs+this->size); | ||
197 | if (this->node) | 190 | if (this->node) |
198 | printk("phys 0x%08x\n", ref_offset(this->node->raw)); | 191 | JFFS2_DBG_FRAGTREE2("split old frag 0x%04x-0x%04x, phys 0x%08x\n", |
192 | this->ofs, this->ofs+this->size, ref_offset(this->node->raw)); | ||
199 | else | 193 | else |
200 | printk("hole\n"); | 194 | JFFS2_DBG_FRAGTREE2("split old hole frag 0x%04x-0x%04x\n", |
201 | ) | 195 | this->ofs, this->ofs+this->size, ref_offset(this->node->raw)); |
202 | 196 | ||
203 | /* New second frag pointing to this's node */ | 197 | /* New second frag pointing to this's node */ |
204 | newfrag2->ofs = newfrag->ofs + newfrag->size; | 198 | newfrag2->ofs = newfrag->ofs + newfrag->size; |
@@ -233,14 +227,13 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
233 | } else { | 227 | } else { |
234 | /* New frag starts at the same point as 'this' used to. Replace | 228 | /* New frag starts at the same point as 'this' used to. Replace |
235 | it in the tree without doing a delete and insertion */ | 229 | it in the tree without doing a delete and insertion */ |
236 | D2(printk(KERN_DEBUG "Inserting newfrag (*%p),%d-%d in before 'this' (*%p),%d-%d\n", | 230 | JFFS2_DBG_FRAGTREE2("inserting newfrag (*%p),%d-%d in before 'this' (*%p),%d-%d\n", |
237 | newfrag, newfrag->ofs, newfrag->ofs+newfrag->size, | 231 | newfrag, newfrag->ofs, newfrag->ofs+newfrag->size, this, this->ofs, this->ofs+this->size); |
238 | this, this->ofs, this->ofs+this->size)); | ||
239 | 232 | ||
240 | rb_replace_node(&this->rb, &newfrag->rb, list); | 233 | rb_replace_node(&this->rb, &newfrag->rb, list); |
241 | 234 | ||
242 | if (newfrag->ofs + newfrag->size >= this->ofs+this->size) { | 235 | if (newfrag->ofs + newfrag->size >= this->ofs+this->size) { |
243 | D2(printk(KERN_DEBUG "Obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size)); | 236 | JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x)\n", this, this->ofs, this->ofs+this->size); |
244 | jffs2_obsolete_node_frag(c, this); | 237 | jffs2_obsolete_node_frag(c, this); |
245 | } else { | 238 | } else { |
246 | this->ofs += newfrag->size; | 239 | this->ofs += newfrag->size; |
@@ -256,7 +249,8 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *l | |||
256 | */ | 249 | */ |
257 | while ((this = frag_next(newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) { | 250 | while ((this = frag_next(newfrag)) && newfrag->ofs + newfrag->size >= this->ofs + this->size) { |
258 | /* 'this' frag is obsoleted completely. */ | 251 | /* 'this' frag is obsoleted completely. */ |
259 | D2(printk(KERN_DEBUG "Obsoleting node frag %p (%x-%x) and removing from tree\n", this, this->ofs, this->ofs+this->size)); | 252 | JFFS2_DBG_FRAGTREE2("obsoleting node frag %p (%x-%x) and removing from tree\n", |
253 | this, this->ofs, this->ofs+this->size); | ||
260 | rb_erase(&this->rb, list); | 254 | rb_erase(&this->rb, list); |
261 | jffs2_obsolete_node_frag(c, this); | 255 | jffs2_obsolete_node_frag(c, this); |
262 | } | 256 | } |
@@ -286,8 +280,6 @@ int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_in | |||
286 | int ret; | 280 | int ret; |
287 | struct jffs2_node_frag *newfrag; | 281 | struct jffs2_node_frag *newfrag; |
288 | 282 | ||
289 | D1(printk(KERN_DEBUG "jffs2_add_full_dnode_to_inode(ino #%u, f %p, fn %p)\n", f->inocache->ino, f, fn)); | ||
290 | |||
291 | if (unlikely(!fn->size)) | 283 | if (unlikely(!fn->size)) |
292 | return 0; | 284 | return 0; |
293 | 285 | ||
@@ -295,8 +287,8 @@ int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_in | |||
295 | if (unlikely(!newfrag)) | 287 | if (unlikely(!newfrag)) |
296 | return -ENOMEM; | 288 | return -ENOMEM; |
297 | 289 | ||
298 | D2(printk(KERN_DEBUG "adding node %04x-%04x @0x%08x on flash, newfrag *%p\n", | 290 | JFFS2_DBG_FRAGTREE("adding node %#04x-%#04x @0x%08x on flash, newfrag *%p\n", |
299 | fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag)); | 291 | fn->ofs, fn->ofs+fn->size, ref_offset(fn->raw), newfrag); |
300 | 292 | ||
301 | newfrag->ofs = fn->ofs; | 293 | newfrag->ofs = fn->ofs; |
302 | newfrag->size = fn->size; | 294 | newfrag->size = fn->size; |
@@ -350,8 +342,6 @@ struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t | |||
350 | { | 342 | { |
351 | struct jffs2_inode_cache *ret; | 343 | struct jffs2_inode_cache *ret; |
352 | 344 | ||
353 | D2(printk(KERN_DEBUG "jffs2_get_ino_cache(): ino %u\n", ino)); | ||
354 | |||
355 | ret = c->inocache_list[ino % INOCACHE_HASHSIZE]; | 345 | ret = c->inocache_list[ino % INOCACHE_HASHSIZE]; |
356 | while (ret && ret->ino < ino) { | 346 | while (ret && ret->ino < ino) { |
357 | ret = ret->next; | 347 | ret = ret->next; |
@@ -360,7 +350,6 @@ struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t | |||
360 | if (ret && ret->ino != ino) | 350 | if (ret && ret->ino != ino) |
361 | ret = NULL; | 351 | ret = NULL; |
362 | 352 | ||
363 | D2(printk(KERN_DEBUG "jffs2_get_ino_cache found %p for ino %u\n", ret, ino)); | ||
364 | return ret; | 353 | return ret; |
365 | } | 354 | } |
366 | 355 | ||
@@ -372,7 +361,7 @@ void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new | |||
372 | if (!new->ino) | 361 | if (!new->ino) |
373 | new->ino = ++c->highest_ino; | 362 | new->ino = ++c->highest_ino; |
374 | 363 | ||
375 | D2(printk(KERN_DEBUG "jffs2_add_ino_cache: Add %p (ino #%u)\n", new, new->ino)); | 364 | JFFS2_DBG_INOCACHE("add %p (ino #%u)\n", new, new->ino); |
376 | 365 | ||
377 | prev = &c->inocache_list[new->ino % INOCACHE_HASHSIZE]; | 366 | prev = &c->inocache_list[new->ino % INOCACHE_HASHSIZE]; |
378 | 367 | ||
@@ -388,7 +377,8 @@ void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new | |||
388 | void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old) | 377 | void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old) |
389 | { | 378 | { |
390 | struct jffs2_inode_cache **prev; | 379 | struct jffs2_inode_cache **prev; |
391 | D1(printk(KERN_DEBUG "jffs2_del_ino_cache: Del %p (ino #%u)\n", old, old->ino)); | 380 | |
381 | JFFS2_DBG_INOCACHE("del %p (ino #%u)\n", old, old->ino); | ||
392 | spin_lock(&c->inocache_lock); | 382 | spin_lock(&c->inocache_lock); |
393 | 383 | ||
394 | prev = &c->inocache_list[old->ino % INOCACHE_HASHSIZE]; | 384 | prev = &c->inocache_list[old->ino % INOCACHE_HASHSIZE]; |
@@ -451,29 +441,29 @@ struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_ | |||
451 | struct jffs2_node_frag *prev = NULL; | 441 | struct jffs2_node_frag *prev = NULL; |
452 | struct jffs2_node_frag *frag = NULL; | 442 | struct jffs2_node_frag *frag = NULL; |
453 | 443 | ||
454 | D2(printk(KERN_DEBUG "jffs2_lookup_node_frag(%p, %d)\n", fragtree, offset)); | 444 | JFFS2_DBG_FRAGTREE2("root %p, offset %d\n", fragtree, offset); |
455 | 445 | ||
456 | next = fragtree->rb_node; | 446 | next = fragtree->rb_node; |
457 | 447 | ||
458 | while(next) { | 448 | while(next) { |
459 | frag = rb_entry(next, struct jffs2_node_frag, rb); | 449 | frag = rb_entry(next, struct jffs2_node_frag, rb); |
460 | 450 | ||
461 | D2(printk(KERN_DEBUG "Considering frag %d-%d (%p). left %p, right %p\n", | 451 | JFFS2_DBG_FRAGTREE2("considering frag %#04x-%#04x (%p). left %p, right %p\n", |
462 | frag->ofs, frag->ofs+frag->size, frag, frag->rb.rb_left, frag->rb.rb_right)); | 452 | frag->ofs, frag->ofs+frag->size, frag, frag->rb.rb_left, frag->rb.rb_right); |
463 | if (frag->ofs + frag->size <= offset) { | 453 | if (frag->ofs + frag->size <= offset) { |
464 | D2(printk(KERN_DEBUG "Going right from frag %d-%d, before the region we care about\n", | 454 | JFFS2_DBG_FRAGTREE2("going right from frag %#04x-%#04x, before the region we care about\n", |
465 | frag->ofs, frag->ofs+frag->size)); | 455 | frag->ofs, frag->ofs+frag->size); |
466 | /* Remember the closest smaller match on the way down */ | 456 | /* Remember the closest smaller match on the way down */ |
467 | if (!prev || frag->ofs > prev->ofs) | 457 | if (!prev || frag->ofs > prev->ofs) |
468 | prev = frag; | 458 | prev = frag; |
469 | next = frag->rb.rb_right; | 459 | next = frag->rb.rb_right; |
470 | } else if (frag->ofs > offset) { | 460 | } else if (frag->ofs > offset) { |
471 | D2(printk(KERN_DEBUG "Going left from frag %d-%d, after the region we care about\n", | 461 | JFFS2_DBG_FRAGTREE2("going left from frag %#04x-%#04x, after the region we care about\n", |
472 | frag->ofs, frag->ofs+frag->size)); | 462 | frag->ofs, frag->ofs+frag->size); |
473 | next = frag->rb.rb_left; | 463 | next = frag->rb.rb_left; |
474 | } else { | 464 | } else { |
475 | D2(printk(KERN_DEBUG "Returning frag %d,%d, matched\n", | 465 | JFFS2_DBG_FRAGTREE2("returning frag %#04x-%#04x, matched\n", |
476 | frag->ofs, frag->ofs+frag->size)); | 466 | frag->ofs, frag->ofs+frag->size); |
477 | return frag; | 467 | return frag; |
478 | } | 468 | } |
479 | } | 469 | } |
@@ -482,10 +472,10 @@ struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_ | |||
482 | and return the closest smaller one */ | 472 | and return the closest smaller one */ |
483 | 473 | ||
484 | if (prev) | 474 | if (prev) |
485 | D2(printk(KERN_DEBUG "No match. Returning frag %d,%d, closest previous\n", | 475 | JFFS2_DBG_FRAGTREE2("no match. Returning frag %#04x-%#04x, closest previous\n", |
486 | prev->ofs, prev->ofs+prev->size)); | 476 | prev->ofs, prev->ofs+prev->size); |
487 | else | 477 | else |
488 | D2(printk(KERN_DEBUG "Returning NULL, empty fragtree\n")); | 478 | JFFS2_DBG_FRAGTREE2("returning NULL, empty fragtree\n"); |
489 | 479 | ||
490 | return prev; | 480 | return prev; |
491 | } | 481 | } |
@@ -500,25 +490,25 @@ void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c) | |||
500 | if (!root->rb_node) | 490 | if (!root->rb_node) |
501 | return; | 491 | return; |
502 | 492 | ||
493 | JFFS2_DBG_FRAGTREE("killing\n"); | ||
494 | |||
503 | frag = (rb_entry(root->rb_node, struct jffs2_node_frag, rb)); | 495 | frag = (rb_entry(root->rb_node, struct jffs2_node_frag, rb)); |
504 | |||
505 | while(frag) { | 496 | while(frag) { |
506 | if (frag->rb.rb_left) { | 497 | if (frag->rb.rb_left) { |
507 | D2(printk(KERN_DEBUG "Going left from frag (%p) %d-%d\n", | 498 | JFFS2_DBG_FRAGTREE2("going left from frag (%p) %#04x-%#04x\n", |
508 | frag, frag->ofs, frag->ofs+frag->size)); | 499 | frag, frag->ofs, frag->ofs+frag->size); |
509 | frag = frag_left(frag); | 500 | frag = frag_left(frag); |
510 | continue; | 501 | continue; |
511 | } | 502 | } |
512 | if (frag->rb.rb_right) { | 503 | if (frag->rb.rb_right) { |
513 | D2(printk(KERN_DEBUG "Going right from frag (%p) %d-%d\n", | 504 | JFFS2_DBG_FRAGTREE2("going right from frag (%p) %#04x-%#04x\n", |
514 | frag, frag->ofs, frag->ofs+frag->size)); | 505 | frag, frag->ofs, frag->ofs+frag->size); |
515 | frag = frag_right(frag); | 506 | frag = frag_right(frag); |
516 | continue; | 507 | continue; |
517 | } | 508 | } |
518 | 509 | ||
519 | D2(printk(KERN_DEBUG "jffs2_kill_fragtree: frag at 0x%x-0x%x: node %p, frags %d--\n", | 510 | JFFS2_DBG_FRAGTREE2("frag %#04x-%#04x: node %p, frags %d\n", |
520 | frag->ofs, frag->ofs+frag->size, frag->node, | 511 | frag->ofs, frag->ofs+frag->size, frag->node, frag->node?frag->node->frags:0); |
521 | frag->node?frag->node->frags:0)); | ||
522 | 512 | ||
523 | if (frag->node && !(--frag->node->frags)) { | 513 | if (frag->node && !(--frag->node->frags)) { |
524 | /* Not a hole, and it's the final remaining frag | 514 | /* Not a hole, and it's the final remaining frag |
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 85a285b2a309..67732ba08c3e 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.131 2005/07/27 14:46:11 dedekind Exp $ | 10 | * $Id: readinode.c,v 1.132 2005/07/28 14:46:40 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -24,12 +24,12 @@ void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uin | |||
24 | { | 24 | { |
25 | struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); | 25 | struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); |
26 | 26 | ||
27 | D1(printk(KERN_DEBUG "Truncating fraglist to 0x%08x bytes\n", size)); | 27 | JFFS2_DBG_FRAGTREE("truncating fragtree to 0x%08x bytes\n", size); |
28 | 28 | ||
29 | /* We know frag->ofs <= size. That's what lookup does for us */ | 29 | /* We know frag->ofs <= size. That's what lookup does for us */ |
30 | if (frag && frag->ofs != size) { | 30 | if (frag && frag->ofs != size) { |
31 | if (frag->ofs+frag->size >= size) { | 31 | if (frag->ofs+frag->size >= size) { |
32 | D1(printk(KERN_DEBUG "Truncating frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size)); | 32 | JFFS2_DBG_FRAGTREE2("truncating frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size); |
33 | frag->size = size - frag->ofs; | 33 | frag->size = size - frag->ofs; |
34 | } | 34 | } |
35 | frag = frag_next(frag); | 35 | frag = frag_next(frag); |
@@ -37,7 +37,7 @@ void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uin | |||
37 | while (frag && frag->ofs >= size) { | 37 | while (frag && frag->ofs >= size) { |
38 | struct jffs2_node_frag *next = frag_next(frag); | 38 | struct jffs2_node_frag *next = frag_next(frag); |
39 | 39 | ||
40 | D1(printk(KERN_DEBUG "Removing frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size)); | 40 | JFFS2_DBG_FRAGTREE("removing frag 0x%08x-0x%08x\n", frag->ofs, frag->ofs+frag->size); |
41 | frag_erase(frag, list); | 41 | frag_erase(frag, list); |
42 | jffs2_obsolete_node_frag(c, frag); | 42 | jffs2_obsolete_node_frag(c, frag); |
43 | frag = next; | 43 | frag = next; |
@@ -120,7 +120,7 @@ static struct jffs2_raw_node_ref *jffs2_first_valid_node(struct jffs2_raw_node_r | |||
120 | while (ref && ref->next_in_ino) { | 120 | while (ref && ref->next_in_ino) { |
121 | if (!ref_obsolete(ref)) | 121 | if (!ref_obsolete(ref)) |
122 | return ref; | 122 | return ref; |
123 | D1(printk(KERN_DEBUG "node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref))); | 123 | JFFS2_DBG_NODEREF("node at 0x%08x is obsoleted. Ignoring.\n", ref_offset(ref)); |
124 | ref = ref->next_in_ino; | 124 | ref = ref->next_in_ino; |
125 | } | 125 | } |
126 | return NULL; | 126 | return NULL; |
@@ -152,7 +152,7 @@ read_direntry(struct jffs2_sb_info *c, | |||
152 | 152 | ||
153 | /* Sanity check */ | 153 | /* Sanity check */ |
154 | if (unlikely(PAD((rd->nsize + sizeof(*rd))) != PAD(je32_to_cpu(rd->totlen)))) { | 154 | if (unlikely(PAD((rd->nsize + sizeof(*rd))) != PAD(je32_to_cpu(rd->totlen)))) { |
155 | printk(KERN_ERR "Error! Illegal nsize in node at %#08x: nsize %#02x, totlen %#04x\n", | 155 | JFFS2_ERROR("illegal nsize in node at %#08x: nsize %#02x, totlen %#04x\n", |
156 | ref_offset(ref), rd->nsize, je32_to_cpu(rd->totlen)); | 156 | ref_offset(ref), rd->nsize, je32_to_cpu(rd->totlen)); |
157 | return 1; | 157 | return 1; |
158 | } | 158 | } |
@@ -192,7 +192,7 @@ read_direntry(struct jffs2_sb_info *c, | |||
192 | return -EIO; | 192 | return -EIO; |
193 | 193 | ||
194 | if (unlikely(err)) { | 194 | if (unlikely(err)) { |
195 | printk(KERN_WARNING "Read remainder of name: error %d\n", err); | 195 | JFFS2_ERROR("read remainder of name: error %d\n", err); |
196 | jffs2_free_full_dirent(fd); | 196 | jffs2_free_full_dirent(fd); |
197 | return -EIO; | 197 | return -EIO; |
198 | } | 198 | } |
@@ -206,8 +206,6 @@ read_direntry(struct jffs2_sb_info *c, | |||
206 | * Wheee. We now have a complete jffs2_full_dirent structure, with | 206 | * Wheee. We now have a complete jffs2_full_dirent structure, with |
207 | * the name in it and everything. Link it into the list | 207 | * the name in it and everything. Link it into the list |
208 | */ | 208 | */ |
209 | D1(printk(KERN_DEBUG "Adding fd \"%s\", ino #%u\n", fd->name, fd->ino)); | ||
210 | |||
211 | jffs2_add_fd_to_list(c, fd, fdp); | 209 | jffs2_add_fd_to_list(c, fd, fdp); |
212 | 210 | ||
213 | return 0; | 211 | return 0; |
@@ -242,7 +240,7 @@ read_dnode(struct jffs2_sb_info *c, | |||
242 | 240 | ||
243 | crc = crc32(0, rd, sizeof(*rd) - 8); | 241 | crc = crc32(0, rd, sizeof(*rd) - 8); |
244 | if (unlikely(crc != je32_to_cpu(rd->node_crc))) { | 242 | if (unlikely(crc != je32_to_cpu(rd->node_crc))) { |
245 | printk(KERN_WARNING "Header CRC failed on node at %#08x: read %#08x, calculated %#08x\n", | 243 | JFFS2_NOTICE("header CRC failed on node at %#08x: read %#08x, calculated %#08x\n", |
246 | ref_offset(ref), je32_to_cpu(rd->node_crc), crc); | 244 | ref_offset(ref), je32_to_cpu(rd->node_crc), crc); |
247 | return 1; | 245 | return 1; |
248 | } | 246 | } |
@@ -250,11 +248,8 @@ read_dnode(struct jffs2_sb_info *c, | |||
250 | /* Sanity checks */ | 248 | /* Sanity checks */ |
251 | if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) || | 249 | if (unlikely(je32_to_cpu(rd->offset) > je32_to_cpu(rd->isize)) || |
252 | unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) { | 250 | unlikely(PAD(je32_to_cpu(rd->csize) + sizeof(*rd)) != PAD(je32_to_cpu(rd->totlen)))) { |
253 | printk(KERN_WARNING "Inode corrupted at %#08x, totlen %d, #ino %d, version %d, " | 251 | JFFS2_WARNING("inode node header CRC is corrupted at %#08x\n", ref_offset(ref)); |
254 | "isize %d, csize %d, dsize %d \n", | 252 | __jffs2_dbg_dump_node(c, ref_offset(ref)); |
255 | ref_offset(ref), je32_to_cpu(rd->totlen), je32_to_cpu(rd->ino), | ||
256 | je32_to_cpu(rd->version), je32_to_cpu(rd->isize), | ||
257 | je32_to_cpu(rd->csize), je32_to_cpu(rd->dsize)); | ||
258 | return 1; | 253 | return 1; |
259 | } | 254 | } |
260 | 255 | ||
@@ -267,11 +262,11 @@ read_dnode(struct jffs2_sb_info *c, | |||
267 | err = c->mtd->point (c->mtd, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize), | 262 | err = c->mtd->point (c->mtd, ref_offset(ref) + sizeof(*rd), je32_to_cpu(rd->csize), |
268 | &read, &buf); | 263 | &read, &buf); |
269 | if (unlikely(read < je32_to_cpu(rd->csize)) && likely(!err)) { | 264 | if (unlikely(read < je32_to_cpu(rd->csize)) && likely(!err)) { |
270 | D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", read)); | 265 | JFFS2_ERROR("MTD point returned len too short: 0x%zx\n", read); |
271 | c->mtd->unpoint(c->mtd, buf, ref_offset(ref) + sizeof(*rd), | 266 | c->mtd->unpoint(c->mtd, buf, ref_offset(ref) + sizeof(*rd), |
272 | je32_to_cpu(rd->csize)); | 267 | je32_to_cpu(rd->csize)); |
273 | } else if (unlikely(err)){ | 268 | } else if (unlikely(err)){ |
274 | D1(printk(KERN_DEBUG "MTD point failed %d\n", err)); | 269 | JFFS2_ERROR("MTD point failed %d\n", err); |
275 | } else | 270 | } else |
276 | pointed = 1; /* succefully pointed to device */ | 271 | pointed = 1; /* succefully pointed to device */ |
277 | } | 272 | } |
@@ -299,8 +294,8 @@ read_dnode(struct jffs2_sb_info *c, | |||
299 | #endif | 294 | #endif |
300 | 295 | ||
301 | if (crc != je32_to_cpu(rd->data_crc)) { | 296 | if (crc != je32_to_cpu(rd->data_crc)) { |
302 | printk(KERN_NOTICE "Data CRC failed on node at %#08x: read %#08x, calculated %#08x\n", | 297 | JFFS2_NOTICE("data CRC failed on node at %#08x: read %#08x, calculated %#08x\n", |
303 | ref_offset(ref), je32_to_cpu(rd->data_crc), crc); | 298 | ref_offset(ref), je32_to_cpu(rd->data_crc), crc); |
304 | return 1; | 299 | return 1; |
305 | } | 300 | } |
306 | 301 | ||
@@ -326,10 +321,10 @@ read_dnode(struct jffs2_sb_info *c, | |||
326 | if ((je32_to_cpu(rd->dsize) >= PAGE_CACHE_SIZE) || | 321 | if ((je32_to_cpu(rd->dsize) >= PAGE_CACHE_SIZE) || |
327 | ( ((je32_to_cpu(rd->offset) & (PAGE_CACHE_SIZE-1))==0) && | 322 | ( ((je32_to_cpu(rd->offset) & (PAGE_CACHE_SIZE-1))==0) && |
328 | (je32_to_cpu(rd->dsize) + je32_to_cpu(rd->offset) == je32_to_cpu(rd->isize)))) { | 323 | (je32_to_cpu(rd->dsize) + je32_to_cpu(rd->offset) == je32_to_cpu(rd->isize)))) { |
329 | D1(printk(KERN_DEBUG "Marking node at %#08x REF_PRISTINE\n", ref_offset(ref))); | 324 | JFFS2_DBG_READINODE("marking node at %#08x REF_PRISTINE\n", ref_offset(ref)); |
330 | ref->flash_offset = ref_offset(ref) | REF_PRISTINE; | 325 | ref->flash_offset = ref_offset(ref) | REF_PRISTINE; |
331 | } else { | 326 | } else { |
332 | D1(printk(KERN_DEBUG "Marking node at %#08x REF_NORMAL\n", ref_offset(ref))); | 327 | JFFS2_DBG_READINODE("marking node at %#08x REF_NORMAL\n", ref_offset(ref)); |
333 | ref->flash_offset = ref_offset(ref) | REF_NORMAL; | 328 | ref->flash_offset = ref_offset(ref) | REF_NORMAL; |
334 | } | 329 | } |
335 | spin_unlock(&c->erase_completion_lock); | 330 | spin_unlock(&c->erase_completion_lock); |
@@ -337,13 +332,13 @@ read_dnode(struct jffs2_sb_info *c, | |||
337 | 332 | ||
338 | tn = jffs2_alloc_tmp_dnode_info(); | 333 | tn = jffs2_alloc_tmp_dnode_info(); |
339 | if (!tn) { | 334 | if (!tn) { |
340 | D1(printk(KERN_DEBUG "alloc tn failed\n")); | 335 | JFFS2_ERROR("alloc tn failed\n"); |
341 | return -ENOMEM; | 336 | return -ENOMEM; |
342 | } | 337 | } |
343 | 338 | ||
344 | tn->fn = jffs2_alloc_full_dnode(); | 339 | tn->fn = jffs2_alloc_full_dnode(); |
345 | if (!tn->fn) { | 340 | if (!tn->fn) { |
346 | D1(printk(KERN_DEBUG "alloc fn failed\n")); | 341 | JFFS2_ERROR("alloc fn failed\n"); |
347 | jffs2_free_tmp_dnode_info(tn); | 342 | jffs2_free_tmp_dnode_info(tn); |
348 | return -ENOMEM; | 343 | return -ENOMEM; |
349 | } | 344 | } |
@@ -359,9 +354,8 @@ read_dnode(struct jffs2_sb_info *c, | |||
359 | else // normal case... | 354 | else // normal case... |
360 | tn->fn->size = je32_to_cpu(rd->dsize); | 355 | tn->fn->size = je32_to_cpu(rd->dsize); |
361 | 356 | ||
362 | D1(printk(KERN_DEBUG "dnode @%08x: ver %u, offset %#04x, dsize %#04x\n", | 357 | JFFS2_DBG_READINODE("dnode @%08x: ver %u, offset %#04x, dsize %#04x\n", |
363 | ref_offset(ref), je32_to_cpu(rd->version), | 358 | ref_offset(ref), je32_to_cpu(rd->version), je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize)); |
364 | je32_to_cpu(rd->offset), je32_to_cpu(rd->dsize))); | ||
365 | 359 | ||
366 | jffs2_add_tn_to_tree(tn, tnp); | 360 | jffs2_add_tn_to_tree(tn, tnp); |
367 | 361 | ||
@@ -388,37 +382,33 @@ read_unknown(struct jffs2_sb_info *c, | |||
388 | un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); | 382 | un->nodetype = cpu_to_je16(JFFS2_NODE_ACCURATE | je16_to_cpu(un->nodetype)); |
389 | 383 | ||
390 | if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) { | 384 | if (crc32(0, un, sizeof(struct jffs2_unknown_node) - 4) != je32_to_cpu(un->hdr_crc)) { |
391 | |||
392 | /* Hmmm. This should have been caught at scan time. */ | 385 | /* Hmmm. This should have been caught at scan time. */ |
393 | printk(KERN_WARNING "Warning! Node header CRC failed at %#08x. " | 386 | JFFS2_NOTICE("node header CRC failed at %#08x. But it must have been OK earlier.\n", ref_offset(ref)); |
394 | "But it must have been OK earlier.\n", ref_offset(ref)); | 387 | __jffs2_dbg_dump_node(c, ref_offset(ref)); |
395 | D1(printk(KERN_DEBUG "Node was: { %#04x, %#04x, %#08x, %#08x }\n", | ||
396 | je16_to_cpu(un->magic), je16_to_cpu(un->nodetype), | ||
397 | je32_to_cpu(un->totlen), je32_to_cpu(un->hdr_crc))); | ||
398 | return 1; | 388 | return 1; |
399 | } else { | 389 | } else { |
400 | switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) { | 390 | switch(je16_to_cpu(un->nodetype) & JFFS2_COMPAT_MASK) { |
401 | 391 | ||
402 | case JFFS2_FEATURE_INCOMPAT: | 392 | case JFFS2_FEATURE_INCOMPAT: |
403 | printk(KERN_NOTICE "Unknown INCOMPAT nodetype %#04X at %#08x\n", | 393 | JFFS2_ERROR("unknown INCOMPAT nodetype %#04X at %#08x\n", |
404 | je16_to_cpu(un->nodetype), ref_offset(ref)); | 394 | je16_to_cpu(un->nodetype), ref_offset(ref)); |
405 | /* EEP */ | 395 | /* EEP */ |
406 | BUG(); | 396 | BUG(); |
407 | break; | 397 | break; |
408 | 398 | ||
409 | case JFFS2_FEATURE_ROCOMPAT: | 399 | case JFFS2_FEATURE_ROCOMPAT: |
410 | printk(KERN_NOTICE "Unknown ROCOMPAT nodetype %#04X at %#08x\n", | 400 | JFFS2_ERROR("unknown ROCOMPAT nodetype %#04X at %#08x\n", |
411 | je16_to_cpu(un->nodetype), ref_offset(ref)); | 401 | je16_to_cpu(un->nodetype), ref_offset(ref)); |
412 | BUG_ON(!(c->flags & JFFS2_SB_FLAG_RO)); | 402 | BUG_ON(!(c->flags & JFFS2_SB_FLAG_RO)); |
413 | break; | 403 | break; |
414 | 404 | ||
415 | case JFFS2_FEATURE_RWCOMPAT_COPY: | 405 | case JFFS2_FEATURE_RWCOMPAT_COPY: |
416 | printk(KERN_NOTICE "Unknown RWCOMPAT_COPY nodetype %#04X at %#08x\n", | 406 | JFFS2_NOTICE("unknown RWCOMPAT_COPY nodetype %#04X at %#08x\n", |
417 | je16_to_cpu(un->nodetype), ref_offset(ref)); | 407 | je16_to_cpu(un->nodetype), ref_offset(ref)); |
418 | break; | 408 | break; |
419 | 409 | ||
420 | case JFFS2_FEATURE_RWCOMPAT_DELETE: | 410 | case JFFS2_FEATURE_RWCOMPAT_DELETE: |
421 | printk(KERN_NOTICE "Unknown RWCOMPAT_DELETE nodetype %#04X at %#08x\n", | 411 | JFFS2_NOTICE("unknown RWCOMPAT_DELETE nodetype %#04X at %#08x\n", |
422 | je16_to_cpu(un->nodetype), ref_offset(ref)); | 412 | je16_to_cpu(un->nodetype), ref_offset(ref)); |
423 | return 1; | 413 | return 1; |
424 | } | 414 | } |
@@ -444,14 +434,14 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
444 | 434 | ||
445 | *mctime_ver = 0; | 435 | *mctime_ver = 0; |
446 | 436 | ||
447 | D1(printk(KERN_DEBUG "jffs2_get_inode_nodes(): ino #%u\n", f->inocache->ino)); | 437 | JFFS2_DBG_READINODE("ino #%u\n", f->inocache->ino); |
448 | 438 | ||
449 | spin_lock(&c->erase_completion_lock); | 439 | spin_lock(&c->erase_completion_lock); |
450 | 440 | ||
451 | valid_ref = jffs2_first_valid_node(f->inocache->nodes); | 441 | valid_ref = jffs2_first_valid_node(f->inocache->nodes); |
452 | 442 | ||
453 | if (!valid_ref && (f->inocache->ino != 1)) | 443 | if (!valid_ref && (f->inocache->ino != 1)) |
454 | printk(KERN_WARNING "Eep. No valid nodes for ino #%u\n", f->inocache->ino); | 444 | JFFS2_WARNING("no valid nodes for ino #%u\n", f->inocache->ino); |
455 | 445 | ||
456 | while (valid_ref) { | 446 | while (valid_ref) { |
457 | /* We can hold a pointer to a non-obsolete node without the spinlock, | 447 | /* We can hold a pointer to a non-obsolete node without the spinlock, |
@@ -471,17 +461,17 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
471 | min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node)), | 461 | min_t(uint32_t, ref_totlen(c, NULL, ref), sizeof(node)), |
472 | &retlen, (void *)&node); | 462 | &retlen, (void *)&node); |
473 | if (err) { | 463 | if (err) { |
474 | printk(KERN_WARNING "error %d reading node at 0x%08x in get_inode_nodes()\n", err, ref_offset(ref)); | 464 | JFFS2_ERROR("error %d reading node at 0x%08x in get_inode_nodes()\n", err, ref_offset(ref)); |
475 | goto free_out; | 465 | goto free_out; |
476 | } | 466 | } |
477 | 467 | ||
478 | switch (je16_to_cpu(node.u.nodetype)) { | 468 | switch (je16_to_cpu(node.u.nodetype)) { |
479 | 469 | ||
480 | case JFFS2_NODETYPE_DIRENT: | 470 | case JFFS2_NODETYPE_DIRENT: |
481 | D1(printk(KERN_DEBUG "Node at %08x (%d) is a dirent node\n", ref_offset(ref), ref_flags(ref))); | 471 | JFFS2_DBG_READINODE("node at %08x (%d) is a dirent node\n", ref_offset(ref), ref_flags(ref)); |
482 | 472 | ||
483 | if (retlen < sizeof(node.d)) { | 473 | if (retlen < sizeof(node.d)) { |
484 | printk(KERN_WARNING "Warning! Short read dirent at %#08x\n", ref_offset(ref)); | 474 | JFFS2_ERROR("short read dirent at %#08x\n", ref_offset(ref)); |
485 | err = -EIO; | 475 | err = -EIO; |
486 | goto free_out; | 476 | goto free_out; |
487 | } | 477 | } |
@@ -499,10 +489,10 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
499 | break; | 489 | break; |
500 | 490 | ||
501 | case JFFS2_NODETYPE_INODE: | 491 | case JFFS2_NODETYPE_INODE: |
502 | D1(printk(KERN_DEBUG "Node at %08x (%d) is a data node\n", ref_offset(ref), ref_flags(ref))); | 492 | JFFS2_DBG_READINODE("node at %08x (%d) is a data node\n", ref_offset(ref), ref_flags(ref)); |
503 | 493 | ||
504 | if (retlen < sizeof(node.i)) { | 494 | if (retlen < sizeof(node.i)) { |
505 | printk(KERN_WARNING "Warning! Short read dnode at %#08x\n", ref_offset(ref)); | 495 | JFFS2_ERROR("short read dnode at %#08x\n", ref_offset(ref)); |
506 | err = -EIO; | 496 | err = -EIO; |
507 | goto free_out; | 497 | goto free_out; |
508 | } | 498 | } |
@@ -517,16 +507,15 @@ static int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_inf | |||
517 | if (je32_to_cpu(node.i.version) > *highest_version) | 507 | if (je32_to_cpu(node.i.version) > *highest_version) |
518 | *highest_version = je32_to_cpu(node.i.version); | 508 | *highest_version = je32_to_cpu(node.i.version); |
519 | 509 | ||
520 | D1(printk(KERN_DEBUG "version %d, highest_version now %d\n", | 510 | JFFS2_DBG_READINODE("version %d, highest_version now %d\n", |
521 | je32_to_cpu(node.i.version), *highest_version)); | 511 | je32_to_cpu(node.i.version), *highest_version); |
522 | 512 | ||
523 | break; | 513 | break; |
524 | 514 | ||
525 | default: | 515 | default: |
526 | /* Check we've managed to read at least the common node header */ | 516 | /* Check we've managed to read at least the common node header */ |
527 | if (retlen < sizeof(struct jffs2_unknown_node)) { | 517 | if (retlen < sizeof(struct jffs2_unknown_node)) { |
528 | printk(KERN_WARNING "Warning! Short read unknown node at %#08x\n", | 518 | JFFS2_ERROR("short read unknown node at %#08x\n", ref_offset(ref)); |
529 | ref_offset(ref)); | ||
530 | return -EIO; | 519 | return -EIO; |
531 | } | 520 | } |
532 | 521 | ||
@@ -568,13 +557,13 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
568 | size_t retlen; | 557 | size_t retlen; |
569 | int ret; | 558 | int ret; |
570 | 559 | ||
571 | D1(printk(KERN_DEBUG "jffs2_do_read_inode_internal(): ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink)); | 560 | JFFS2_DBG_READINODE("ino #%u nlink is %d\n", f->inocache->ino, f->inocache->nlink); |
572 | 561 | ||
573 | /* Grab all nodes relevant to this ino */ | 562 | /* Grab all nodes relevant to this ino */ |
574 | ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver); | 563 | ret = jffs2_get_inode_nodes(c, f, &tn_list, &fd_list, &f->highest_version, &latest_mctime, &mctime_ver); |
575 | 564 | ||
576 | if (ret) { | 565 | if (ret) { |
577 | printk(KERN_CRIT "jffs2_get_inode_nodes() for ino %u returned %d\n", f->inocache->ino, ret); | 566 | JFFS2_ERROR("cannot read nodes for ino %u, returned error is %d\n", f->inocache->ino, ret); |
578 | if (f->inocache->state == INO_STATE_READING) | 567 | if (f->inocache->state == INO_STATE_READING) |
579 | jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); | 568 | jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); |
580 | return ret; | 569 | return ret; |
@@ -589,7 +578,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
589 | 578 | ||
590 | if (f->metadata) { | 579 | if (f->metadata) { |
591 | if (likely(tn->version >= mdata_ver)) { | 580 | if (likely(tn->version >= mdata_ver)) { |
592 | D1(printk(KERN_DEBUG "Obsoleting old metadata at 0x%08x\n", ref_offset(f->metadata->raw))); | 581 | JFFS2_DBG_READINODE("obsoleting old metadata at 0x%08x\n", ref_offset(f->metadata->raw)); |
593 | jffs2_mark_node_obsolete(c, f->metadata->raw); | 582 | jffs2_mark_node_obsolete(c, f->metadata->raw); |
594 | jffs2_free_full_dnode(f->metadata); | 583 | jffs2_free_full_dnode(f->metadata); |
595 | f->metadata = NULL; | 584 | f->metadata = NULL; |
@@ -597,7 +586,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
597 | mdata_ver = 0; | 586 | mdata_ver = 0; |
598 | } else { | 587 | } else { |
599 | /* This should never happen. */ | 588 | /* This should never happen. */ |
600 | printk(KERN_WARNING "Er. New metadata at 0x%08x with ver %d is actually older than previous ver %d at 0x%08x\n", | 589 | JFFS2_ERROR("Er. New metadata at 0x%08x with ver %d is actually older than previous ver %d at 0x%08x\n", |
601 | ref_offset(fn->raw), tn->version, mdata_ver, ref_offset(f->metadata->raw)); | 590 | ref_offset(fn->raw), tn->version, mdata_ver, ref_offset(f->metadata->raw)); |
602 | jffs2_mark_node_obsolete(c, fn->raw); | 591 | jffs2_mark_node_obsolete(c, fn->raw); |
603 | jffs2_free_full_dnode(fn); | 592 | jffs2_free_full_dnode(fn); |
@@ -611,7 +600,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
611 | jffs2_add_full_dnode_to_inode(c, f, fn); | 600 | jffs2_add_full_dnode_to_inode(c, f, fn); |
612 | } else { | 601 | } else { |
613 | /* Zero-sized node at end of version list. Just a metadata update */ | 602 | /* Zero-sized node at end of version list. Just a metadata update */ |
614 | D1(printk(KERN_DEBUG "metadata @%08x: ver %d\n", ref_offset(fn->raw), tn->version)); | 603 | JFFS2_DBG_READINODE("metadata @%08x: ver %d\n", ref_offset(fn->raw), tn->version); |
615 | f->metadata = fn; | 604 | f->metadata = fn; |
616 | mdata_ver = tn->version; | 605 | mdata_ver = tn->version; |
617 | } | 606 | } |
@@ -646,13 +635,13 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
646 | if (!fn) { | 635 | if (!fn) { |
647 | /* No data nodes for this inode. */ | 636 | /* No data nodes for this inode. */ |
648 | if (f->inocache->ino != 1) { | 637 | if (f->inocache->ino != 1) { |
649 | printk(KERN_WARNING "jffs2_do_read_inode(): No data nodes found for ino #%u\n", f->inocache->ino); | 638 | JFFS2_WARNING("no data nodes found for ino #%u\n", f->inocache->ino); |
650 | if (!fd_list) { | 639 | if (!fd_list) { |
651 | if (f->inocache->state == INO_STATE_READING) | 640 | if (f->inocache->state == INO_STATE_READING) |
652 | jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); | 641 | jffs2_set_inocache_state(c, f->inocache, INO_STATE_CHECKEDABSENT); |
653 | return -EIO; | 642 | return -EIO; |
654 | } | 643 | } |
655 | printk(KERN_WARNING "jffs2_do_read_inode(): But it has children so we fake some modes for it\n"); | 644 | JFFS2_NOTICE("but it has children so we fake some modes for it\n"); |
656 | } | 645 | } |
657 | latest_node->mode = cpu_to_jemode(S_IFDIR|S_IRUGO|S_IWUSR|S_IXUGO); | 646 | latest_node->mode = cpu_to_jemode(S_IFDIR|S_IRUGO|S_IWUSR|S_IXUGO); |
658 | latest_node->version = cpu_to_je32(0); | 647 | latest_node->version = cpu_to_je32(0); |
@@ -667,8 +656,8 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
667 | 656 | ||
668 | ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(*latest_node), &retlen, (void *)latest_node); | 657 | ret = jffs2_flash_read(c, ref_offset(fn->raw), sizeof(*latest_node), &retlen, (void *)latest_node); |
669 | if (ret || retlen != sizeof(*latest_node)) { | 658 | if (ret || retlen != sizeof(*latest_node)) { |
670 | printk(KERN_NOTICE "MTD read in jffs2_do_read_inode() failed: Returned %d, %zd of %zd bytes read\n", | 659 | JFFS2_ERROR("failed to read from flash: error %d, %zd of %zd bytes read\n", |
671 | ret, retlen, sizeof(*latest_node)); | 660 | ret, retlen, sizeof(*latest_node)); |
672 | /* FIXME: If this fails, there seems to be a memory leak. Find it. */ | 661 | /* FIXME: If this fails, there seems to be a memory leak. Find it. */ |
673 | up(&f->sem); | 662 | up(&f->sem); |
674 | jffs2_do_clear_inode(c, f); | 663 | jffs2_do_clear_inode(c, f); |
@@ -677,7 +666,8 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
677 | 666 | ||
678 | crc = crc32(0, latest_node, sizeof(*latest_node)-8); | 667 | crc = crc32(0, latest_node, sizeof(*latest_node)-8); |
679 | if (crc != je32_to_cpu(latest_node->node_crc)) { | 668 | if (crc != je32_to_cpu(latest_node->node_crc)) { |
680 | printk(KERN_NOTICE "CRC failed for read_inode of inode %u at physical location 0x%x\n", f->inocache->ino, ref_offset(fn->raw)); | 669 | JFFS2_ERROR("CRC failed for read_inode of inode %u at physical location 0x%x\n", |
670 | f->inocache->ino, ref_offset(fn->raw)); | ||
681 | up(&f->sem); | 671 | up(&f->sem); |
682 | jffs2_do_clear_inode(c, f); | 672 | jffs2_do_clear_inode(c, f); |
683 | return -EIO; | 673 | return -EIO; |
@@ -712,9 +702,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
712 | * operation. */ | 702 | * operation. */ |
713 | f->target = kmalloc(je32_to_cpu(latest_node->csize) + 1, GFP_KERNEL); | 703 | f->target = kmalloc(je32_to_cpu(latest_node->csize) + 1, GFP_KERNEL); |
714 | if (!f->target) { | 704 | if (!f->target) { |
715 | printk(KERN_WARNING "Can't allocate %d bytes of memory " | 705 | JFFS2_ERROR("can't allocate %d bytes of memory for the symlink target path cache\n", je32_to_cpu(latest_node->csize)); |
716 | "for the symlink target path cache\n", | ||
717 | je32_to_cpu(latest_node->csize)); | ||
718 | up(&f->sem); | 706 | up(&f->sem); |
719 | jffs2_do_clear_inode(c, f); | 707 | jffs2_do_clear_inode(c, f); |
720 | return -ENOMEM; | 708 | return -ENOMEM; |
@@ -734,8 +722,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
734 | } | 722 | } |
735 | 723 | ||
736 | f->target[je32_to_cpu(latest_node->csize)] = '\0'; | 724 | f->target[je32_to_cpu(latest_node->csize)] = '\0'; |
737 | D1(printk(KERN_DEBUG "jffs2_do_read_inode(): symlink's target '%s' cached\n", | 725 | JFFS2_DBG_READINODE("symlink's target '%s' cached\n", f->target); |
738 | f->target)); | ||
739 | } | 726 | } |
740 | 727 | ||
741 | /* fall through... */ | 728 | /* fall through... */ |
@@ -745,14 +732,14 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
745 | /* Certain inode types should have only one data node, and it's | 732 | /* Certain inode types should have only one data node, and it's |
746 | kept as the metadata node */ | 733 | kept as the metadata node */ |
747 | if (f->metadata) { | 734 | if (f->metadata) { |
748 | printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o had metadata node\n", | 735 | JFFS2_ERROR("Argh. Special inode #%u with mode 0%o had metadata node\n", |
749 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); | 736 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); |
750 | up(&f->sem); | 737 | up(&f->sem); |
751 | jffs2_do_clear_inode(c, f); | 738 | jffs2_do_clear_inode(c, f); |
752 | return -EIO; | 739 | return -EIO; |
753 | } | 740 | } |
754 | if (!frag_first(&f->fragtree)) { | 741 | if (!frag_first(&f->fragtree)) { |
755 | printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o has no fragments\n", | 742 | JFFS2_ERROR("Argh. Special inode #%u with mode 0%o has no fragments\n", |
756 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); | 743 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); |
757 | up(&f->sem); | 744 | up(&f->sem); |
758 | jffs2_do_clear_inode(c, f); | 745 | jffs2_do_clear_inode(c, f); |
@@ -760,7 +747,7 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
760 | } | 747 | } |
761 | /* ASSERT: f->fraglist != NULL */ | 748 | /* ASSERT: f->fraglist != NULL */ |
762 | if (frag_next(frag_first(&f->fragtree))) { | 749 | if (frag_next(frag_first(&f->fragtree))) { |
763 | printk(KERN_WARNING "Argh. Special inode #%u with mode 0x%x had more than one node\n", | 750 | JFFS2_ERROR("Argh. Special inode #%u with mode 0x%x had more than one node\n", |
764 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); | 751 | f->inocache->ino, jemode_to_cpu(latest_node->mode)); |
765 | /* FIXME: Deal with it - check crc32, check for duplicate node, check times and discard the older one */ | 752 | /* FIXME: Deal with it - check crc32, check for duplicate node, check times and discard the older one */ |
766 | up(&f->sem); | 753 | up(&f->sem); |
@@ -783,14 +770,12 @@ static int jffs2_do_read_inode_internal(struct jffs2_sb_info *c, | |||
783 | int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | 770 | int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, |
784 | uint32_t ino, struct jffs2_raw_inode *latest_node) | 771 | uint32_t ino, struct jffs2_raw_inode *latest_node) |
785 | { | 772 | { |
786 | D2(printk(KERN_DEBUG "jffs2_do_read_inode(): getting inocache\n")); | 773 | JFFS2_DBG_READINODE("read inode #%u\n", ino); |
787 | 774 | ||
788 | retry_inocache: | 775 | retry_inocache: |
789 | spin_lock(&c->inocache_lock); | 776 | spin_lock(&c->inocache_lock); |
790 | f->inocache = jffs2_get_ino_cache(c, ino); | 777 | f->inocache = jffs2_get_ino_cache(c, ino); |
791 | 778 | ||
792 | D2(printk(KERN_DEBUG "jffs2_do_read_inode(): Got inocache at %p\n", f->inocache)); | ||
793 | |||
794 | if (f->inocache) { | 779 | if (f->inocache) { |
795 | /* Check its state. We may need to wait before we can use it */ | 780 | /* Check its state. We may need to wait before we can use it */ |
796 | switch(f->inocache->state) { | 781 | switch(f->inocache->state) { |
@@ -804,8 +789,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
804 | /* If it's in either of these states, we need | 789 | /* If it's in either of these states, we need |
805 | to wait for whoever's got it to finish and | 790 | to wait for whoever's got it to finish and |
806 | put it back. */ | 791 | put it back. */ |
807 | D1(printk(KERN_DEBUG "jffs2_get_ino_cache_read waiting for ino #%u in state %d\n", | 792 | JFFS2_DBG_READINODE("waiting for ino #%u in state %d\n", ino, f->inocache->state); |
808 | ino, f->inocache->state)); | ||
809 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); | 793 | sleep_on_spinunlock(&c->inocache_wq, &c->inocache_lock); |
810 | goto retry_inocache; | 794 | goto retry_inocache; |
811 | 795 | ||
@@ -814,7 +798,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
814 | /* Eep. This should never happen. It can | 798 | /* Eep. This should never happen. It can |
815 | happen if Linux calls read_inode() again | 799 | happen if Linux calls read_inode() again |
816 | before clear_inode() has finished though. */ | 800 | before clear_inode() has finished though. */ |
817 | printk(KERN_WARNING "Eep. Trying to read_inode #%u when it's already in state %d!\n", ino, f->inocache->state); | 801 | JFFS2_ERROR("Eep. Trying to read_inode #%u when it's already in state %d!\n", ino, f->inocache->state); |
818 | /* Fail. That's probably better than allowing it to succeed */ | 802 | /* Fail. That's probably better than allowing it to succeed */ |
819 | f->inocache = NULL; | 803 | f->inocache = NULL; |
820 | break; | 804 | break; |
@@ -829,10 +813,10 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
829 | /* Special case - no root inode on medium */ | 813 | /* Special case - no root inode on medium */ |
830 | f->inocache = jffs2_alloc_inode_cache(); | 814 | f->inocache = jffs2_alloc_inode_cache(); |
831 | if (!f->inocache) { | 815 | if (!f->inocache) { |
832 | printk(KERN_CRIT "jffs2_do_read_inode(): Cannot allocate inocache for root inode\n"); | 816 | JFFS2_ERROR("cannot allocate inocache for root inode\n"); |
833 | return -ENOMEM; | 817 | return -ENOMEM; |
834 | } | 818 | } |
835 | D1(printk(KERN_DEBUG "jffs2_do_read_inode(): Creating inocache for root inode\n")); | 819 | JFFS2_DBG_READINODE("creating inocache for root inode\n"); |
836 | memset(f->inocache, 0, sizeof(struct jffs2_inode_cache)); | 820 | memset(f->inocache, 0, sizeof(struct jffs2_inode_cache)); |
837 | f->inocache->ino = f->inocache->nlink = 1; | 821 | f->inocache->ino = f->inocache->nlink = 1; |
838 | f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; | 822 | f->inocache->nodes = (struct jffs2_raw_node_ref *)f->inocache; |
@@ -840,7 +824,7 @@ int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
840 | jffs2_add_ino_cache(c, f->inocache); | 824 | jffs2_add_ino_cache(c, f->inocache); |
841 | } | 825 | } |
842 | if (!f->inocache) { | 826 | if (!f->inocache) { |
843 | printk(KERN_WARNING "jffs2_do_read_inode() on nonexistent ino %u\n", ino); | 827 | JFFS2_ERROR("requestied to read an nonexistent ino %u\n", ino); |
844 | return -ENOENT; | 828 | return -ENOENT; |
845 | } | 829 | } |
846 | 830 | ||