diff options
author | zhangyi (F) <yi.zhang@huawei.com> | 2020-09-24 15:33:33 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2020-10-18 10:37:14 -0400 |
commit | 2d069c0889ef0decda7af6ecbdc63b680b767749 (patch) | |
tree | 11795ab514648fd4e5f814420e8ff4793215a6ba /fs/ext4/mmp.c | |
parent | fa491b14cd9586ad703606ef0155cd43459d2b32 (diff) |
ext4: use common helpers in all places reading metadata buffers
Revome all open codes that read metadata buffers, switch to use
ext4_read_bh_*() common helpers.
Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
Suggested-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200924073337.861472-4-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/mmp.c')
-rw-r--r-- | fs/ext4/mmp.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c index d34cb8c46655..795c3ff2907c 100644 --- a/fs/ext4/mmp.c +++ b/fs/ext4/mmp.c @@ -85,15 +85,11 @@ static int read_mmp_block(struct super_block *sb, struct buffer_head **bh, } } - get_bh(*bh); lock_buffer(*bh); - (*bh)->b_end_io = end_buffer_read_sync; - submit_bh(REQ_OP_READ, REQ_META | REQ_PRIO, *bh); - wait_on_buffer(*bh); - if (!buffer_uptodate(*bh)) { - ret = -EIO; + ret = ext4_read_bh(*bh, REQ_META | REQ_PRIO, NULL); + if (ret) goto warn_exit; - } + mmp = (struct mmp_struct *)((*bh)->b_data); if (le32_to_cpu(mmp->mmp_magic) != EXT4_MMP_MAGIC) { ret = -EFSCORRUPTED; |