From: Matthew Wilcox (Oracle) Date: Thu, 28 May 2026 17:31:39 +0000 (+0100) Subject: buffer: Remove mark_buffer_async_write() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6eff926482d0f6ebe038a15348158682f5711a0;p=thirdparty%2Flinux.git buffer: Remove mark_buffer_async_write() There are no more callers of this function, so delete it. end_buffer_async_write() then has only one caller left, so inline it into bh_end_async_write(). Signed-off-by: Matthew Wilcox (Oracle) Link: https://patch.msgid.link/20260528173150.1093780-27-willy@infradead.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) --- diff --git a/fs/buffer.c b/fs/buffer.c index 50bcef50a4a4f..d35f584a06f91 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -438,12 +438,19 @@ static void bh_end_async_read(struct bio *bio) end_buffer_async_read(bh, uptodate); } -/* - * Completion handler for block_write_full_folio() - folios which are unlocked - * during I/O, and which have the writeback flag cleared upon I/O completion. +/** + * bh_end_async_write - I/O end handler for async folio writes + * @bio: The bio being completed. + * + * Pass this function to bh_submit() if you're doing the equivalent of + * block_write_full_folio(). That is, the folio is unlocked, and will + * have its writeback flag cleared once all async write buffers have + * completed. */ -static void end_buffer_async_write(struct buffer_head *bh, int uptodate) +void bh_end_async_write(struct bio *bio) { + struct buffer_head *bh; + bool success = bio_endio_bh(bio, &bh); unsigned long flags; struct buffer_head *first; struct buffer_head *tmp; @@ -452,7 +459,7 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate) BUG_ON(!buffer_async_write(bh)); folio = bh->b_folio; - if (uptodate) { + if (success) { set_buffer_uptodate(bh); } else { buffer_io_error(bh, ", lost async page write"); @@ -480,29 +487,8 @@ static void end_buffer_async_write(struct buffer_head *bh, int uptodate) still_busy: spin_unlock_irqrestore(&first->b_uptodate_lock, flags); } - -/** - * bh_end_async_write - I/O end handler for async folio writes - * @bio: The bio being completed. - * - * Pass this function to bh_submit() if you're doing the equivalent of - * block_write_full_folio(). - */ -void bh_end_async_write(struct bio *bio) -{ - struct buffer_head *bh; - bool success = bio_endio_bh(bio, &bh); - end_buffer_async_write(bh, success); -} EXPORT_SYMBOL(bh_end_async_write); -void mark_buffer_async_write(struct buffer_head *bh) -{ - bh->b_end_io = end_buffer_async_write; - set_buffer_async_write(bh); -} -EXPORT_SYMBOL(mark_buffer_async_write); - /* * fs/buffer.c contains helper functions for buffer-backed address space's diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index b0a31a90fa796..f0a9f3f05ac14 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -224,7 +224,6 @@ static inline void clean_bdev_bh_alias(struct buffer_head *bh) clean_bdev_aliases(bh->b_bdev, bh->b_blocknr, 1); } -void mark_buffer_async_write(struct buffer_head *bh); void __wait_on_buffer(struct buffer_head *); wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,