UBI: add volume id struct ubi_ainf_peb
authorJoel Reardon <joel@clambassador.com>
Wed, 16 May 2012 12:20:56 +0000 (14:20 +0200)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Mon, 21 May 2012 08:34:41 +0000 (11:34 +0300)
commit6dd3bc7e6032ffb392477fadca77172c1c9e346b
tree7578223021e61398f46f84c5f4fb42300ce44d10
parent5cc09420e2bcd75d6a8f701c60a179ebb564cb3c
UBI: add volume id struct ubi_ainf_peb

This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at
startup. PEBs now added to the erase queue will know their original LEB number
and volume id, if available, and will be -1 otherwise (for instance, if the VID
header is unreadable).

This was tested by creating an ubi device with 3 volumes and disabiling the
ubi_thread's do_work functionality. The different ubi volumes were formatted
to ubifs and had files created and erased.  The ubi modules was reloaded and
the list of LEB's added to the erased list was outputted, confirming the
volume ids and LEB numbers were appropriate.

Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/ubi/attach.c
drivers/mtd/ubi/ubi.h