Lines Matching refs:summary

30 	c->summary = kzalloc(sizeof(struct jffs2_summary), GFP_KERNEL);
32 if (!c->summary) {
33 JFFS2_WARNING("Can't allocate memory for summary information!\n");
37 c->summary->sum_buf = kmalloc(sum_size, GFP_KERNEL);
39 if (!c->summary->sum_buf) {
40 JFFS2_WARNING("Can't allocate buffer for writing out summary information!\n");
41 kfree(c->summary);
54 jffs2_sum_disable_collecting(c->summary);
56 kfree(c->summary->sum_buf);
57 c->summary->sum_buf = NULL;
59 kfree(c->summary);
60 c->summary = NULL;
75 dbg_summary("inode (%u) added to summary\n",
81 dbg_summary("dirent (%u) added to summary\n",
88 dbg_summary("xattr (xid=%u, version=%u) added to summary\n",
94 dbg_summary("xref added to summary\n");
106 /* The following 3 functions are called from scan.c to collect summary info for not closed jeb */
191 /* Cleanup every collected summary information */
229 /* Move the collected summary information into sb (called from scan.c) */
234 c->summary->sum_size, c->summary->sum_num,
237 c->summary->sum_size = s->sum_size;
238 c->summary->sum_num = s->sum_num;
239 c->summary->sum_padded = s->sum_padded;
240 c->summary->sum_list_head = s->sum_list_head;
241 c->summary->sum_list_tail = s->sum_list_tail;
254 if (c->summary->sum_size == JFFS2_SUMMARY_NOSUM_SIZE) {
255 dbg_summary("Summary is disabled for this jeb! Skipping summary info!\n");
278 return jffs2_sum_add_mem(c->summary, (union jffs2_sum_mem *)temp);
312 return jffs2_sum_add_mem(c->summary, (union jffs2_sum_mem *)temp);
328 return jffs2_sum_add_mem(c->summary, (union jffs2_sum_mem *)temp);
339 return jffs2_sum_add_mem(c->summary, (union jffs2_sum_mem *)temp);
344 c->summary->sum_padded += je32_to_cpu(node->u.totlen);
357 summary support for it or disable summary.
384 /* Process the stored summary information - helper function for jffs2_sum_scan_sumnode() */
387 struct jffs2_raw_summary *summary, uint32_t *pseudo_random)
395 sp = summary->sum;
397 for (i=0; i<je32_to_cpu(summary->sum_num); i++) {
398 dbg_summary("processing summary index %d\n", i);
551 JFFS2_WARNING("Unsupported node type %x found in summary! Exiting...\n", nodetype);
571 /* Process the summary node - called from jffs2_scan_eraseblock() */
573 struct jffs2_raw_summary *summary, uint32_t sumsize,
582 dbg_summary("summary found for 0x%08x at 0x%08x (0x%x bytes)\n",
588 crcnode.totlen = summary->totlen;
591 if (je32_to_cpu(summary->hdr_crc) != crc) {
593 "no summary at all)\n");
597 if (je32_to_cpu(summary->totlen) != sumsize) {
602 crc = crc32(0, summary, sizeof(struct jffs2_raw_summary)-8);
604 if (je32_to_cpu(summary->node_crc) != crc) {
609 crc = crc32(0, summary->sum, sumsize - sizeof(struct jffs2_raw_summary));
611 if (je32_to_cpu(summary->sum_crc) != crc) {
616 if ( je32_to_cpu(summary->cln_mkr) ) {
624 if (je32_to_cpu(summary->cln_mkr) != c->cleanmarker_size) {
626 je32_to_cpu(summary->cln_mkr), c->cleanmarker_size);
627 if ((ret = jffs2_scan_dirty_space(c, jeb, PAD(je32_to_cpu(summary->cln_mkr)))))
632 if ((ret = jffs2_scan_dirty_space(c, jeb, PAD(je32_to_cpu(summary->cln_mkr)))))
636 je32_to_cpu(summary->cln_mkr), NULL);
640 ret = jffs2_sum_process_sum_data(c, jeb, summary, pseudo_random);
656 JFFS2_WARNING("Free size 0x%x bytes in eraseblock @0x%08x with summary?\n",
667 JFFS2_WARNING("Summary node crc error, skipping summary information.\n");
672 /* Write summary data to flash - helper function for jffs2_sum_write_sumnode() */
687 /* It won't fit in the buffer. Abort summary for this jeb */
688 jffs2_sum_disable_collecting(c->summary);
695 /* Is there enough space for summary? */
697 /* don't try to write out summary for this jeb */
698 jffs2_sum_disable_collecting(c->summary);
700 JFFS2_WARNING("Not enough space for summary, padsize = %d\n",
706 memset(c->summary->sum_buf, 0xff, datasize);
713 isum.padded = cpu_to_je32(c->summary->sum_padded);
715 isum.sum_num = cpu_to_je32(c->summary->sum_num);
716 wpage = c->summary->sum_buf;
718 while (c->summary->sum_num) {
719 temp = c->summary->sum_list_head;
759 temp = c->summary->sum_list_head;
772 temp = c->summary->sum_list_head;
785 jffs2_sum_disable_collecting(c->summary);
789 BUG(); /* unknown node in summary information */
794 c->summary->sum_list_head = temp->u.next;
797 c->summary->sum_num--;
801 jffs2_sum_reset_collected(c->summary);
809 isum.sum_crc = cpu_to_je32(crc32(0, c->summary->sum_buf, datasize));
814 vecs[1].iov_base = c->summary->sum_buf;
835 c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;
847 /* Write out summary information - called from jffs2_do_reserve_space */
863 if (!c->summary->sum_num || !c->summary->sum_list_head) {
864 JFFS2_WARNING("Empty summary info!!!\n");
868 datasize = c->summary->sum_size + sizeof(struct jffs2_sum_marker);