]> git.hungrycats.org Git - linux/commit
btrfs: cleanup 64bit/32bit divs, compile time constants
authorDavid Sterba <dsterba@suse.cz>
Fri, 16 Jan 2015 16:21:12 +0000 (17:21 +0100)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 22 Apr 2015 16:24:38 +0000 (12:24 -0400)
commitf43e0bdf399fb3b196db6f3983c155c3900f5acf
tree0a1fe227200d168ef540cb6035969c6300c50dad
parentbe3dea3526735f7f0ee61ce6e6e0a1764e5a0ef2
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>
(cherry picked from commit f8c269d7223f6b63cc5936eb191bc3b170d24342)
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/math.h
fs/btrfs/super.c