From b1bd85c40eb5d22253fcc09c441abb50308ecd40 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 15 Aug 2015 17:16:03 +0000 Subject: kernel: yaffs2: update to version from 2015-06-02 In addition to the update this also fixes compile problems with kernel 4.1. This closes #20323. Signed-off-by: Hauke Mehrtens SVN-Revision: 46609 --- target/linux/generic/files/fs/yaffs2/yaffs_guts.c | 28 +++++++++++++---------- 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'target/linux/generic/files/fs/yaffs2/yaffs_guts.c') diff --git a/target/linux/generic/files/fs/yaffs2/yaffs_guts.c b/target/linux/generic/files/fs/yaffs2/yaffs_guts.c index 1c0ae71320..89fb2a9bba 100644 --- a/target/linux/generic/files/fs/yaffs2/yaffs_guts.c +++ b/target/linux/generic/files/fs/yaffs2/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; @@ -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; -- cgit v1.2.3