diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-04 23:59:57 (GMT) |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 20:37:17 (GMT) |
commit | ed6078f70335f158ca79790a0d0708ce558a6e9a (patch) | |
tree | 636322e2a1e25f7db9f5982204a8fa4bc1bf9cbf /fs/btrfs/free-space-cache.c | |
parent | 4e54b17ad67a2d0d59bda6edcf725dc5b281c253 (diff) | |
download | linux-ed6078f70335f158ca79790a0d0708ce558a6e9a.tar.xz |
btrfs: use DIV_ROUND_UP instead of open-coded variants
The form
(value + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT
is equivalent to
(value + PAGE_CACHE_SIZE - 1) / PAGE_CACHE_SIZE
The rest is a simple subsitution, no difference in the generated
assembly code.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/free-space-cache.c')
-rw-r--r-- | fs/btrfs/free-space-cache.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index f181c9a..2f0fe10 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c @@ -279,8 +279,7 @@ static int io_ctl_init(struct io_ctl *io_ctl, struct inode *inode, int num_pages; int check_crcs = 0; - num_pages = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> - PAGE_CACHE_SHIFT; + num_pages = DIV_ROUND_UP(i_size_read(inode), PAGE_CACHE_SIZE); if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) check_crcs = 1; |