]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
UBI: provide LEB offset information
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 14 Feb 2011 11:36:54 +0000 (13:36 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 8 Mar 2011 08:12:48 +0000 (10:12 +0200)
Provide the LEB offset information in the UBI device information data
structure. This piece of information is required by UBIFS to find out
what are the LEB offsets which are aligned to the max. write size.

If LEB offset not aligned to max. write size, then UBIFS has to take
this into account to write more optimally.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
drivers/mtd/ubi/kapi.c
include/linux/mtd/ubi.h

index 701df4f848f66045b4747fc214ea41b2497828c6..d39716e5b204c8fce14e2383dfdc1d43c91d972d 100644 (file)
@@ -40,6 +40,7 @@ void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di)
 {
        di->ubi_num = ubi->ubi_num;
        di->leb_size = ubi->leb_size;
+       di->leb_start = ubi->leb_start;
        di->min_io_size = ubi->min_io_size;
        di->max_write_size = ubi->max_write_size;
        di->ro_mode = ubi->ro_mode;
index 36c70593ae627e6b8bfd3c183c6e16fd5c4a6fef..84854edf4436f2a62ff7bc956101a6953236726e 100644 (file)
@@ -116,6 +116,8 @@ struct ubi_volume_info {
  * struct ubi_device_info - UBI device description data structure.
  * @ubi_num: ubi device number
  * @leb_size: logical eraseblock size on this UBI device
+ * @leb_start: starting offset of logical eraseblocks within physical
+ *             eraseblocks
  * @min_io_size: minimal I/O unit size
  * @max_write_size: maximum amount of bytes the underlying flash can write at a
  *                  time (MTD write buffer size)
@@ -145,6 +147,7 @@ struct ubi_volume_info {
 struct ubi_device_info {
        int ubi_num;
        int leb_size;
+       int leb_start;
        int min_io_size;
        int max_write_size;
        int ro_mode;