+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
#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)
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));
{
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)
cache = CACHE (depth);
else
{
- cache = read_tree_node (INFO->blocks[depth], --depth);
+ cache = read_tree_node (INFO->blocks[depth], depth);
if (! cache)
return 0;
}
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;
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)
{
/* 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;