Skip to content

Commit afa4906

Browse files
author
Lukas Czerner
committed
ext2: replace bh_submit_read() helper with bh_read()
Bugzilla: https://bugzilla.redhat.com/2160719 Tested: xfstests Upstream Status: upstream commit 28cf755 Author: Zhang Yi <yi.zhang@huawei.com> bh_submit_read() and the uptodate check logic in bh_uptodate_or_lock() has been integrated in bh_read() helper, so switch to use it directly. Link: https://lkml.kernel.org/r/20220901133505.2510834-14-yi.zhang@huawei.com Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit 28cf755) Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
1 parent 29e5b87 commit afa4906

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/ext2/balloc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
128128
struct ext2_group_desc * desc;
129129
struct buffer_head * bh = NULL;
130130
ext2_fsblk_t bitmap_blk;
131+
int ret;
131132

132133
desc = ext2_get_group_desc(sb, block_group, NULL);
133134
if (!desc)
@@ -141,10 +142,10 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group)
141142
block_group, le32_to_cpu(desc->bg_block_bitmap));
142143
return NULL;
143144
}
144-
if (likely(bh_uptodate_or_lock(bh)))
145+
ret = bh_read(bh, 0);
146+
if (ret > 0)
145147
return bh;
146-
147-
if (bh_submit_read(bh) < 0) {
148+
if (ret < 0) {
148149
brelse(bh);
149150
ext2_error(sb, __func__,
150151
"Cannot read block bitmap - "

0 commit comments

Comments
 (0)