btrfs: Use explicit round_down macro in btrfs resize ioctl handler
authorNikolay Borisov <nborisov@suse.com>
Tue, 18 Jul 2017 12:39:08 +0000 (15:39 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 14:12:03 +0000 (16:12 +0200)
No functional changes, just make the code more self-explanatory.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c

index 335e252a99f500f847387e7bf4b3eae49a24d241..3e744dd17ac5e3d65ad504f2fd3a8c081f5e65ea 100644 (file)
@@ -1569,8 +1569,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
                goto out_free;
        }
 
-       new_size = div_u64(new_size, fs_info->sectorsize);
-       new_size *= fs_info->sectorsize;
+       new_size = round_down(new_size, fs_info->sectorsize);
 
        btrfs_info_in_rcu(fs_info, "new size for %s is %llu",
                          rcu_str_deref(device->name), new_size);