]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
buffer: Remove submit_bh()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 May 2026 17:31:44 +0000 (18:31 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:28:10 +0000 (10:28 +0200)
No users are left; remove this API.  Also remove/fix comments mentioning
it, and end_bio_bh_io_sync() as it's now unused.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://patch.msgid.link/20260528173150.1093780-32-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Documentation/trace/ftrace.rst
fs/buffer.c
include/linux/buffer_head.h
mm/vmscan.c

index b9efb148a5c22b11397ae5f3c7d72a929c98fab5..2ed1b96e440be4b7bf3e20b6168509c00d26728f 100644 (file)
@@ -1624,7 +1624,7 @@ function-trace, we get a much larger output::
    => blk_queue_bio
    => submit_bio_noacct
    => submit_bio
-   => submit_bh
+   => bh_submit
    => __ext3_get_inode_loc
    => ext3_iget
    => ext3_lookup
@@ -1909,7 +1909,7 @@ tracers.
    => blk_queue_bio
    => submit_bio_noacct
    => submit_bio
-   => submit_bh
+   => bh_submit
    => ext3_bread
    => ext3_dir_bread
    => htree_dirblock_to_tree
index d35f584a06f91f81ec20e7ce9a03e9d61ae327d8..3df0ea1a6342e52be86954255ac57351743f328f 100644 (file)
@@ -1187,14 +1187,6 @@ void __bforget(struct buffer_head *bh)
 }
 EXPORT_SYMBOL(__bforget);
 
-static void end_bio_bh_io_sync(struct bio *bio)
-{
-       struct buffer_head *bh;
-       bool uptodate = bio_endio_bh(bio, &bh);
-
-       bh->b_end_io(bh, uptodate);
-}
-
 static void buffer_set_crypto_ctx(struct bio *bio, const struct buffer_head *bh,
                                  gfp_t gfp_mask)
 {
@@ -1829,15 +1821,15 @@ static struct buffer_head *folio_create_buffers(struct folio *folio,
 
 /*
  * While block_write_full_folio is writing back the dirty buffers under
- * the page lock, whoever dirtied the buffers may decide to clean them
+ * the folio lock, whoever dirtied the buffers may decide to clean them
  * again at any time.  We handle that by only looking at the buffer
  * state inside lock_buffer().
  *
  * If block_write_full_folio() is called for regular writeback
- * (wbc->sync_mode == WB_SYNC_NONE) then it will redirty a page which has a
- * locked buffer.   This only can happen if someone has written the buffer
- * directly, with submit_bh().  At the address_space level PageWriteback
- * prevents this contention from occurring.
+ * (wbc->sync_mode == WB_SYNC_NONE) then it will redirty a folio which
+ * has a locked buffer.   This only can happen if someone has written
+ * the buffer directly, with bh_submit().  At the address_space level
+ * the folio writeback flag prevents this contention from occurring.
  *
  * If block_write_full_folio() is called with wbc->sync_mode ==
  * WB_SYNC_ALL, the writes are posted using REQ_SYNC; this
@@ -1954,7 +1946,7 @@ done:
                /*
                 * The folio was marked dirty, but the buffers were
                 * clean.  Someone wrote them back by hand with
-                * write_dirty_buffer/submit_bh.  A rare case.
+                * write_dirty_buffer/bh_submit.  A rare case.
                 */
                folio_end_writeback(folio);
 
@@ -2800,13 +2792,6 @@ sector_t generic_block_bmap(struct address_space *mapping, sector_t block,
 }
 EXPORT_SYMBOL(generic_block_bmap);
 
-void submit_bh(blk_opf_t opf, struct buffer_head *bh)
-{
-       BUG_ON(!bh->b_end_io);
-       __bh_submit(bh, opf, WRITE_LIFE_NOT_SET, NULL, end_bio_bh_io_sync);
-}
-EXPORT_SYMBOL(submit_bh);
-
 void write_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags)
 {
        lock_buffer(bh);
index f0a9f3f05ac1439bf20a07dc091ee8572bb0daeb..7629130d42c44bfef45738accba5085464fc8666 100644 (file)
@@ -55,7 +55,7 @@ typedef void (bh_end_io_t)(struct buffer_head *bh, int uptodate);
  * is the bio, and buffer_heads are used for extracting block
  * mappings (via a get_block_t call), for tracking state within
  * a folio (via a folio_mapping) and for wrapping bio submission
- * for backward compatibility reasons (e.g. submit_bh).
+ * for backward compatibility reasons (e.g. bh_submit).
  */
 struct buffer_head {
        unsigned long b_state;          /* buffer state bitmap (see above) */
@@ -244,7 +244,6 @@ void __lock_buffer(struct buffer_head *bh);
 int sync_dirty_buffer(struct buffer_head *bh);
 int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags);
 void write_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags);
-void submit_bh(blk_opf_t, struct buffer_head *);
 void bh_submit(struct buffer_head *, blk_opf_t, bio_end_io_t);
 void write_boundary_block(struct block_device *bdev,
                        sector_t bblock, unsigned blocksize);
index bd1b1aa125819fe3c166bd1c015e6432d58cfdf4..67231d3189ef3f0887526175da12a744b01ec471 100644 (file)
@@ -1449,7 +1449,7 @@ retry:
                 * is possible for a folio to have the dirty flag set,
                 * but it is actually clean (all its buffers are clean).
                 * This happens if the buffers were written out directly,
-                * with submit_bh(). ext3 will do this, as well as
+                * with bh_submit(). ext3 will do this, as well as
                 * the blockdev mapping.  filemap_release_folio() will
                 * discover that cleanness and will drop the buffers
                 * and mark the folio clean - it can be freed.