Lines Matching refs:INFO

345 #define CACHE(i) (ROOT + ((i) << INFO->fullblocksize_shift))
355 #define INFO \
365 #define JOURNAL_START ((__u32 *) (INFO + 1))
388 return devread ((INFO->journal_block + block) << INFO->blocksize_shift,
399 int transactions = INFO->journal_transactions;
400 int desc_block = INFO->journal_first_desc;
401 int journal_mask = INFO->journal_block_count - 1;
451 translatedNr = INFO->journal_block + ((desc_block + i) & journal_mask);
454 blockNr, translatedNr - INFO->journal_block);
462 return devread (translatedNr << INFO->blocksize_shift, start, len, buffer);
470 * first valid transaction are held in INFO. The transactions are all
476 unsigned int block_count = INFO->journal_block_count;
490 INFO->journal_first_desc = desc_block;
563 INFO->journal_transactions
611 INFO->version = super.s_version;
612 INFO->blocksize = super.s_blocksize;
613 INFO->fullblocksize_shift = log2 (super.s_blocksize);
614 INFO->blocksize_shift = INFO->fullblocksize_shift - SECTOR_BITS;
615 INFO->cached_slots =
616 (FSYSREISER_CACHE_SIZE >> INFO->fullblocksize_shift) - 1;
620 INFO->version, INFO->blocksize);
624 memset (INFO->blocks, 0, sizeof (INFO->blocks));
628 || (SECTOR_SIZE << INFO->blocksize_shift) != super.s_blocksize)
634 INFO->journal_transactions = 0;
637 INFO->journal_block = super.s_journal_block;
638 INFO->journal_block_count = super.s_journal_size;
639 if (is_power_of_two (INFO->journal_block_count))
643 block_read (superblock >> INFO->blocksize_shift,
647 if (! block_read (super.s_root_block, 0, INFO->blocksize, (char*) ROOT))
650 INFO->tree_depth = BLOCKHEAD (ROOT)->blk_level;
654 super.s_root_block, INFO->tree_depth);
657 if (INFO->tree_depth >= MAX_HEIGHT)
659 if (INFO->tree_depth == DISK_LEAF_NODE_LEVEL)
663 memcpy (LEAF, ROOT, INFO->blocksize);
690 * You must set INFO->blocks[depth] before.
696 int num_cached = INFO->cached_slots;
702 if (blockNr == INFO->blocks[depth])
712 if (! block_read (blockNr, 0, INFO->blocksize, cache))
721 INFO->blocks[depth] = blockNr;
726 * tree order. INFO->current_ih and
727 * INFO->current_info are adapted accordingly. */
732 struct item_head *ih = INFO->current_ih + 1;
737 INFO->current_ih->ih_key.k_dir_id,
738 INFO->current_ih->ih_key.k_objectid,
739 INFO->current_ih->ih_key.u.v1.k_offset,
740 INFO->current_ih->ih_key.u.v1.k_uniqueness,
741 INFO->current_ih->ih_version);
752 if (depth == INFO->tree_depth)
761 printf (" depth=%d, i=%d\n", depth, INFO->next_key_nr[depth]);
764 while (INFO->next_key_nr[depth] == 0);
766 if (depth == INFO->tree_depth)
768 else if (depth <= INFO->cached_slots)
772 cache = read_tree_node (INFO->blocks[depth], depth);
780 int key_nr = INFO->next_key_nr[depth]++;
786 INFO->next_key_nr[depth] = 0;
797 INFO->current_ih = ih;
798 INFO->current_item = &LEAF[ih->ih_item_location];
801 INFO->current_ih->ih_key.k_dir_id,
802 INFO->current_ih->ih_key.k_objectid,
803 INFO->current_ih->ih_key.u.v1.k_offset,
804 INFO->current_ih->ih_key.u.v1.k_uniqueness,
805 INFO->current_ih->ih_version);
811 * INFO block is valid
816 * searched key. INFO->next_key contains the next key after
832 depth = INFO->tree_depth;
857 INFO->next_key_nr[depth] = (i == nr_item) ? 0 : i+1;
876 INFO->current_ih = ih;
877 INFO->current_item = &LEAF[ih->ih_item_location];
896 filepos, len, (__u64) IH_KEY_OFFSET (INFO->current_ih) - 1);
899 if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid
900 || IH_KEY_OFFSET (INFO->current_ih) > filepos + 1)
902 search_stat (INFO->fileinfo.k_dir_id, INFO->fileinfo.k_objectid);
908 if (INFO->current_ih->ih_key.k_objectid != INFO->fileinfo.k_objectid)
911 offset = filepos - IH_KEY_OFFSET (INFO->current_ih) + 1;
912 blocksize = INFO->current_ih->ih_item_len;
919 if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_DIRECT)
934 block_read (INFO->blocks[DISK_LEAF_NODE_LEVEL],
935 (INFO->current_item - LEAF + offset), to_read, buf);
940 memcpy (buf, INFO->current_item + offset, to_read);
943 else if (IH_KEY_ISTYPE(INFO->current_ih, TYPE_INDIRECT))
945 blocksize = (blocksize >> 2) << INFO->fullblocksize_shift;
953 __u32 blocknr = ((__u32 *) INFO->current_item)
954 [offset >> INFO->fullblocksize_shift];
955 int blk_offset = offset & (INFO->blocksize-1);
957 to_read = INFO->blocksize - blk_offset;
966 devread (blocknr << INFO->blocksize_shift,
988 * INFO block is valid
990 * postconditions: on a nonzero return, INFO->fileinfo contains the info
1022 ((struct stat_data *) INFO->current_item)->sd_mode,
1023 ((struct stat_data *) INFO->current_item)->sd_size);
1026 mode = ((struct stat_data *) INFO->current_item)->sd_mode;
1039 filemax = ((struct stat_data *) INFO->current_item)->sd_size;
1056 INFO->fileinfo.k_dir_id = dir_id;
1057 INFO->fileinfo.k_objectid = objectid;
1101 filemax = ((struct stat_data *) INFO->current_item)->sd_size;
1106 if (INFO->current_ih->ih_version == ITEM_VERSION_2
1107 && ((struct stat_data *) INFO->current_item)->sd_size_hi > 0)
1110 INFO->fileinfo.k_dir_id = dir_id;
1111 INFO->fileinfo.k_objectid = objectid;
1140 INFO->current_ih->ih_key.k_dir_id,
1141 INFO->current_ih->ih_key.k_objectid,
1142 INFO->current_ih->ih_key.u.v1.k_offset,
1143 INFO->current_ih->ih_key.u.v1.k_uniqueness,
1144 INFO->current_ih->ih_version);
1147 if (INFO->current_ih->ih_key.k_objectid != objectid)
1150 name_end = INFO->current_item + INFO->current_ih->ih_item_len;
1151 de_head = (struct reiserfs_de_head *) INFO->current_item;
1152 num_entries = INFO->current_ih->u.ih_entry_count;
1155 char *filename = INFO->current_item + de_head->deh_location;