Home | History | Annotate | Download | only in ext4_utils

Lines Matching full:block_list

452 static int get_direct_blocks(struct ext4_inode *inode, unsigned long long *block_list,
461 block_list[i] = inode->i_block[i];
475 unsigned long long *block_list, unsigned int *count)
491 block_list[EXT4_NDIR_BLOCKS+i] = indirect_block[i];
501 static int get_block_list_indirect(int fd, struct ext4_inode *inode, unsigned long long *block_list)
505 if (get_direct_blocks(inode, block_list, &count)) {
506 get_indirect_blocks(fd, inode, block_list, &count);
512 static int get_extent_ents(struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
530 block_list[extent->ee_block+j] = fs_block_num+j;
538 static int get_extent_idx(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
562 get_extent_ents(tmp_ext_hdr, block_list); /* leaf node, fill in block_list */
564 get_extent_idx(fd, tmp_ext_hdr, block_list); /* recurse down the tree */
571 static int get_block_list_extents(int fd, struct ext4_inode *inode, unsigned long long *block_list)
583 get_extent_ents((struct ext4_extent_header *)inode->i_block, block_list);
587 get_extent_idx(fd, (struct ext4_extent_header *)inode->i_block, block_list);
622 unsigned long long *block_list;
647 block_list = malloc((num_blocks + 1) * sizeof(*block_list));
648 if (block_list == 0) {
649 critical_error("failed to allocate memory for block_list\n");
653 get_block_list_extents(fd, inode, block_list);
667 get_block_list_indirect(fd, inode, block_list);
672 read_block(fd, block_list[i], dirbuf + (i * info.block_size));
769 write_block(fd, block_list[i], dirbuf + (i * info.block_size));
775 free(block_list);