X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.c;h=4621dfa2117b33fc78abb105c389246074551b9c;hp=ba7fc845812a62e73abc6348a6e7661e1180316b;hb=a25e4d92631bbb348f600e7c2edacf5603b11c3e;hpb=223ff79f689aba309ebc3ef856fb46095148d40e diff --git a/yaffs_guts.c b/yaffs_guts.c index ba7fc84..4621dfa 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -163,6 +163,8 @@ u8 *yaffs_get_temp_buffer(struct yaffs_dev * dev) } +/* Frees all the temp_buffer objects in the yaffs_dev instance +*/ void yaffs_release_temp_buffer(struct yaffs_dev *dev, u8 *buffer) { int i; @@ -4541,11 +4543,16 @@ int yaffs_guts_ll_init(struct yaffs_dev *dev) return YAFFS_FAIL; } + if (!yaffs_init_tmp_buffers(dev)) + return YAFFS_FAIL; + if (yaffs_init_nand(dev) != YAFFS_OK) { yaffs_trace(YAFFS_TRACE_ALWAYS, "InitialiseNAND failed"); return YAFFS_FAIL; } + dev->ll_init = 1; + return YAFFS_OK; } @@ -4692,10 +4699,7 @@ int yaffs_guts_initialise(struct yaffs_dev *dev) yaffs_endian_config(dev); - /* Initialise temporary buffers and caches. */ - if (!yaffs_init_tmp_buffers(dev)) - init_failed = 1; - + /* Initialise temporary caches. */ dev->gc_cleanup_list = NULL; if (!init_failed) @@ -4824,6 +4828,7 @@ void yaffs_deinitialise(struct yaffs_dev *dev) kfree(dev->checkpt_block_list); dev->checkpt_block_list = NULL; + dev->ll_init = 0; dev->is_mounted = 0; yaffs_deinit_nand(dev);