diff options
author | David Sterba <dsterba@suse.com> | 2018-06-29 10:56:49 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 13:12:43 +0200 |
commit | 65ad010488a5cc0f123a9924f7ad26a1b3f6a4f6 (patch) | |
tree | 04a1e29c5fc4b97defb72379af61735f5e78ce81 /fs/btrfs/extent_io.h | |
parent | d7f663fa3ff906247a979c1115bc92cbabfb19ba (diff) |
btrfs: pass only eb to num_extent_pages
Almost all callers pass the start and len as 2 arguments but this is not
necessary, all the information is provided by the eb. By reordering the
calls to num_extent_pages, we don't need the local variables with
start/len.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index 0bfd4aeb822d..d8382a4a7f46 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -440,10 +440,10 @@ int read_extent_buffer_pages(struct extent_io_tree *tree, int mirror_num); void wait_on_extent_buffer_writeback(struct extent_buffer *eb); -static inline unsigned long num_extent_pages(u64 start, u64 len) +static inline unsigned long num_extent_pages(const struct extent_buffer *eb) { - return ((start + len + PAGE_SIZE - 1) >> PAGE_SHIFT) - - (start >> PAGE_SHIFT); + return ((eb->start + eb->len + PAGE_SIZE - 1) >> PAGE_SHIFT) - + (eb->start >> PAGE_SHIFT); } static inline void extent_buffer_get(struct extent_buffer *eb) |