diff options
| author | zhangyi (F) <[email protected]> | 2020-09-24 07:33:33 +0000 |
|---|---|---|
| committer | Theodore Ts'o <[email protected]> | 2020-10-18 14:37:14 +0000 |
| commit | 2d069c0889ef0decda7af6ecbdc63b680b767749 (patch) | |
| tree | 11795ab514648fd4e5f814420e8ff4793215a6ba /fs/ext4/mmp.c | |
| parent | ext4: introduce new metadata buffer read helpers (diff) | |
| download | kernel-2d069c0889ef0decda7af6ecbdc63b680b767749.tar.gz kernel-2d069c0889ef0decda7af6ecbdc63b680b767749.zip | |
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) <[email protected]>
Suggested-by: Jan Kara <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
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; |
