diff options
author | David Sterba <dsterba@suse.cz> | 2014-06-04 19:59:57 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:37:17 -0400 |
commit | ed6078f70335f158ca79790a0d0708ce558a6e9a (patch) | |
tree | 636322e2a1e25f7db9f5982204a8fa4bc1bf9cbf /fs/btrfs/free-space-cache.c | |
parent | 4e54b17ad67a2d0d59bda6edcf725dc5b281c253 (diff) |
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 f181c9afe5f4..2f0fe1028e51 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, | |||
279 | int num_pages; | 279 | int num_pages; |
280 | int check_crcs = 0; | 280 | int check_crcs = 0; |
281 | 281 | ||
282 | num_pages = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> | 282 | num_pages = DIV_ROUND_UP(i_size_read(inode), PAGE_CACHE_SIZE); |
283 | PAGE_CACHE_SHIFT; | ||
284 | 283 | ||
285 | if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) | 284 | if (btrfs_ino(inode) != BTRFS_FREE_INO_OBJECTID) |
286 | check_crcs = 1; | 285 | check_crcs = 1; |