]> 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)
commitf077f012beaa278a0349e7b118f2a18852d8d3de
treeba1864d6c1472b33acbe0d6d991cb91cf4d69f74
parentb62ad409c0fe1ccc48caf8b33dd1d86516d2aa20
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