]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add wrapper for counting BTRFS_MAX_EXTENT_SIZE
authorDavid Sterba <dsterba@suse.com>
Wed, 4 Jan 2017 10:09:51 +0000 (11:09 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 14 Feb 2017 14:50:51 +0000 (15:50 +0100)
commit604eeaee2585e10c8ae49f9f05176e1d96dad09c
treeba1864d6c1472b33acbe0d6d991cb91cf4d69f74
parentccb11b1585bacd6d7bf742af15adb871e7f2188e
btrfs: add wrapper for counting BTRFS_MAX_EXTENT_SIZE

The expression is open-coded in several places, this asks for a wrapper.
As we know the MAX_EXTENT fits to u32, we can use the appropirate
division helper. This cascades to the result type updates.

Compiler is clever enough to use shift instead of integer division, so
there's no change in the generated assembly.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c