Skip to content

Commit

Permalink
btrfs: unify extent_page_data type passed as void
Browse files Browse the repository at this point in the history
Functions called from extent_write_cache_pages used void* as generic
callback data, but all of them convert it to extent_page_data, or use it
directly.

Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Jan 22, 2018
1 parent 935db85 commit aab6e9e
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void add_extent_changeset(struct extent_state *state, unsigned bits,
BUG_ON(ret < 0);
}

static void flush_write_bio(void *data);
static void flush_write_bio(struct extent_page_data *epd);

static inline struct btrfs_fs_info *
tree_fs_info(struct extent_io_tree *tree)
Expand Down Expand Up @@ -3456,10 +3456,9 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
* and the end_io handler clears the writeback ranges
*/
static int __extent_writepage(struct page *page, struct writeback_control *wbc,
void *data)
struct extent_page_data *epd)
{
struct inode *inode = page->mapping->host;
struct extent_page_data *epd = data;
u64 start = page_offset(page);
u64 page_end = start + PAGE_SIZE - 1;
int ret;
Expand Down Expand Up @@ -3905,7 +3904,7 @@ int btree_write_cache_pages(struct address_space *mapping,
*/
static int extent_write_cache_pages(struct address_space *mapping,
struct writeback_control *wbc,
void *data)
struct extent_page_data *epd)
{
struct inode *inode = mapping->host;
int ret = 0;
Expand Down Expand Up @@ -3969,7 +3968,7 @@ static int extent_write_cache_pages(struct address_space *mapping,
* mapping
*/
if (!trylock_page(page)) {
flush_write_bio(data);
flush_write_bio(epd);
lock_page(page);
}

Expand All @@ -3980,7 +3979,7 @@ static int extent_write_cache_pages(struct address_space *mapping,

if (wbc->sync_mode != WB_SYNC_NONE) {
if (PageWriteback(page))
flush_write_bio(data);
flush_write_bio(epd);
wait_on_page_writeback(page);
}

Expand All @@ -3990,7 +3989,7 @@ static int extent_write_cache_pages(struct address_space *mapping,
continue;
}

ret = __extent_writepage(page, wbc, data);
ret = __extent_writepage(page, wbc, epd);

if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
unlock_page(page);
Expand Down Expand Up @@ -4038,10 +4037,8 @@ static int extent_write_cache_pages(struct address_space *mapping,
return ret;
}

static void flush_write_bio(void *data)
static void flush_write_bio(struct extent_page_data *epd)
{
struct extent_page_data *epd = data;

if (epd->bio) {
int ret;

Expand Down

0 comments on commit aab6e9e

Please sign in to comment.