]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* stage2/fsys_reiserfs.c (read_tree_node): Fixed a typo; only
authorjochen <jochen@localhost>
Tue, 12 Aug 2003 10:20:27 +0000 (10:20 +0000)
committerjochen <jochen@localhost>
Tue, 12 Aug 2003 10:20:27 +0000 (10:20 +0000)
matters for very large fs when tree doesn't fit in cache.
(IH_KEY_OFFSET): Don't check for INFO->version.  There are
actually old version file systems that use new version items.
(IH_KEY_ISTYPE): Likewise.
(reiserfs_dir): Likewise.

ChangeLog
stage2/fsys_reiserfs.c

index a74d87424871d24c9ffe2bf75976c8027bafa02b..46983c6dccdb8f01d06b33305ef4d23cf45fb693 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-06-17  Jochen Hoenicke  <jochen@gnu.org>
+
+       * stage2/fsys_reiserfs.c (read_tree_node): Fixed a typo; only
+       matters for very large fs when tree doesn't fit in cache.
+       (IH_KEY_OFFSET): Don't check for INFO->version.  There are
+       actually old version file systems that use new version items.
+       (IH_KEY_ISTYPE): Likewise.
+       (reiserfs_dir): Likewise.
+
 2003-08-09  Thierry Laronde  <tlaronde@polynum.org>
 
        * util/mkbimage: NEW File. `mkbimage' depends on GRUB and existed
index ed9d68f172fe03aae66ea9a4d7c84fa2a39ea09f..28de44bd86d69c861610014f3edd18ac338b4b99 100644 (file)
@@ -213,13 +213,11 @@ struct item_head
 
 #define ITEM_VERSION_1 0
 #define ITEM_VERSION_2 1
-#define IH_KEY_OFFSET(ih) (INFO->version < 2 \
-                          || (ih)->ih_version == ITEM_VERSION_1 \
+#define IH_KEY_OFFSET(ih) ((ih)->ih_version == ITEM_VERSION_1 \
                           ? (ih)->ih_key.u.v1.k_offset \
                           : (ih)->ih_key.u.v2.k_offset)
 
-#define IH_KEY_ISTYPE(ih, type) (INFO->version < 2 \
-                                || (ih)->ih_version == ITEM_VERSION_1 \
+#define IH_KEY_ISTYPE(ih, type) ((ih)->ih_version == ITEM_VERSION_1 \
                                 ? (ih)->ih_key.u.v1.k_uniqueness == V1_##type \
                                 : (ih)->ih_key.u.v2.k_type == V2_##type)
 
@@ -613,6 +611,11 @@ reiserfs_mount (void)
   INFO->cached_slots = 
     (FSYSREISER_CACHE_SIZE >> INFO->fullblocksize_shift) - 1;
 
+#ifdef REISERDEBUG
+  printf ("reiserfs_mount: version=%d, blocksize=%d\n", 
+         INFO->version, INFO->blocksize);
+#endif /* REISERDEBUG */
+
   /* Clear node cache. */
   memset (INFO->blocks, 0, sizeof (INFO->blocks));
 
@@ -738,7 +741,8 @@ next_key (void)
     {
       depth = DISK_LEAF_NODE_LEVEL;
       /* The last item, was the last in the leaf node.  
-       * Read in the next block */
+       * Read in the next block 
+       */
       do
        {
          if (depth == INFO->tree_depth)
@@ -761,7 +765,7 @@ next_key (void)
        cache = CACHE (depth);
       else 
        {
-         cache = read_tree_node (INFO->blocks[depth], --depth);
+         cache = read_tree_node (INFO->blocks[depth], depth);
          if (! cache)
            return 0;
        }
@@ -911,6 +915,10 @@ reiserfs_read (char *buf, int len)
       if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_DIRECT)
          && offset < blocksize)
        {
+#ifdef REISERDEBUG
+         printf ("direct_read: offset=%d, blocksize=%d\n",
+                 offset, blocksize);
+#endif /* REISERDEBUG */
          to_read = blocksize - offset;
          if (to_read > len)
            to_read = len;
@@ -931,6 +939,10 @@ reiserfs_read (char *buf, int len)
       else if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_INDIRECT))
        {
          blocksize = (blocksize >> 2) << INFO->fullblocksize_shift;
+#ifdef REISERDEBUG
+         printf ("indirect_read: offset=%d, blocksize=%d\n",
+                 offset, blocksize);
+#endif /* REISERDEBUG */
          
          while (offset < blocksize)
            {
@@ -1087,8 +1099,7 @@ reiserfs_dir (char *dirname)
          /* If this is a new stat data and size is > 4GB set filemax to 
           * maximum
           */
-         if (INFO->version >= 2
-             && INFO->current_ih->ih_version == ITEM_VERSION_2
+         if (INFO->current_ih->ih_version == ITEM_VERSION_2
              && ((struct stat_data *) INFO->current_item)->sd_size_hi > 0)
            filemax = 0xffffffff;