]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
buffer: Convert __sync_dirty_buffer to bh_submit()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 May 2026 17:31:20 +0000 (18:31 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:28:06 +0000 (10:28 +0200)
Avoid an extra indirect function call and changing the buffer refcount
by using bh_submit() instead of submit_bh().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Link: https://patch.msgid.link/20260528173150.1093780-8-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/buffer.c

index f8428f802b68163fb3e0645a6705ccd7334949e5..deabf74793250627e50ca4bfb4a0a1645529d0dd 100644 (file)
@@ -2857,9 +2857,7 @@ int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags)
                        return -EIO;
                }
 
-               get_bh(bh);
-               bh->b_end_io = end_buffer_write_sync;
-               submit_bh(REQ_OP_WRITE | op_flags, bh);
+               bh_submit(bh, REQ_OP_WRITE | op_flags, bh_end_write);
                wait_on_buffer(bh);
                if (!buffer_uptodate(bh))
                        return -EIO;