release/src/linux/linux/fs/jffs/intrep.c
/* Insert a file into the file system tree.  */
Insert a file into the file system tree.
Insert a file into the file system tree .
int
jffs_insert_file_into_tree(struct jffs_file *f)
{
	struct jffs_file *parent;
	D3(printk("jffs_insert_file_into_tree(): name: \"%s\"\n",
		  (f->name ? f->name : "")));
	if (!(parent = jffs_find_file(f->c, f->pino))) {
		if (f->pino == 0) {
			f->c->root = f;
			f->parent = 0;
			f->sibling_prev = 0;
			f->sibling_next = 0;
			return 0;
		}
		else {
			D1(printk("jffs_insert_file_into_tree(): Found "
				  "inode with no parent and pino == %u\n",
				  f->pino));
			return -1;
		}
	}
	f->parent = parent;
	f->sibling_next = parent->children;
	if (f->sibling_next) {
		f->sibling_next->sibling_prev = f;
	}
	f->sibling_prev = 0;
	parent->children = f;
	return 0;
}
int jffs_insert_file_into_tree ( struct jffs_file * f ) { struct jffs_file * parent ; D3 ( printk ( " \" \" \n " , ( f -> name ? f -> name : " " ) ) ) ; if ( ! ( parent = jffs_find_file ( f -> c , f -> pino ) ) ) { if ( f -> pino == 0 ) { f -> c -> root = f ; f -> parent = 0 ; f -> sibling_prev = 0 ; f -> sibling_next = 0 ; return 0 ; } else { D1 ( printk ( " " " \n " , f -> pino ) ) ; return -1 ; } } f -> parent = parent ; f -> sibling_next = parent -> children ; if ( f -> sibling_next ) { f -> sibling_next -> sibling_prev = f ; } f -> sibling_prev = 0 ; parent -> children = f ; return 0 ; }
Insert a file into the file system tree.
Insert a file into the file system tree .