]> 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@waya.furryterror.org>
Fri, 27 Mar 2015 03:33:11 +0000 (23:33 -0400)
commiteb2f30d9a98b49ae4f327b03cadde6c44e4e030e
treed628b1350a9ecfca65cda798e6ffa25a8d6726d7
parent817684d2281ef35cb26d156ace53d292ad737d1e
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