diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2015-08-15 17:16:03 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2015-08-15 17:16:03 +0000 |
commit | b1bd85c40eb5d22253fcc09c441abb50308ecd40 (patch) | |
tree | b780ccb906996723106a614a5913c94611857fb4 /target/linux/generic/files/fs/yaffs2/yaffs_guts.c | |
parent | 1c66ebcd2db1e85590b11e0abc750eef25363328 (diff) | |
download | mtk-20170518-b1bd85c40eb5d22253fcc09c441abb50308ecd40.zip mtk-20170518-b1bd85c40eb5d22253fcc09c441abb50308ecd40.tar.gz mtk-20170518-b1bd85c40eb5d22253fcc09c441abb50308ecd40.tar.bz2 |
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 <hauke@hauke-m.de>
SVN-Revision: 46609
Diffstat (limited to 'target/linux/generic/files/fs/yaffs2/yaffs_guts.c')
-rw-r--r-- | target/linux/generic/files/fs/yaffs2/yaffs_guts.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/target/linux/generic/files/fs/yaffs2/yaffs_guts.c b/target/linux/generic/files/fs/yaffs2/yaffs_guts.c index 1c0ae71..89fb2a9 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; |