Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca2ec61d authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBI: incorporate LEB offset information



Incorporate the LEB offset information into UBIFS. We'll use this
information in one of the next patches to figure out what are the
max. write size offsets relative to the PEB. So this patch is just
a preparation.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 3e8e2e0c
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -504,6 +504,7 @@ static int init_constants_early(struct ubifs_info *c)


	c->leb_cnt = c->vi.size;
	c->leb_cnt = c->vi.size;
	c->leb_size = c->vi.usable_leb_size;
	c->leb_size = c->vi.usable_leb_size;
	c->leb_start = c->di.leb_start;
	c->half_leb_size = c->leb_size / 2;
	c->half_leb_size = c->leb_size / 2;
	c->min_io_size = c->di.min_io_size;
	c->min_io_size = c->di.min_io_size;
	c->min_io_shift = fls(c->min_io_size) - 1;
	c->min_io_shift = fls(c->min_io_size) - 1;
+3 −0
Original line number Original line Diff line number Diff line
@@ -1028,6 +1028,8 @@ struct ubifs_debug_info;
 *                  time (MTD write buffer size)
 *                  time (MTD write buffer size)
 * @max_write_shift: number of bits in @max_write_size minus one
 * @max_write_shift: number of bits in @max_write_size minus one
 * @leb_size: logical eraseblock size in bytes
 * @leb_size: logical eraseblock size in bytes
 * @leb_start: starting offset of logical eraseblocks within physical
 *             eraseblocks
 * @half_leb_size: half LEB size
 * @half_leb_size: half LEB size
 * @idx_leb_size: how many bytes of an LEB are effectively available when it is
 * @idx_leb_size: how many bytes of an LEB are effectively available when it is
 *                used to store indexing nodes (@leb_size - @max_idx_node_sz)
 *                used to store indexing nodes (@leb_size - @max_idx_node_sz)
@@ -1276,6 +1278,7 @@ struct ubifs_info {
	int max_write_size;
	int max_write_size;
	int max_write_shift;
	int max_write_shift;
	int leb_size;
	int leb_size;
	int leb_start;
	int half_leb_size;
	int half_leb_size;
	int idx_leb_size;
	int idx_leb_size;
	int leb_cnt;
	int leb_cnt;