diff options
| author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2026-05-28 18:31:36 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-06-04 10:28:09 +0200 |
| commit | 6390838da4901e4a332c11b1d6ddc20f167005f9 (patch) | |
| tree | f82405e05d368fc053d50bb99bd84f06b1e3096f | |
| parent | f8ff032ce5f0c08348b55468330a67c93b58848b (diff) | |
| download | linux-next-6390838da4901e4a332c11b1d6ddc20f167005f9.tar.gz linux-next-6390838da4901e4a332c11b1d6ddc20f167005f9.zip | |
gfs2: Convert gfs2_dir_readahead 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-24-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/dir.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 022dbb31e0d9..0237b36b9eb1 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -1505,15 +1505,13 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index, if (trylock_buffer(bh)) { if (buffer_uptodate(bh)) { unlock_buffer(bh); - brelse(bh); - continue; + } else { + bh_submit(bh, REQ_OP_READ | REQ_RAHEAD | + REQ_META | REQ_PRIO, + bh_end_read); } - bh->b_end_io = end_buffer_read_sync; - submit_bh(REQ_OP_READ | REQ_RAHEAD | REQ_META | - REQ_PRIO, bh); - continue; } - brelse(bh); + put_bh(bh); } } |
