Commit 6edb9793 authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: kill debugging buffer

This patch kills the 'ubi->dbg_peb_buf' debugging buffer and the
associated mutex, because all users of this buffer are now gone.
We are killing this buffer because we are going to switch to
dynamic debugging control, just like in UBIFS, which means that
CONFIG_MTD_UBI_DEBUG_PARANOID will be removed. In this case we'd
end up always allocating 'ubi->dbg_peb_buf', which is rather large
(128KiB or more), and this would be wasteful. Thus, we are just
killing it.
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 332873d6
...@@ -939,13 +939,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) ...@@ -939,13 +939,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
if (!ubi->peb_buf2) if (!ubi->peb_buf2)
goto out_free; goto out_free;
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
mutex_init(&ubi->dbg_buf_mutex);
ubi->dbg_peb_buf = vmalloc(ubi->peb_size);
if (!ubi->dbg_peb_buf)
goto out_free;
#endif
err = attach_by_scanning(ubi); err = attach_by_scanning(ubi);
if (err) { if (err) {
dbg_err("failed to attach by scanning, error %d", err); dbg_err("failed to attach by scanning, error %d", err);
...@@ -1011,9 +1004,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset) ...@@ -1011,9 +1004,6 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
out_free: out_free:
vfree(ubi->peb_buf1); vfree(ubi->peb_buf1);
vfree(ubi->peb_buf2); vfree(ubi->peb_buf2);
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
vfree(ubi->dbg_peb_buf);
#endif
if (ref) if (ref)
put_device(&ubi->dev); put_device(&ubi->dev);
else else
...@@ -1084,9 +1074,6 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway) ...@@ -1084,9 +1074,6 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
put_mtd_device(ubi->mtd); put_mtd_device(ubi->mtd);
vfree(ubi->peb_buf1); vfree(ubi->peb_buf1);
vfree(ubi->peb_buf2); vfree(ubi->peb_buf2);
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
vfree(ubi->dbg_peb_buf);
#endif
ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num);
put_device(&ubi->dev); put_device(&ubi->dev);
return 0; return 0;
......
...@@ -388,8 +388,6 @@ struct ubi_wl_entry; ...@@ -388,8 +388,6 @@ struct ubi_wl_entry;
* @peb_buf2: another buffer of PEB size used for different purposes * @peb_buf2: another buffer of PEB size used for different purposes
* @buf_mutex: protects @peb_buf1 and @peb_buf2 * @buf_mutex: protects @peb_buf1 and @peb_buf2
* @ckvol_mutex: serializes static volume checking when opening * @ckvol_mutex: serializes static volume checking when opening
* @dbg_peb_buf: buffer of PEB size used for debugging
* @dbg_buf_mutex: protects @dbg_peb_buf
*/ */
struct ubi_device { struct ubi_device {
struct cdev cdev; struct cdev cdev;
...@@ -471,10 +469,6 @@ struct ubi_device { ...@@ -471,10 +469,6 @@ struct ubi_device {
void *peb_buf2; void *peb_buf2;
struct mutex buf_mutex; struct mutex buf_mutex;
struct mutex ckvol_mutex; struct mutex ckvol_mutex;
#ifdef CONFIG_MTD_UBI_DEBUG_PARANOID
void *dbg_peb_buf;
struct mutex dbg_buf_mutex;
#endif
}; };
extern struct kmem_cache *ubi_wl_entry_slab; extern struct kmem_cache *ubi_wl_entry_slab;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment