btrfs: Use explicit round_down call rather than open-coding it
authorNikolay Borisov <nborisov@suse.com>
Tue, 27 Jun 2017 07:02:25 +0000 (10:02 +0300)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 12:19:52 +0000 (14:19 +0200)
No functional changes.

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/volumes.c

index c665af0727e6e03c9306e44e1003f5c9f729c721..b011753ce8bb8cbf85c08a8322f11d58a59cefe1 100644 (file)
@@ -4762,7 +4762,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
             btrfs_cmp_device_info, NULL);
 
        /* round down to number of usable stripes */
-       ndevs -= ndevs % devs_increment;
+       ndevs = round_down(ndevs, devs_increment);
 
        if (ndevs < devs_increment * sub_stripes || ndevs < devs_min) {
                ret = -ENOSPC;