JFFS2_DBG_SUMMARY("JFFS2: writing out data to flash to pos : 0x%08x\n", 
dbg_summary("JFFS2: writing out data to flash to pos : 0x%08x\n", 
static int jffs2_sum_write_data(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,					uint32_t infosize, uint32_t datasize, int padsize){	struct jffs2_summary_node isum;	union jffs2_sum_mem *temp;	struct jffs2_sum_marker *sm;	struct kvec vecs[2];	void *wpage;	int ret;	size_t retlen;	memset(c->summary->sum_buf, 0xff, datasize);	memset(&isum, 0, sizeof(isum));	isum.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);	isum.nodetype = cpu_to_je16(JFFS2_NODETYPE_SUMMARY);	isum.totlen = cpu_to_je32(infosize);	isum.hdr_crc = cpu_to_je32(crc32(0, &isum, sizeof(struct jffs2_unknown_node) - 4));	isum.padded = cpu_to_je32(c->summary->sum_padded);	isum.cln_mkr = cpu_to_je32(c->cleanmarker_size);	isum.sum_num = cpu_to_je32(c->summary->sum_num);	wpage = c->summary->sum_buf;	while (c->summary->sum_num) {		switch (je16_to_cpu(c->summary->sum_list_head->u.nodetype)) {			case JFFS2_NODETYPE_INODE: {				struct jffs2_sum_inode_flash *sino_ptr = wpage;				sino_ptr->nodetype = c->summary->sum_list_head->i.nodetype;				sino_ptr->inode = c->summary->sum_list_head->i.inode;				sino_ptr->version = c->summary->sum_list_head->i.version;				sino_ptr->offset = c->summary->sum_list_head->i.offset;				sino_ptr->totlen = c->summary->sum_list_head->i.totlen;				wpage += JFFS2_SUMMARY_INODE_SIZE;				break;			}			case JFFS2_NODETYPE_DIRENT: {				struct jffs2_sum_dirent_flash *sdrnt_ptr = wpage;				sdrnt_ptr->nodetype = c->summary->sum_list_head->d.nodetype;				sdrnt_ptr->totlen = c->summary->sum_list_head->d.totlen;				sdrnt_ptr->offset = c->summary->sum_list_head->d.offset;				sdrnt_ptr->pino = c->summary->sum_list_head->d.pino;				sdrnt_ptr->version = c->summary->sum_list_head->d.version;				sdrnt_ptr->ino = c->summary->sum_list_head->d.ino;				sdrnt_ptr->nsize = c->summary->sum_list_head->d.nsize;				sdrnt_ptr->type = c->summary->sum_list_head->d.type;				memcpy(sdrnt_ptr->name, c->summary->sum_list_head->d.name, 							c->summary->sum_list_head->d.nsize);				wpage += JFFS2_SUMMARY_DIRENT_SIZE(c->summary->sum_list_head->d.nsize);				break;			}			default : {				BUG();	/* unknown node in summary information */			}		}		temp = c->summary->sum_list_head;		c->summary->sum_list_head = c->summary->sum_list_head->u.next;		kfree(temp);		c->summary->sum_num--;	}	jffs2_sum_reset_collected(c->summary);	wpage += padsize;	sm = wpage;	sm->offset = cpu_to_je32(c->sector_size - jeb->free_size);	sm->magic = cpu_to_je32(JFFS2_SUM_MAGIC);	isum.sum_crc = cpu_to_je32(crc32(0, c->summary->sum_buf, datasize));	isum.node_crc = cpu_to_je32(crc32(0, &isum, sizeof(isum) - 8));	vecs[0].iov_base = &isum;	vecs[0].iov_len = sizeof(isum);	vecs[1].iov_base = c->summary->sum_buf;	vecs[1].iov_len = datasize;	JFFS2_DBG_SUMMARY("JFFS2: writing out data to flash to pos : 0x%08x\n",			jeb->offset + c->sector_size - jeb->free_size);	spin_unlock(&c->erase_completion_lock);	ret = jffs2_flash_writev(c, vecs, 2, jeb->offset + c->sector_size -				jeb->free_size, &retlen, 0);	spin_lock(&c->erase_completion_lock);	if (ret || (retlen != infosize)) {		JFFS2_WARNING("Write of %zd bytes at 0x%08x failed. returned %d, retlen %zd\n",			infosize, jeb->offset + c->sector_size - jeb->free_size, ret, retlen);		c->summary->sum_size = JFFS2_SUMMARY_NOSUM_SIZE;		WASTED_SPACE(infosize);		return 1;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/733802d974e5af42acb7cd61b16c0ce6dd03b7ed/summary.c/buggy/fs/jffs2/summary.c