Commit a50924e3 authored by David Sterba's avatar David Sterba

btrfs: drop constant param from btrfs_release_extent_buffer_page

All callers use the same value, simplify the function.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.cz>
parent 2755a0de
......@@ -4450,19 +4450,16 @@ int extent_buffer_under_io(struct extent_buffer *eb)
/*
* Helper for releasing extent buffer page.
*/
static void btrfs_release_extent_buffer_page(struct extent_buffer *eb,
unsigned long start_idx)
static void btrfs_release_extent_buffer_page(struct extent_buffer *eb)
{
unsigned long index;
unsigned long num_pages;
struct page *page;
int mapped = !test_bit(EXTENT_BUFFER_DUMMY, &eb->bflags);
BUG_ON(extent_buffer_under_io(eb));
num_pages = num_extent_pages(eb->start, eb->len);
index = start_idx + num_pages;
if (start_idx >= index)
index = num_extent_pages(eb->start, eb->len);
if (index == 0)
return;
do {
......@@ -4498,7 +4495,7 @@ static void btrfs_release_extent_buffer_page(struct extent_buffer *eb,
/* One for when we alloced the page */
page_cache_release(page);
}
} while (index != start_idx);
} while (index != 0);
}
/*
......@@ -4506,7 +4503,7 @@ static void btrfs_release_extent_buffer_page(struct extent_buffer *eb,
*/
static inline void btrfs_release_extent_buffer(struct extent_buffer *eb)
{
btrfs_release_extent_buffer_page(eb, 0);
btrfs_release_extent_buffer_page(eb);
__free_extent_buffer(eb);
}
......@@ -4863,7 +4860,7 @@ static int release_extent_buffer(struct extent_buffer *eb)
}
/* Should be safe to release our pages at this point */
btrfs_release_extent_buffer_page(eb, 0);
btrfs_release_extent_buffer_page(eb);
call_rcu(&eb->rcu_head, btrfs_release_extent_buffer_rcu);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment