UBI: add volume id struct ubi_ainf_peb
authorJoel Reardon <joel@clambassador.com>
Wed, 16 May 2012 12:20:56 +0000 (14:20 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 21 Jun 2012 11:46:23 +0000 (14:46 +0300)
commit7d796dc52842d034808a89ac95f18304257c6145
treef7b1075af299d3ddf227d4ea04f2f52bec06e1fd
parent72d2fa679ee91e776bb6785cf082b3a44bceaa5c
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