]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Btrfs: fix 64 bit divide problem
authorJosef Bacik <josef@redhat.com>
Sat, 20 Aug 2011 12:29:51 +0000 (08:29 -0400)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 5 Oct 2011 20:32:47 +0000 (13:32 -0700)
commit3bd3f42d6421f19922280a4cbeb4938969944add
treea5a6efd2e1229cedd562717fc1f776a2e8115225
parentb09e9607788bc25f5ae8d54b7f7300f12a4e38e5
Btrfs: fix 64 bit divide problem

This fixes a regression introduced by commit cdcb725c05fe ("Btrfs: check
if there is enough space for balancing smarter").  We can't do 64-bit
divides on 32-bit architectures.

In cases where we need to divide/multiply by 2 we should just left/right
shift respectively, and in cases where theres N number of devices use
do_div.  Also make the counters u64 to match up with rw_devices.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Acked-and-tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
fs/btrfs/extent-tree.c