Skip to content

Commit 14059f6

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
fs: remove the bh_end_io argument from __block_write_full_folio
All callers are passing end_buffer_async_write as this argument, so we can hardcode references to it within __block_write_full_folio(). That lets us make end_buffer_async_write() static. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Jens Axboe <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 17bf23a commit 14059f6

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

fs/buffer.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,10 @@ static void end_buffer_async_read_io(struct buffer_head *bh, int uptodate)
372372
}
373373

374374
/*
375-
* Completion handler for block_write_full_folio() - pages which are unlocked
376-
* during I/O, and which have PageWriteback cleared upon I/O completion.
375+
* Completion handler for block_write_full_folio() - folios which are unlocked
376+
* during I/O, and which have the writeback flag cleared upon I/O completion.
377377
*/
378-
void end_buffer_async_write(struct buffer_head *bh, int uptodate)
378+
static void end_buffer_async_write(struct buffer_head *bh, int uptodate)
379379
{
380380
unsigned long flags;
381381
struct buffer_head *first;
@@ -415,7 +415,6 @@ void end_buffer_async_write(struct buffer_head *bh, int uptodate)
415415
spin_unlock_irqrestore(&first->b_uptodate_lock, flags);
416416
return;
417417
}
418-
EXPORT_SYMBOL(end_buffer_async_write);
419418

420419
/*
421420
* If a page's buffers are under async readin (end_buffer_async_read
@@ -1787,8 +1786,7 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
17871786
* causes the writes to be flagged as synchronous writes.
17881787
*/
17891788
int __block_write_full_folio(struct inode *inode, struct folio *folio,
1790-
get_block_t *get_block, struct writeback_control *wbc,
1791-
bh_end_io_t *handler)
1789+
get_block_t *get_block, struct writeback_control *wbc)
17921790
{
17931791
int err;
17941792
sector_t block;
@@ -1867,7 +1865,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
18671865
continue;
18681866
}
18691867
if (test_clear_buffer_dirty(bh)) {
1870-
mark_buffer_async_write_endio(bh, handler);
1868+
mark_buffer_async_write_endio(bh,
1869+
end_buffer_async_write);
18711870
} else {
18721871
unlock_buffer(bh);
18731872
}
@@ -1920,7 +1919,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
19201919
if (buffer_mapped(bh) && buffer_dirty(bh) &&
19211920
!buffer_delay(bh)) {
19221921
lock_buffer(bh);
1923-
mark_buffer_async_write_endio(bh, handler);
1922+
mark_buffer_async_write_endio(bh,
1923+
end_buffer_async_write);
19241924
} else {
19251925
/*
19261926
* The buffer may have been set dirty during
@@ -2704,8 +2704,7 @@ int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
27042704

27052705
/* Is the folio fully inside i_size? */
27062706
if (folio_pos(folio) + folio_size(folio) <= i_size)
2707-
return __block_write_full_folio(inode, folio, get_block, wbc,
2708-
end_buffer_async_write);
2707+
return __block_write_full_folio(inode, folio, get_block, wbc);
27092708

27102709
/* Is the folio fully outside i_size? (truncate in progress) */
27112710
if (folio_pos(folio) >= i_size) {
@@ -2722,8 +2721,7 @@ int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
27222721
*/
27232722
folio_zero_segment(folio, offset_in_folio(folio, i_size),
27242723
folio_size(folio));
2725-
return __block_write_full_folio(inode, folio, get_block, wbc,
2726-
end_buffer_async_write);
2724+
return __block_write_full_folio(inode, folio, get_block, wbc);
27272725
}
27282726

27292727
sector_t generic_block_bmap(struct address_space *mapping, sector_t block,

fs/gfs2/aops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int gfs2_write_jdata_folio(struct folio *folio,
108108
folio_size(folio));
109109

110110
return __block_write_full_folio(inode, folio, gfs2_get_block_noalloc,
111-
wbc, end_buffer_async_write);
111+
wbc);
112112
}
113113

114114
/**

include/linux/buffer_head.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ struct buffer_head *create_empty_buffers(struct folio *folio,
205205
unsigned long blocksize, unsigned long b_state);
206206
void end_buffer_read_sync(struct buffer_head *bh, int uptodate);
207207
void end_buffer_write_sync(struct buffer_head *bh, int uptodate);
208-
void end_buffer_async_write(struct buffer_head *bh, int uptodate);
209208

210209
/* Things to do with buffers at mapping->private_list */
211210
void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode);
@@ -255,8 +254,7 @@ void block_invalidate_folio(struct folio *folio, size_t offset, size_t length);
255254
int block_write_full_folio(struct folio *folio, struct writeback_control *wbc,
256255
void *get_block);
257256
int __block_write_full_folio(struct inode *inode, struct folio *folio,
258-
get_block_t *get_block, struct writeback_control *wbc,
259-
bh_end_io_t *handler);
257+
get_block_t *get_block, struct writeback_control *wbc);
260258
int block_read_full_folio(struct folio *, get_block_t *);
261259
bool block_is_partially_uptodate(struct folio *, size_t from, size_t count);
262260
int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,

0 commit comments

Comments
 (0)