aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodelist.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-24 04:04:17 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-24 04:04:17 -0400
commit99988f7bbd16b861590dda4631c4db6cb17b5091 (patch)
tree38865d44c905d7f84d7eeb70186482e1e399fe9c /fs/jffs2/nodelist.c
parent2f785402f39b96a077b6e62bf26164bfb8e0c980 (diff)
[JFFS2] Introduce ref_next() macro for finding next physical node
Another part of the preparation for switching to an array... Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/nodelist.c')
-rw-r--r--fs/jffs2/nodelist.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index 1e6eabd730f2..0e82979c741c 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -1159,9 +1159,10 @@ static inline uint32_t __ref_totlen(struct jffs2_sb_info *c,
1159 struct jffs2_raw_node_ref *ref) 1159 struct jffs2_raw_node_ref *ref)
1160{ 1160{
1161 uint32_t ref_end; 1161 uint32_t ref_end;
1162 struct jffs2_raw_node_ref *next_ref = ref_next(ref);
1162 1163
1163 if (ref->next_phys) 1164 if (next_ref)
1164 ref_end = ref_offset(ref->next_phys); 1165 ref_end = ref_offset(next_ref);
1165 else { 1166 else {
1166 if (!jeb) 1167 if (!jeb)
1167 jeb = &c->blocks[ref->flash_offset / c->sector_size]; 1168 jeb = &c->blocks[ref->flash_offset / c->sector_size];
@@ -1196,11 +1197,11 @@ uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, struct jffs2_eraseblock *je
1196 printk(KERN_CRIT "Totlen for ref at %p (0x%08x-0x%08x) miscalculated as 0x%x instead of %x\n", 1197 printk(KERN_CRIT "Totlen for ref at %p (0x%08x-0x%08x) miscalculated as 0x%x instead of %x\n",
1197 ref, ref_offset(ref), ref_offset(ref)+ref->__totlen, 1198 ref, ref_offset(ref), ref_offset(ref)+ref->__totlen,
1198 ret, ref->__totlen); 1199 ret, ref->__totlen);
1199 if (ref->next_phys) { 1200 if (ref_next(ref)) {
1200 printk(KERN_CRIT "next_phys %p (0x%08x-0x%08x)\n", ref->next_phys, ref_offset(ref->next_phys), 1201 printk(KERN_CRIT "next %p (0x%08x-0x%08x)\n", ref_next(ref), ref_offset(ref_next(ref)),
1201 ref_offset(ref->next_phys)+ref->__totlen); 1202 ref_offset(ref_next(ref))+ref->__totlen);
1202 } else 1203 } else
1203 printk(KERN_CRIT "No next_phys. jeb->last_node is %p\n", jeb->last_node); 1204 printk(KERN_CRIT "No next ref. jeb->last_node is %p\n", jeb->last_node);
1204 1205
1205 printk(KERN_CRIT "jeb->wasted_size %x, dirty_size %x, used_size %x, free_size %x\n", jeb->wasted_size, jeb->dirty_size, jeb->used_size, jeb->free_size); 1206 printk(KERN_CRIT "jeb->wasted_size %x, dirty_size %x, used_size %x, free_size %x\n", jeb->wasted_size, jeb->dirty_size, jeb->used_size, jeb->free_size);
1206 ret = ref->__totlen; 1207 ret = ref->__totlen;