Lines Matching refs:inode
257 static int read_inode(int fd, unsigned int inum, struct ext4_inode *inode) in read_inode() argument
273 len=read(fd, inode, sizeof(*inode)); in read_inode()
274 if (len != sizeof(*inode)) { in read_inode()
452 static int get_direct_blocks(struct ext4_inode *inode, unsigned long long *block_list, in get_direct_blocks() argument
460 while ((i < (inode->i_blocks_lo / sectors_per_block)) && (i < EXT4_NDIR_BLOCKS)) { in get_direct_blocks()
461 block_list[i] = inode->i_block[i]; in get_direct_blocks()
467 if ((inode->i_blocks_lo / sectors_per_block) > EXT4_NDIR_BLOCKS) { in get_direct_blocks()
474 static int get_indirect_blocks(int fd, struct ext4_inode *inode, in get_indirect_blocks() argument
488 read_block(fd, inode->i_block[EXT4_NDIR_BLOCKS], indirect_block); in get_indirect_blocks()
490 for(i = 0; i < (inode->i_blocks_lo / sectors_per_block - EXT4_NDIR_BLOCKS); i++) { in get_indirect_blocks()
501 static int get_block_list_indirect(int fd, struct ext4_inode *inode, unsigned long long *block_list) in get_block_list_indirect() argument
505 if (get_direct_blocks(inode, block_list, &count)) { in get_block_list_indirect()
506 get_indirect_blocks(fd, inode, block_list, &count); in get_block_list_indirect()
571 static int get_block_list_extents(int fd, struct ext4_inode *inode, unsigned long long *block_list) in get_block_list_extents() argument
575 extent_hdr = (struct ext4_extent_header *)inode->i_block; in get_block_list_extents()
583 get_extent_ents((struct ext4_extent_header *)inode->i_block, block_list); in get_block_list_extents()
587 get_extent_idx(fd, (struct ext4_extent_header *)inode->i_block, block_list); in get_block_list_extents()
594 struct ext4_inode inode; in is_entry_dir() local
607 if ((pass == UPDATE_INODE_NUMS) && !(dirp->inode & 0x80000000)) { in is_entry_dir()
610 read_inode(fd, (dirp->inode & 0x7fffffff), &inode); in is_entry_dir()
611 if (S_ISDIR(inode.i_mode)) { in is_entry_dir()
620 static int recurse_dir(int fd, struct ext4_inode *inode, char *dirbuf, int dirsize, int mode) in recurse_dir() argument
652 if (inode->i_flags & EXT4_EXTENTS_FL) { in recurse_dir()
653 get_block_list_extents(fd, inode, block_list); in recurse_dir()
667 get_block_list_indirect(fd, inode, block_list); in recurse_dir()
693 if (dirp->inode == 0) { in recurse_dir()
713 ((mode == UPDATE_INODE_NUMS) && (dirp->inode & 0x80000000))) ) { in recurse_dir()
715 read_inode(fd, dirp->inode & 0x7fffffff, &tmp_inode); in recurse_dir()
719 dirp->inode & 0x7fffffff, name); in recurse_dir()
722 printf("inode %d %s use extents\n", dirp->inode & 0x7fffffff, in recurse_dir()
751 dirp->inode |= 0x80000000; in recurse_dir()
753 if (dirp->inode & 0x80000000) { in recurse_dir()
754 dirp->inode = compute_new_inum(dirp->inode & 0x7fffffff); in recurse_dir()