]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ext4: Convert write_mmp_block_thawed() to bh_submit()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 May 2026 17:31:27 +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-15-willy@infradead.org
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/ext4/mmp.c

index 6f57c181ff778d30632ab5a181c83cb660948ec2..7ce361484b382155935f6e8b9aeebef0d8c294cd 100644 (file)
@@ -46,9 +46,8 @@ static int write_mmp_block_thawed(struct super_block *sb,
 
        ext4_mmp_csum_set(sb, mmp);
        lock_buffer(bh);
-       bh->b_end_io = end_buffer_write_sync;
-       get_bh(bh);
-       submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO, bh);
+       bh_submit(bh, REQ_OP_WRITE | REQ_SYNC | REQ_META | REQ_PRIO,
+                       bh_end_write);
        wait_on_buffer(bh);
        if (unlikely(!buffer_uptodate(bh)))
                return -EIO;