Skip to content

Commit f43ec88

Browse files
Artem BityutskiyArtem Bityutskiy
authored andcommitted
UBI: provide LEB offset information
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>
1 parent 30b542e commit f43ec88

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/mtd/ubi/kapi.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di)
4040
{
4141
di->ubi_num = ubi->ubi_num;
4242
di->leb_size = ubi->leb_size;
43+
di->leb_start = ubi->leb_start;
4344
di->min_io_size = ubi->min_io_size;
4445
di->max_write_size = ubi->max_write_size;
4546
di->ro_mode = ubi->ro_mode;

‎include/linux/mtd/ubi.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ struct ubi_volume_info {
116116
* struct ubi_device_info - UBI device description data structure.
117117
* @ubi_num: ubi device number
118118
* @leb_size: logical eraseblock size on this UBI device
119+
* @leb_start: starting offset of logical eraseblocks within physical
120+
* eraseblocks
119121
* @min_io_size: minimal I/O unit size
120122
* @max_write_size: maximum amount of bytes the underlying flash can write at a
121123
* time (MTD write buffer size)
@@ -145,6 +147,7 @@ struct ubi_volume_info {
145147
struct ubi_device_info {
146148
int ubi_num;
147149
int leb_size;
150+
int leb_start;
148151
int min_io_size;
149152
int max_write_size;
150153
int ro_mode;

0 commit comments

Comments
 (0)