btrfs-progs: convert: use wider types types for inode counts for progress reports
authorDavid Sterba <dsterba@suse.com>
Mon, 30 Jan 2017 09:33:01 +0000 (10:33 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 8 Mar 2017 12:00:46 +0000 (13:00 +0100)
Signed-off-by: David Sterba <dsterba@suse.com>
convert/main.c
convert/source-fs.h

index 2f6ec42..5a2da31 100644 (file)
@@ -55,14 +55,15 @@ static void *print_copied_inodes(void *p)
 {
        struct task_ctx *priv = p;
        const char work_indicator[] = { '.', 'o', 'O', 'o' };
-       uint32_t count = 0;
+       u64 count = 0;
 
        task_period_start(priv->info, 1000 /* 1s */);
        while (1) {
                count++;
-               printf("copy inodes [%c] [%10d/%10d]\r",
-                      work_indicator[count % 4], priv->cur_copy_inodes,
-                      priv->max_copy_inodes);
+               printf("copy inodes [%c] [%10llu/%10llu]\r",
+                      work_indicator[count % 4],
+                      (unsigned long long)priv->cur_copy_inodes,
+                      (unsigned long long)priv->max_copy_inodes);
                fflush(stdout);
                task_period_wait(priv->info);
        }
index b6a159e..41d1153 100644 (file)
@@ -22,8 +22,8 @@
 #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID
 
 struct task_ctx {
-       uint32_t max_copy_inodes;
-       uint32_t cur_copy_inodes;
+       u64 max_copy_inodes;
+       u64 cur_copy_inodes;
        struct task_info *info;
 };