summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorJoel Reardon <joel@clambassador.com>2012-05-16 14:20:56 +0200
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-23 13:04:37 +0300
commit03c0b2b2136a4530529c6a98138945ecf682337b (patch)
treeedfb5ee32d3dc7c8fd45c0aea12cf96b0d3be8cf /drivers/mtd/ubi/ubi.h
parentb1fdcbd51bef532d540a86bef305068796b2ae35 (diff)
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>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 52756327827a..b4b3913f1df4 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -483,6 +483,7 @@ struct ubi_device {
* struct ubi_ainf_peb - attach information about a physical eraseblock.
* @ec: erase counter (%UBI_UNKNOWN if it is unknown)
* @pnum: physical eraseblock number
+ * @vol_id: ID of the volume this LEB belongs to
* @lnum: logical eraseblock number
* @scrub: if this physical eraseblock needs scrubbing
* @copy_flag: this LEB is a copy (@copy_flag is set in VID header of this LEB)
@@ -492,11 +493,13 @@ struct ubi_device {
* @u.list: link in one of the eraseblock lists
*
* One object of this type is allocated for each physical eraseblock when
- * attaching an MTD device.
+ * attaching an MTD device. Note, if this PEB does not belong to any LEB /
+ * volume, the @vol_id and @lnum fields are initialized to %UBI_UNKNOWN.
*/
struct ubi_ainf_peb {
int ec;
int pnum;
+ int vol_id;
int lnum;
unsigned int scrub:1;
unsigned int copy_flag:1;