c->flags &= ~JFFS2_SB_FLAG_MOUNTING; 
static int jffs2_build_filesystem(struct jffs2_sb_info *c){	int ret;	int i;	struct jffs2_inode_cache *ic;	struct jffs2_full_dirent *fd;	struct jffs2_full_dirent *dead_fds = NULL;	/* First, scan the medium and build all the inode caches with	   lists of physical nodes */	c->flags |= JFFS2_SB_FLAG_MOUNTING;	ret = jffs2_scan_medium(c);	if (ret)		goto exit;	D1(printk(KERN_DEBUG "Scanned flash completely\n"));	D2(jffs2_dump_block_lists(c));	/* Now scan the directory tree, increasing nlink according to every dirent found. */	for_each_inode(i, c, ic) {		D1(printk(KERN_DEBUG "Pass 1: ino #%u\n", ic->ino));		D1(BUG_ON(ic->ino > c->highest_ino));		if (ic->scan_dents) {			jffs2_build_inode_pass1(c, ic);			cond_resched();		}	}	c->flags &= ~JFFS2_SB_FLAG_MOUNTING;	D1(printk(KERN_DEBUG "Pass 1 complete\n"));	/* Next, scan for inodes with nlink == 0 and remove them. If	   they were directories, then decrement the nlink of their	   children too, and repeat the scan. As that's going to be	   a fairly uncommon occurrence, it's not so evil to do it this	   way. Recursion bad. */	D1(printk(KERN_DEBUG "Pass 2 starting\n"));	for_each_inode(i, c, ic) {		D1(printk(KERN_DEBUG "Pass 2: ino #%u, nlink %d, ic %p, nodes %p\n", ic->ino, ic->nlink, ic, ic->nodes));		if (ic->nlink)			continue;					jffs2_build_remove_unlinked_inode(c, ic, &dead_fds);		cond_resched();	} 	D1(printk(KERN_DEBUG "Pass 2a starting\n"));	while (dead_fds) {		fd = dead_fds;		dead_fds = fd->next;		ic = jffs2_get_ino_cache(c, fd->ino);		D1(printk(KERN_DEBUG "Removing dead_fd ino #%u (\"%s\"), ic at %p\n", fd->ino, fd->name, ic));		if (ic)			jffs2_build_remove_unlinked_inode(c, ic, &dead_fds);		jffs2_free_full_dirent(fd);	}	D1(printk(KERN_DEBUG "Pass 2 complete\n"));		/* Finally, we can scan again and free the dirent structs */	for_each_inode(i, c, ic) {		D1(printk(KERN_DEBUG "Pass 3: ino #%u, ic %p, nodes %p\n", ic->ino, ic, ic->nodes));		while(ic->scan_dents) {			fd = ic->scan_dents;			ic->scan_dents = fd->next;			jffs2_free_full_dirent(fd);		}		ic->scan_dents = NULL;		cond_resched();	}	D1(printk(KERN_DEBUG "Pass 3 complete\n"));	D2(jffs2_dump_block_lists(c));	/* Rotate the lists by some number to ensure wear levelling */	jffs2_rotate_lists(c);	ret = 0;exit:	if (ret) {		for_each_inode(i, c, ic) {			while(ic->scan_dents) {				fd = ic->scan_dents;				ic->scan_dents = fd->next;				jffs2_free_full_dirent(fd);			}		}	}	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/31fbdf7aa5aac8a2a34f180a25deb157297a10c9/build.c/clean/fs/jffs2/build.c