]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
buffer: Remove mark_buffer_async_write()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 May 2026 17:31:39 +0000 (18:31 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:28:09 +0000 (10:28 +0200)
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) <willy@infradead.org>
Link: https://patch.msgid.link/20260528173150.1093780-27-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/buffer.c
include/linux/buffer_head.h

index 50bcef50a4a4f77f01c64b064a7ecdbbda0b8f00..d35f584a06f91f81ec20e7ce9a03e9d61ae327d8 100644 (file)
@@ -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
index b0a31a90fa7963be3271180eca3418c3c6870c90..f0a9f3f05ac1439bf20a07dc091ee8572bb0daeb 100644 (file)
@@ -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,