diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-05 01:59:57 +0200 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 13:37:17 -0700 |
commit | ed6078f70335f158ca79790a0d0708ce558a6e9a (patch) | |
tree | 636322e2a1e25f7db9f5982204a8fa4bc1bf9cbf /fs/btrfs/check-integrity.c | |
parent | 4e54b17ad67a2d0d59bda6edcf725dc5b281c253 (diff) | |
download | blackbird-obmc-linux-ed6078f70335f158ca79790a0d0708ce558a6e9a.tar.gz blackbird-obmc-linux-ed6078f70335f158ca79790a0d0708ce558a6e9a.zip |
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/check-integrity.c')
-rw-r--r-- | fs/btrfs/check-integrity.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c index d0690da3b150..e0033c843ce7 100644 --- a/fs/btrfs/check-integrity.c +++ b/fs/btrfs/check-integrity.c @@ -1251,8 +1251,7 @@ static void btrfsic_read_from_block_data( while (len > 0) { cur = min(len, ((size_t)PAGE_CACHE_SIZE - offset_in_page)); - BUG_ON(i >= (block_ctx->len + PAGE_CACHE_SIZE - 1) >> - PAGE_CACHE_SHIFT); + BUG_ON(i >= DIV_ROUND_UP(block_ctx->len, PAGE_CACHE_SIZE)); kaddr = block_ctx->datav[i]; memcpy(dst, kaddr + offset_in_page, cur); |