summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorDavid Sterba2015-01-16 17:21:12 +0100
committerDavid Sterba2015-03-03 17:23:57 +0100
commitf8c269d7223f6b63cc5936eb191bc3b170d24342 (patch)
tree2e82cc23da9f436bbb6fde058b3321619f990db2 /fs/btrfs/super.c
parentbtrfs: use cond_resched_lock where possible (diff)
downloadkernel-qcow2-linux-f8c269d7223f6b63cc5936eb191bc3b170d24342.tar.gz
kernel-qcow2-linux-f8c269d7223f6b63cc5936eb191bc3b170d24342.tar.xz
kernel-qcow2-linux-f8c269d7223f6b63cc5936eb191bc3b170d24342.zip
btrfs: cleanup 64bit/32bit divs, compile time constants
Switch to div_u64 if the divisor is a numeric constant or sum of sizeof()s. We can remove a few instances of do_div that has the hidden semtantics of changing the 1st argument. Small power-of-two divisors are converted to bitshifts, large values are kept intact for clarity. Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 100a0442c413..530a0baa7c71 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1704,7 +1704,7 @@ static int btrfs_calc_avail_data_space(struct btrfs_root *root, u64 *free_bytes)
avail_space = device->total_bytes - device->bytes_used;
/* align with stripe_len */
- do_div(avail_space, BTRFS_STRIPE_LEN);
+ avail_space = div_u64(avail_space, BTRFS_STRIPE_LEN);
avail_space *= BTRFS_STRIPE_LEN;
/*