Skip to content

Commit aab6e9e

Browse files
committed
btrfs: unify extent_page_data type passed as void
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>
1 parent 935db85 commit aab6e9e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

fs/btrfs/extent_io.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void add_extent_changeset(struct extent_state *state, unsigned bits,
138138
BUG_ON(ret < 0);
139139
}
140140

141-
static void flush_write_bio(void *data);
141+
static void flush_write_bio(struct extent_page_data *epd);
142142

143143
static inline struct btrfs_fs_info *
144144
tree_fs_info(struct extent_io_tree *tree)
@@ -3456,10 +3456,9 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
34563456
* and the end_io handler clears the writeback ranges
34573457
*/
34583458
static int __extent_writepage(struct page *page, struct writeback_control *wbc,
3459-
void *data)
3459+
struct extent_page_data *epd)
34603460
{
34613461
struct inode *inode = page->mapping->host;
3462-
struct extent_page_data *epd = data;
34633462
u64 start = page_offset(page);
34643463
u64 page_end = start + PAGE_SIZE - 1;
34653464
int ret;
@@ -3905,7 +3904,7 @@ int btree_write_cache_pages(struct address_space *mapping,
39053904
*/
39063905
static int extent_write_cache_pages(struct address_space *mapping,
39073906
struct writeback_control *wbc,
3908-
void *data)
3907+
struct extent_page_data *epd)
39093908
{
39103909
struct inode *inode = mapping->host;
39113910
int ret = 0;
@@ -3969,7 +3968,7 @@ static int extent_write_cache_pages(struct address_space *mapping,
39693968
* mapping
39703969
*/
39713970
if (!trylock_page(page)) {
3972-
flush_write_bio(data);
3971+
flush_write_bio(epd);
39733972
lock_page(page);
39743973
}
39753974

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

39813980
if (wbc->sync_mode != WB_SYNC_NONE) {
39823981
if (PageWriteback(page))
3983-
flush_write_bio(data);
3982+
flush_write_bio(epd);
39843983
wait_on_page_writeback(page);
39853984
}
39863985

@@ -3990,7 +3989,7 @@ static int extent_write_cache_pages(struct address_space *mapping,
39903989
continue;
39913990
}
39923991

3993-
ret = __extent_writepage(page, wbc, data);
3992+
ret = __extent_writepage(page, wbc, epd);
39943993

39953994
if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
39963995
unlock_page(page);
@@ -4038,10 +4037,8 @@ static int extent_write_cache_pages(struct address_space *mapping,
40384037
return ret;
40394038
}
40404039

4041-
static void flush_write_bio(void *data)
4040+
static void flush_write_bio(struct extent_page_data *epd)
40424041
{
4043-
struct extent_page_data *epd = data;
4044-
40454042
if (epd->bio) {
40464043
int ret;
40474044

0 commit comments

Comments
 (0)