Re: [PATCH v2 22/34] gfs2: Convert gfs2_metapath_ra to bh_submit()
Jan Kara <[email protected]> Sat, 30 May 2026 13:47:00 +0200
| Newsgroups | dev.linux.lists.gfs2,org.kernel.vger.linux-fsdevel |
|---|---|
| Message-ID | <c2yofxqkmjlbjury266556qxqqhmloff43v65tyht6prfbqa56@z5swhbodxfy5> |
On Thu 28-05-26 18:31:35, Matthew Wilcox (Oracle) wrote: > 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) <[email protected]> > Cc: [email protected] Looks good to me. Feel free to add: Reviewed-by: Jan Kara <[email protected]> Honza > --- > fs/gfs2/bmap.c | 13 +++++++------ > 1 file 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); > } > } > > -- > 2.47.3 > -- Jan Kara <[email protected]> SUSE Labs, CR