summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/lzo.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-06-05 01:59:57 +0200
committerChris Mason <clm@fb.com>2014-09-17 13:37:17 -0700
commited6078f70335f158ca79790a0d0708ce558a6e9a (patch)
tree636322e2a1e25f7db9f5982204a8fa4bc1bf9cbf /fs/btrfs/lzo.c
parent4e54b17ad67a2d0d59bda6edcf725dc5b281c253 (diff)
downloadlinux-ed6078f70335f158ca79790a0d0708ce558a6e9a.tar.bz2
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/lzo.c')
-rw-r--r--fs/btrfs/lzo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index dfad8514f0da..78285f30909e 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -266,8 +266,7 @@ static int lzo_decompress_biovec(struct list_head *ws,
char *data_in;
unsigned long page_in_index = 0;
unsigned long page_out_index = 0;
- unsigned long total_pages_in = (srclen + PAGE_CACHE_SIZE - 1) /
- PAGE_CACHE_SIZE;
+ unsigned long total_pages_in = DIV_ROUND_UP(srclen, PAGE_CACHE_SIZE);
unsigned long buf_start;
unsigned long buf_offset = 0;
unsigned long bytes;