fprintf(fs->f, "%4d %*lu %*llu %*llu %*lu\n", fs->ext,
fs->logical_width,
(unsigned long) fs->logical_start,
- fs->physical_width, fs->physical_start,
- fs->physical_width, fs->expected,
+ fs->physical_width,
+ (unsigned long long) fs->physical_start,
+ fs->physical_width,
+ (unsigned long long) fs->expected,
fs->logical_width, (unsigned long) fs->num);
else
fprintf(fs->f, "%4d %*lu %*llu %*s %*lu\n", fs->ext,
fs->logical_width,
(unsigned long) fs->logical_start,
- fs->physical_width, fs->physical_start,
+ fs->physical_width,
+ (unsigned long long) fs->physical_start,
fs->physical_width, "",
fs->logical_width, (unsigned long) fs->num);
}
if (fs->options & VERBOSE_OPT) {
blk64_t num_blocks = ext2fs_inode_i_blocks(current_fs, inode);
- if (!(current_fs->super->s_feature_ro_compat &
- EXT4_FEATURE_RO_COMPAT_HUGE_FILE) ||
+ if (!ext2fs_has_feature_huge_file(current_fs->super) ||
!(inode->i_flags & EXT4_HUGE_FILE_FL))
num_blocks /= current_fs->blocksize / 512;
fprintf(fs->f, "\n%s has %llu block(s), i_size is %llu\n",
- fs->name, num_blocks, EXT2_I_SIZE(inode));
+ fs->name, (unsigned long long) num_blocks,
+ (unsigned long long) EXT2_I_SIZE(inode));
}
print_header(fs);
- retval = ext2fs_block_iterate3(current_fs, ino,
- BLOCK_FLAG_READ_ONLY, NULL,
- filefrag_blocks_proc, fs);
- if (retval)
- com_err("ext2fs_block_iterate3", retval, 0);
+ if (ext2fs_inode_has_valid_blocks2(current_fs, inode)) {
+ retval = ext2fs_block_iterate3(current_fs, ino,
+ BLOCK_FLAG_READ_ONLY, NULL,
+ filefrag_blocks_proc, fs);
+ if (retval)
+ com_err("ext2fs_block_iterate3", retval, 0);
+ }
report_filefrag(fs);
fprintf(fs->f, "%s: %d contiguous extents%s\n", fs->name, fs->ext,
if (entry == DIRENT_DELETED_FILE)
return 0;
- thislen = dirent->name_len & 0xFF;
+ thislen = ext2fs_dirent_name_len(dirent);
strncpy(name, dirent->name, thislen);
name[thislen] = '\0';
ino = dirent->inode;
}
}
-void do_filefrag(int argc, char *argv[])
+void do_filefrag(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+ void *infop EXT2FS_ATTR((unused)))
{
struct filefrag_struct fs;
struct ext2_inode inode;