mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-25 18:55:24 +00:00
Port MTD structures to use 64-bit byte offsets instead of sectors.
As per the discussion on issue 221745 we will be using 64-bit byte offsets for the MTD partition table and converting to/from sectors internally in cgpt. Existing interfaces do not change, eg sizes are still reported in sectors, only the on-disk representation is affected. BRANCH=none BUG=chromium:221745 TEST=unit tests pass Change-Id: Id312d42783acfdabe6eb8aea11dcbd298e00a100 Reviewed-on: https://gerrit.chromium.org/gerrit/60919 Commit-Queue: Albert Chaulk <achaulk@chromium.org> Reviewed-by: Albert Chaulk <achaulk@chromium.org> Tested-by: Albert Chaulk <achaulk@chromium.org>
This commit is contained in:
@@ -60,8 +60,8 @@ int MtdCreate(struct drive *drive, CgptCreateParams *params) {
|
||||
// Prep basic parameters
|
||||
memcpy(h->signature, MTD_DRIVE_SIGNATURE, sizeof(h->signature));
|
||||
h->size = sizeof(*h);
|
||||
h->first_lba = 0;
|
||||
h->last_lba = drive->mtd.drive_sectors - 1;
|
||||
h->first_offset = 0;
|
||||
h->last_offset = (drive->mtd.drive_sectors * drive->mtd.sector_bytes) - 1;
|
||||
h->crc32 = MtdHeaderCrc(h);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user