diff options
author | Michal Soltys <soltys@ziu.info> | 2011-03-08 22:37:15 +0100 |
---|---|---|
committer | Michal Soltys <soltys@ziu.info> | 2011-03-08 22:37:15 +0100 |
commit | b6d27b9550fdf166b7cb185f39db01832a72a066 (patch) | |
tree | a75d450b2d91b436db3bf0ef765c308006fd162c | |
parent | bd4667bdf971bac20bf5cf8837c16301509e5f21 (diff) | |
download | syslinux-b6d27b9550fdf166b7cb185f39db01832a72a066.tar.gz syslinux-b6d27b9550fdf166b7cb185f39db01832a72a066.tar.xz syslinux-b6d27b9550fdf166b7cb185f39db01832a72a066.zip |
com32/chain: add generic length field to partition iterators
Signed-off-by: Michal Soltys <soltys@ziu.info>
-rw-r--r-- | com32/chain/partiter.c | 3 | ||||
-rw-r--r-- | com32/chain/partiter.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/com32/chain/partiter.c b/com32/chain/partiter.c index 05443bb1..1acd1958 100644 --- a/com32/chain/partiter.c +++ b/com32/chain/partiter.c @@ -109,6 +109,7 @@ static int iter_ctor(struct part_iter *iter, va_list *args) memcpy(&iter->di, di, sizeof(struct disk_info)); iter->stepall = stepall; iter->index0 = -1; + iter->length = di->lbacnt; return 0; } @@ -478,6 +479,7 @@ static struct part_iter *pi_dos_next(struct part_iter *iter) iter->index = iter->index0 - iter->sub.dos.skipcnt + 1; iter->rawindex = iter->index0 + 1; iter->start_lba = start_lba; + iter->length = dos_part->length; iter->record = (char *)dos_part; #ifdef DEBUG @@ -533,6 +535,7 @@ static struct part_iter *pi_gpt_next(struct part_iter *iter) iter->index = iter->index0 + 1; iter->rawindex = iter->index0 + 1; iter->start_lba = gpt_part->lba_first; + iter->length = gpt_part->lba_last - gpt_part->lba_first + 1; iter->record = (char *)gpt_part; memcpy(&iter->sub.gpt.part_guid, &gpt_part->uid, sizeof(struct guid)); gpt_conv_label(iter); diff --git a/com32/chain/partiter.h b/com32/chain/partiter.h index 3e4f96c1..7deeb534 100644 --- a/com32/chain/partiter.h +++ b/com32/chain/partiter.h @@ -60,6 +60,7 @@ struct part_iter { char *data; char *record; uint64_t start_lba; + uint64_t length; int index; int rawindex; struct disk_info di; |