Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
static inline unsigned long num_extent_pages(const struct extent_buffer *eb)
{
- return ((eb->start + eb->len + PAGE_SIZE - 1) >> PAGE_SHIFT) -
- (eb->start >> PAGE_SHIFT);
+ return (round_up(eb->start + eb->len, PAGE_SIZE) >> PAGE_SHIFT) -
+ (eb->start >> PAGE_SHIFT);
}
static inline void extent_buffer_get(struct extent_buffer *eb)