- /* If we've never checked the CRCs on this node, check them now */
- if (ref_flags(ref) == REF_UNCHECKED) {
- struct jffs2_eraseblock *jeb;
- int len;
-
- /* Sanity check */
- if (unlikely(PAD((rd->nsize + sizeof(*rd))) != PAD(je32_to_cpu(rd->totlen)))) {
- JFFS2_ERROR("illegal nsize in node at %#08x: nsize %#02x, totlen %#04x\n",
- ref_offset(ref), rd->nsize, je32_to_cpu(rd->totlen));
- return 1;
- }
-
- jeb = &c->blocks[ref->flash_offset / c->sector_size];
- len = ref_totlen(c, jeb, ref);
-
- spin_lock(&c->erase_completion_lock);
- jeb->used_size += len;
- jeb->unchecked_size -= len;
- c->used_size += len;
- c->unchecked_size -= len;
- ref->flash_offset = ref_offset(ref) | REF_PRISTINE;
- spin_unlock(&c->erase_completion_lock);
- }
-