kernels/linux-2.4.0/fs/jffs/intrep.c
/* Clean up all data structures associated with the file system.  */
Clean up all data structures associated with the file system.
Clean up all data structures associated with the file system .
void
jffs_cleanup_control(struct jffs_control *c)
{
	D2(printk("jffs_cleanup_control()\n"));
	if (!c) {
		D(printk("jffs_cleanup_control(): c == NULL !!!\n"));
		return;
	}
	while (c->delete_list) {
		struct jffs_delete_list *delete_list_element;
		delete_list_element = c->delete_list;
		c->delete_list = c->delete_list->next;
		kfree(delete_list_element);
	}
	if (c->hash) {
		jffs_foreach_file(c, jffs_free_node_list);
		jffs_foreach_file(c, jffs_free_file);
		kfree(c->hash);
		DJM(no_hash--);
	}
	jffs_cleanup_fmcontrol(c->fmc);
	kfree(c);
	DJM(no_jffs_control--);
	D3(printk("jffs_cleanup_control(): Leaving...\n"));
}
void jffs_cleanup_control ( struct jffs_control * c ) { D2 ( printk ( " \n " ) ) ; if ( ! c ) { D ( printk ( " \n " ) ) ; return ; } while ( c -> delete_list ) { struct jffs_delete_list * delete_list_element ; delete_list_element = c -> delete_list ; c -> delete_list = c -> delete_list -> next ; kfree ( delete_list_element ) ; } if ( c -> hash ) { jffs_foreach_file ( c , jffs_free_node_list ) ; jffs_foreach_file ( c , jffs_free_file ) ; kfree ( c -> hash ) ; DJM ( no_hash -- ) ; } jffs_cleanup_fmcontrol ( c -> fmc ) ; kfree ( c ) ; DJM ( no_jffs_control -- ) ; D3 ( printk ( " \n " ) ) ; }
Clean up all data structures associated with the file system.
Clean up all data structures associated with the file system .
/* Free all files and nodes.  */