summaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodemgmt.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-21 13:29:11 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-21 13:29:11 +0100
commitca89a517fa577e6f26621463d3aa4f3c3d530b1e (patch)
treee277f31d6629c5dcc358adfa80190fc247d43f65 /fs/jffs2/nodemgmt.c
parent010b06d6d07d9fa5ea6070aa72bb3e0de1761ab7 (diff)
downloadblackbird-op-linux-ca89a517fa577e6f26621463d3aa4f3c3d530b1e.tar.gz
blackbird-op-linux-ca89a517fa577e6f26621463d3aa4f3c3d530b1e.zip
[JFFS2] Finally eliminate __totlen field from struct jffs2_raw_node_ref
Well, almost. We'll actually keep a 'TEST_TOTLEN' macro set for now, and keep doing some paranoia checks to make sure it's all working correctly. But if TEST_TOTLEN is unset, the size of struct jffs2_raw_node_ref drops from 16 bytes to 12 on 32-bit machines. That's a saving of about half a megabyte of memory on the OLPC prototype board, with 125K or so nodes in its 512MiB of flash. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/nodemgmt.c')
-rw-r--r--fs/jffs2/nodemgmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c
index 4701556be49d..9a0f312cfcda 100644
--- a/fs/jffs2/nodemgmt.c
+++ b/fs/jffs2/nodemgmt.c
@@ -386,7 +386,9 @@ int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_r
struct jffs2_eraseblock *jeb;
jeb = &c->blocks[new->flash_offset / c->sector_size];
+#ifdef TEST_TOTLEN
new->__totlen = len;
+#endif
D1(printk(KERN_DEBUG "jffs2_add_physical_node_ref(): Node at 0x%x(%d), size 0x%x\n", ref_offset(new), ref_flags(new), len));
#if 1
@@ -679,7 +681,9 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
spin_lock(&c->erase_completion_lock);
+#ifdef TEST_TOTLEN
ref->__totlen += n->__totlen;
+#endif
ref->next_phys = n->next_phys;
if (jeb->last_node == n) jeb->last_node = ref;
if (jeb->gc_node == n) {
@@ -702,7 +706,9 @@ void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref
p = p->next_phys;
if (ref_obsolete(p) && !ref->next_in_ino) {
+#ifdef TEST_TOTLEN
p->__totlen += ref->__totlen;
+#endif
if (jeb->last_node == ref) {
jeb->last_node = p;
}
OpenPOWER on IntegriCloud