Home | History | Annotate | Download | only in ext4_utils

Lines Matching refs:block_list

450 static int get_direct_blocks(struct ext4_inode *inode, unsigned long long *block_list,
459 block_list[i] = inode->i_block[i];
473 unsigned long long *block_list, unsigned int *count)
489 block_list[EXT4_NDIR_BLOCKS+i] = indirect_block[i];
499 static int get_block_list_indirect(int fd, struct ext4_inode *inode, unsigned long long *block_list)
503 if (get_direct_blocks(inode, block_list, &count)) {
504 get_indirect_blocks(fd, inode, block_list, &count);
510 static int get_extent_ents(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
528 block_list[extent->ee_block+j] = fs_block_num+j;
536 static int get_extent_idx(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list)
560 get_extent_ents(fd, tmp_ext_hdr, block_list); /* leaf node, fill in block_list */
562 get_extent_idx(fd, tmp_ext_hdr, block_list); /* recurse down the tree */
569 static int get_block_list_extents(int fd, struct ext4_inode *inode, unsigned long long *block_list)
581 get_extent_ents(fd, (struct ext4_extent_header *)inode->i_block, block_list);
585 get_extent_idx(fd, (struct ext4_extent_header *)inode->i_block, block_list);
620 unsigned long long *block_list;
645 block_list = malloc((num_blocks + 1) * sizeof(*block_list));
646 if (block_list == 0) {
647 critical_error("failed to allocate memory for block_list\n");
651 get_block_list_extents(fd, inode, block_list);
665 get_block_list_indirect(fd, inode, block_list);
670 read_block(fd, block_list[i], dirbuf + (i * info.block_size));
767 write_block(fd, block_list[i], dirbuf + (i * info.block_size));
773 free(block_list);