]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* include/grub/ntfs.h (grub_ntfs_comp_table_element): New struct.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 15 May 2012 15:09:14 +0000 (17:09 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 15 May 2012 15:09:14 +0000 (17:09 +0200)
(grub_ntfs_comp): Use grub_ntfs_comp_table_element for comp_table.
All users updated.

ChangeLog
grub-core/fs/ntfscomp.c
include/grub/ntfs.h

index 06836636f08226a8871878c15d7d71f8d7f059bb..15a99b9c40d9842f9b1ed723cdc2150cbadfd2f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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,
index 88e3ee58251d6189a83694c2a4fc3d0db959ae07..ec359fa9d3c8a98c26edff1c09da2b99d9505987 100644 (file)
@@ -32,12 +32,12 @@ decomp_nextvcn (struct grub_ntfs_comp *cc)
     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;
@@ -202,8 +202,8 @@ read_block (struct grub_ntfs_rlst *ctx, char *buf, grub_size_t num)
            {
              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))
@@ -247,7 +247,7 @@ read_block (struct grub_ntfs_rlst *ctx, char *buf, grub_size_t num)
              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;
@@ -256,8 +256,8 @@ read_block (struct grub_ntfs_rlst *ctx, char *buf, grub_size_t num)
                {
                  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;
@@ -265,7 +265,7 @@ read_block (struct grub_ntfs_rlst *ctx, char *buf, grub_size_t num)
                }
              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)
index 0ecbce95d9d39a8a8bbf57c73e33c3420a4b9b3b..093534205e8c4c6654be7238aecdf204506609df 100644 (file)
@@ -161,11 +161,17 @@ struct grub_ntfs_data
   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;
 };