summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2026-05-28 20:31:35 +0300
committerChristian Brauner <brauner@kernel.org>2026-06-04 11:28:09 +0300
commitf8ff032ce5f0c08348b55468330a67c93b58848b (patch)
tree24076d3832b0fd380b779c10af12d4ef2b27cc68
parent184dec3146911b923a7eff11545f85797c2b9f81 (diff)
downloadlinux-f8ff032ce5f0c08348b55468330a67c93b58848b.tar.xz
gfs2: Convert gfs2_metapath_ra to bh_submit()
Avoid an extra indirect function call by using bh_submit() instead of submit_bh(). Also simplify the control flow now that the buffer refcount is not put by bh_end_read(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Link: https://patch.msgid.link/20260528173150.1093780-23-willy@infradead.org Reviewed-by: Jan Kara <jack@suse.cz> Cc: gfs2@lists.linux.dev Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
-rw-r--r--fs/gfs2/bmap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
index b3d7fcd95f03..d158c4b7413d 100644
--- a/fs/gfs2/bmap.c
+++ b/fs/gfs2/bmap.c
@@ -304,14 +304,15 @@ static void gfs2_metapath_ra(struct gfs2_glock *gl, __be64 *start, __be64 *end)
rabh = gfs2_getbuf(gl, be64_to_cpu(*t), CREATE);
if (trylock_buffer(rabh)) {
if (!buffer_uptodate(rabh)) {
- rabh->b_end_io = end_buffer_read_sync;
- submit_bh(REQ_OP_READ | REQ_RAHEAD | REQ_META |
- REQ_PRIO, rabh);
- continue;
+ bh_submit(rabh,
+ REQ_OP_READ | REQ_RAHEAD | REQ_META |
+ REQ_PRIO,
+ bh_end_read);
+ } else {
+ unlock_buffer(rabh);
}
- unlock_buffer(rabh);
}
- brelse(rabh);
+ put_bh(rabh);
}
}