JFFS2_DBG_READINODE("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n", 
dbg_readinode("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n", 
static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info *tn){	struct jffs2_raw_node_ref *ref = tn->fn->raw;	int err = 0, pointed = 0;	struct jffs2_eraseblock *jeb;	unsigned char *buffer;	uint32_t crc, ofs, retlen, len;	BUG_ON(tn->csize == 0);	/* Calculate how many bytes were already checked */	ofs = ref_offset(ref) + sizeof(struct jffs2_raw_inode);	len = ofs & (c->wbuf_pagesize - 1);	if (likely(len))		len = c->wbuf_pagesize - len;	if (len >= tn->csize) {		JFFS2_DBG_READINODE("no need to check node at %#08x, data length %u, data starts at %#08x - it has already been checked.\n",			ref_offset(ref), tn->csize, ofs);		goto adj_acc;	}		ofs += len;	len = tn->csize - len;		JFFS2_DBG_READINODE("check node at %#08x, data length %u, partial CRC %#08x, correct CRC %#08x, data starts at %#08x, start checking from %#08x - %u bytes.\n",		ref_offset(ref), tn->csize, tn->partial_crc, tn->data_crc, ofs - len, ofs, len);	#ifndef __ECOS	/* TODO: instead, incapsulate point() stuff to jffs2_flash_read(),	 * adding and jffs2_flash_read_end() interface. */	if (c->mtd->point) {		err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);		if (!err && retlen < tn->csize) {			JFFS2_WARNING("MTD point returned len too short: %u instead of %u.\n", retlen, tn->csize);			c->mtd->unpoint(c->mtd, buffer, ofs, len);		} else if (err)			JFFS2_WARNING("MTD point failed: error code %d.\n", err);		else			pointed = 1; /* succefully pointed to device */	}#endif		if (!pointed) {		buffer = kmalloc(len, GFP_KERNEL);		if (unlikely(!buffer))			return -ENOMEM;					/* TODO: this is very frequent pattern, make it a separate		 * routine */		err = jffs2_flash_read(c, ofs, len, &retlen, buffer);		if (err) {			JFFS2_ERROR("can not read %d bytes from 0x%08x, error code: %d.\n", len, ofs, err);			goto free_out;		}					if (retlen != len) {			JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ofs, retlen, len);			err = -EIO;			goto free_out;		}	}	/* Continue calculating CRC */	crc = crc32(tn->partial_crc, buffer, len);	if(!pointed)		kfree(buffer);#ifndef __ECOS	else		c->mtd->unpoint(c->mtd, buffer, ofs, len);#endif	if (crc != tn->data_crc) {		JFFS2_NOTICE("wrong data CRC in data node at 0x%08x: read %#08x, calculated %#08x.\n",			ofs, tn->data_crc, crc);		return 1;	}adj_acc:	jeb = &c->blocks[ref->flash_offset / c->sector_size];	len = ref_totlen(c, jeb, ref);	/* 	 * Mark the node as having been checked and fix the	 * accounting accordingly.	 */	spin_lock(&c->erase_completion_lock);	jeb->used_size += len;	jeb->unchecked_size -= len;	c->used_size += len;	c->unchecked_size -= len;	spin_unlock(&c->erase_completion_lock);	return 0;free_out:	if(!pointed)		kfree(buffer);#ifndef __ECOS	else		c->mtd->unpoint(c->mtd, buffer, ofs, len);#endif	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/733802d974e5af42acb7cd61b16c0ce6dd03b7ed/nodelist.c/clean/fs/jffs2/nodelist.c