Skip to content

Commit

Permalink
btrfs: drop constant param from btrfs_release_extent_buffer_page
Browse files Browse the repository at this point in the history
All callers use the same value, simplify the function.

Signed-off-by: David Sterba <dsterba@suse.cz>
  • Loading branch information
David Sterba committed Oct 2, 2014
1 parent 2755a0d commit a50924e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -4498,15 +4495,15 @@ 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);
}

/*
* Helper for releasing the extent buffer.
*/
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);
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a50924e

Please sign in to comment.