]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: Convert ext4_commit_super() to bh_submit()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 May 2026 17:31:28 +0000 (18:31 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 4 Jun 2026 08:28:08 +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-16-willy@infradead.org
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/ext4/super.c

index bc7faedcb8e428027cf411d94ce62607d944f732..7283108d7609171fd56531cf9e94d1135523ec6e 100644 (file)
@@ -6316,12 +6316,10 @@ static int ext4_commit_super(struct super_block *sb)
                clear_buffer_write_io_error(sbh);
                set_buffer_uptodate(sbh);
        }
-       get_bh(sbh);
        /* Clear potential dirty bit if it was journalled update */
        clear_buffer_dirty(sbh);
-       sbh->b_end_io = end_buffer_write_sync;
-       submit_bh(REQ_OP_WRITE | REQ_SYNC |
-                 (test_opt(sb, BARRIER) ? REQ_FUA : 0), sbh);
+       bh_submit(sbh, REQ_OP_WRITE | REQ_SYNC |
+                 (test_opt(sb, BARRIER) ? REQ_FUA : 0), bh_end_write);
        wait_on_buffer(sbh);
        if (buffer_write_io_error(sbh)) {
                ext4_msg(sb, KERN_ERR, "I/O error while writing "