aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/summary.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-26 16:19:05 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-26 16:19:05 -0400
commit9bfeb691e75b21fdaa80ffae719083200b190381 (patch)
tree3c828820f1385249835f85e5073b4ffd10fcd09c /fs/jffs2/summary.c
parentf75e5097ef298c5a0aa106faa211d1afdc92dc3d (diff)
[JFFS2] Switch to using an array of jffs2_raw_node_refs instead of a list.
This allows us to drop another pointer from the struct jffs2_raw_node_ref, shrinking it to 8 bytes on 32-bit machines (if the TEST_TOTLEN) paranoia check is turned off, which will be committed soon). Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/summary.c')
-rw-r--r--fs/jffs2/summary.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index 523a8f330ef5..00e856e4fdbe 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -511,7 +511,8 @@ static int jffs2_sum_process_sum_data(struct jffs2_sb_info *c, struct jffs2_eras
511 spr = (struct jffs2_sum_xref_flash *)sp; 511 spr = (struct jffs2_sum_xref_flash *)sp;
512 dbg_summary("xref at %#08x-%#08x\n", 512 dbg_summary("xref at %#08x-%#08x\n",
513 jeb->offset + je32_to_cpu(spr->offset), 513 jeb->offset + je32_to_cpu(spr->offset),
514 jeb->offset + je32_to_cpu(spr->offset) + PAD(sizeof(struct jffs2_raw_xref))); 514 jeb->offset + je32_to_cpu(spr->offset) +
515 (uint32_t)PAD(sizeof(struct jffs2_raw_xref)));
515 516
516 ref = jffs2_alloc_xattr_ref(); 517 ref = jffs2_alloc_xattr_ref();
517 if (!ref) { 518 if (!ref) {
@@ -787,10 +788,12 @@ static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock
787 JFFS2_WARNING("Write of %u bytes at 0x%08x failed. returned %d, retlen %zd\n", 788 JFFS2_WARNING("Write of %u bytes at 0x%08x failed. returned %d, retlen %zd\n",
788 infosize, sum_ofs, ret, retlen); 789 infosize, sum_ofs, ret, retlen);
789 790
790 /* Waste remaining space */ 791 if (retlen) {
791 spin_lock(&c->erase_completion_lock); 792 /* Waste remaining space */
792 jffs2_link_node_ref(c, jeb, sum_ofs | REF_OBSOLETE, infosize, NULL); 793 spin_lock(&c->erase_completion_lock);
793 spin_unlock(&c->erase_completion_lock); 794 jffs2_link_node_ref(c, jeb, sum_ofs | REF_OBSOLETE, infosize, NULL);
795 spin_unlock(&c->erase_completion_lock);
796 }
794 797
795 c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE; 798 c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
796 799
@@ -836,6 +839,7 @@ int jffs2_sum_write_sumnode(struct jffs2_sb_info *c)
836 jffs2_sum_disable_collecting(c->summary); 839 jffs2_sum_disable_collecting(c->summary);
837 840
838 JFFS2_WARNING("Not enough space for summary, padsize = %d\n", padsize); 841 JFFS2_WARNING("Not enough space for summary, padsize = %d\n", padsize);
842 spin_lock(&c->erase_completion_lock);
839 return 0; 843 return 0;
840 } 844 }
841 845