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;
}
}
-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);
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;