X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.c;h=4e679bf2cf97efabcfcc6eddfaa81c36c748238c;hp=1c0ae71320a52fc5645e09fd76e5203c348ab8c7;hb=6076b3bffffb8c1b26b41674cd9e6c5b7eeb1293;hpb=319d4f76f0e10d1d6427120221237950e373d74b diff --git a/yaffs_guts.c b/yaffs_guts.c index 1c0ae71..4e679bf 100644 --- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -1922,21 +1922,18 @@ static int yaffs_new_obj_id(struct yaffs_dev *dev) struct list_head *i; u32 n = (u32) bucket; - /* Now find an object value that has not already been taken - * by scanning the list. + /* + * Now find an object value that has not already been taken + * by scanning the list, incrementing each time by number of buckets. */ - while (!found) { found = 1; n += YAFFS_NOBJECT_BUCKETS; - if (1 || dev->obj_bucket[bucket].count > 0) { - list_for_each(i, &dev->obj_bucket[bucket].list) { - /* If there is already one in the list */ - if (i && list_entry(i, struct yaffs_obj, - hash_link)->obj_id == n) { - found = 0; - } - } + list_for_each(i, &dev->obj_bucket[bucket].list) { + /* Check if this value is already taken. */ + if (i && list_entry(i, struct yaffs_obj, + hash_link)->obj_id == n) + found = 0; } } return n; @@ -4083,7 +4080,7 @@ static int yaffs_unlink_worker(struct yaffs_obj *obj) } } -static int yaffs_unlink_obj(struct yaffs_obj *obj) +int yaffs_unlink_obj(struct yaffs_obj *obj) { if (obj && obj->unlink_allowed) return yaffs_unlink_worker(obj); @@ -5022,8 +5019,15 @@ void yaffs_deinitialise(struct yaffs_dev *dev) kfree(dev->gc_cleanup_list); - for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) + for (i = 0; i < YAFFS_N_TEMP_BUFFERS; i++) { kfree(dev->temp_buffer[i].buffer); + dev->temp_buffer[i].buffer = NULL; + } + + kfree(dev->checkpt_buffer); + dev->checkpt_buffer = NULL; + kfree(dev->checkpt_block_list); + dev->checkpt_block_list = NULL; dev->is_mounted = 0;