e4defrag: Use blk64_t instead of ext4_fsblk_t
PATCH v2 9/12 e4defrag: Use blk64_t instead of ext4_fsblk_t
e2fsprogs has blk64_t defined for the physical block number. e4defrag uses it instead of ext4_fsblk_t.
Signed-off-by Kazuya Mio <[email protected]>
--- misc/e4defrag.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
misc/e4defrag.c +5 -8
@@ -41,6 +41,7 @@#include "e2p/e2p.h" #include "ext2fs/ext2_types.h" +#include "ext2fs/ext2fs.h" #include "ext2fs/fiemap.h" /* A relatively new ioctl interface ... */
@@ -117,13 +118,10 @@#define NGMSG_FILE_UNREG "File is not regular file"#define NGMSG_LOST_FOUND "Can not process \"lost+found\"" -/* Data type for filesystem-wide blocks number */ -typedef unsigned long long ext4_fsblk_t ; -struct fiemap_extent_data {__u64 len;/* blocks count */ __u64 logical;/* start logical block number */ -ext4_fsblk_t physical;/* start physical block number */ +blk64_t physical;/* start physical block number */ };struct fiemap_extent_list {
@@ -473,7 +471,7 @@ static int defrag_fadvise(int fd, struct move_extent defrag_data,* In this case, they can catch ENOSPC when donor file is created by fallocate * in file_defrag(). So, it's no problem. */ -static int check_free_size (int fd,const char *file,ext4_fsblk_t blk_count) +static int check_free_size (int fd,const char *file,blk64_t blk_count) {struct statfs64 fsbuf;
@@ -522,8 +520,7 @@ static int file_frag_count(int fd)* @extents: file extents. * @blk_count: file blocks. */ -static int file_check (int fd,const char *file,int extents, -ext4_fsblk_t blk_count) +static int file_check (int fd,const char *file,int extents,blk64_t blk_count) {int ret;struct flock lock;
@@ -938,7 +935,7 @@ static int file_defrag(const char *file, const struct stat64 *buf,int file_frags_start, file_frags_end;char tmp_inode_name[PATH_MAX +8 ];unsigned int orig_score =0 , donor_score =0 ; -ext4_fsblk_t blk_count =0 ; +blk64_t blk_count =0 ;struct fiemap_extent_list *orig_list =NULL ;struct fiemap_extent_list *donor_list =NULL ;struct fiemap_extent_group *orig_group_head =NULL ;