+2012-05-15 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * include/grub/ntfs.h (grub_ntfs_comp_table_element): New struct.
+ (grub_ntfs_comp): Use grub_ntfs_comp_table_element for comp_table.
+ All users updated.
+
2012-05-14 Vladimir Serbinenko <phcoder@gmail.com>
* Makefile.am (starfield_DATA): Replace dejavu.pf2 with dejavu_10.pf2,
return grub_error (GRUB_ERR_BAD_FS, "compression block overflown");
if (grub_disk_read
(cc->disk,
- (cc->comp_table[cc->comp_head][1] -
- (cc->comp_table[cc->comp_head][0] - cc->cbuf_vcn)) * cc->spc, 0,
+ (cc->comp_table[cc->comp_head].next_lcn -
+ (cc->comp_table[cc->comp_head].next_vcn - cc->cbuf_vcn)) * cc->spc, 0,
cc->spc << GRUB_NTFS_BLK_SHR, cc->cbuf))
return grub_errno;
cc->cbuf_vcn++;
- if ((cc->cbuf_vcn >= cc->comp_table[cc->comp_head][0]))
+ if ((cc->cbuf_vcn >= cc->comp_table[cc->comp_head].next_vcn))
cc->comp_head++;
cc->cbuf_ofs = 0;
return 0;
{
if (ctx->flags & GRUB_NTFS_RF_BLNK)
break;
- ctx->comp.comp_table[ctx->comp.comp_tail][0] = ctx->next_vcn;
- ctx->comp.comp_table[ctx->comp.comp_tail][1] =
+ ctx->comp.comp_table[ctx->comp.comp_tail].next_vcn = ctx->next_vcn;
+ ctx->comp.comp_table[ctx->comp.comp_tail].next_lcn =
ctx->curr_lcn + ctx->next_vcn - ctx->curr_vcn;
ctx->comp.comp_tail++;
if (grub_ntfs_read_run_list (ctx))
grub_disk_addr_t tt;
tt =
- ctx->comp.comp_table[ctx->comp.comp_head][0] -
+ ctx->comp.comp_table[ctx->comp.comp_head].next_vcn -
ctx->target_vcn;
if (tt > nn)
tt = nn;
{
if (grub_disk_read
(ctx->comp.disk,
- (ctx->comp.comp_table[ctx->comp.comp_head][1] -
- (ctx->comp.comp_table[ctx->comp.comp_head][0] -
+ (ctx->comp.comp_table[ctx->comp.comp_head].next_lcn -
+ (ctx->comp.comp_table[ctx->comp.comp_head].next_vcn -
ctx->target_vcn)) * ctx->comp.spc, 0,
tt * (ctx->comp.spc << GRUB_NTFS_BLK_SHR), buf))
return grub_errno;
}
nn -= tt;
if (ctx->target_vcn >=
- ctx->comp.comp_table[ctx->comp.comp_head][0])
+ ctx->comp.comp_table[ctx->comp.comp_head].next_vcn)
ctx->comp.comp_head++;
}
if (nn)
grub_uint64_t uuid;
};
+struct grub_ntfs_comp_table_element
+{
+ grub_uint32_t next_vcn;
+ grub_uint32_t next_lcn;
+};
+
struct grub_ntfs_comp
{
grub_disk_t disk;
int comp_head, comp_tail;
- grub_uint32_t comp_table[16][2];
+ struct grub_ntfs_comp_table_element comp_table[16];
grub_uint32_t cbuf_ofs, cbuf_vcn, spc;
char *cbuf;
};