[PATCH v2 20/34] ocfs2: Convert ocfs2_read_blocks to bh_submit()

"Matthew Wilcox (Oracle)" <[email protected]> Thu, 28 May 2026 18:31:33 +0100
Newsgroups dev.linux.lists.ocfs2-devel,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
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) <[email protected]>
Reviewed-by: Joseph Qi <[email protected]>
Cc: [email protected]
---
 fs/ocfs2/buffer_head_io.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index 9edaeef5c4b9..185ff4dcba75 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -319,11 +319,9 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
 				continue;
 			}
 
-			get_bh(bh); /* for end_buffer_read_sync() */
 			if (validate)
 				set_buffer_needs_validate(bh);
-			bh->b_end_io = end_buffer_read_sync;
-			submit_bh(REQ_OP_READ, bh);
+			bh_submit(bh, REQ_OP_READ, bh_end_read);
 			continue;
 		}
 	}
-- 
2.47.3