Commit 6dc3a126 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: fix wrong __is_meta_io() macro

This patch changes codes as below:
- don't use is_read_io() as a condition to judge the meta IO.
- use .is_por to replace .is_meta to indicate IO is from recovery explicitly.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent ea6d7e72
...@@ -66,7 +66,7 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index, ...@@ -66,7 +66,7 @@ static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
.old_blkaddr = index, .old_blkaddr = index,
.new_blkaddr = index, .new_blkaddr = index,
.encrypted_page = NULL, .encrypted_page = NULL,
.is_meta = is_meta, .is_por = !is_meta,
}; };
int err; int err;
...@@ -189,7 +189,7 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, ...@@ -189,7 +189,7 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
.op_flags = sync ? (REQ_META | REQ_PRIO) : REQ_RAHEAD, .op_flags = sync ? (REQ_META | REQ_PRIO) : REQ_RAHEAD,
.encrypted_page = NULL, .encrypted_page = NULL,
.in_list = false, .in_list = false,
.is_meta = (type != META_POR), .is_por = (type == META_POR),
}; };
struct blk_plug plug; struct blk_plug plug;
......
...@@ -456,7 +456,8 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) ...@@ -456,7 +456,8 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
fio->encrypted_page : fio->page; fio->encrypted_page : fio->page;
if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr, if (!f2fs_is_valid_blkaddr(fio->sbi, fio->new_blkaddr,
__is_meta_io(fio) ? META_GENERIC : DATA_GENERIC)) fio->is_por ? META_POR :
(__is_meta_io(fio) ? META_GENERIC : DATA_GENERIC)))
return -EFAULT; return -EFAULT;
trace_f2fs_submit_page_bio(page, fio); trace_f2fs_submit_page_bio(page, fio);
......
...@@ -1041,7 +1041,7 @@ struct f2fs_io_info { ...@@ -1041,7 +1041,7 @@ struct f2fs_io_info {
bool submitted; /* indicate IO submission */ bool submitted; /* indicate IO submission */
int need_lock; /* indicate we need to lock cp_rwsem */ int need_lock; /* indicate we need to lock cp_rwsem */
bool in_list; /* indicate fio is in io_list */ bool in_list; /* indicate fio is in io_list */
bool is_meta; /* indicate borrow meta inode mapping or not */ bool is_por; /* indicate IO is from recovery or not */
bool retry; /* need to reallocate block address */ bool retry; /* need to reallocate block address */
enum iostat_type io_type; /* io type */ enum iostat_type io_type; /* io type */
struct writeback_control *io_wbc; /* writeback control */ struct writeback_control *io_wbc; /* writeback control */
...@@ -2831,8 +2831,7 @@ static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi, ...@@ -2831,8 +2831,7 @@ static inline void f2fs_update_iostat(struct f2fs_sb_info *sbi,
#define __is_large_section(sbi) ((sbi)->segs_per_sec > 1) #define __is_large_section(sbi) ((sbi)->segs_per_sec > 1)
#define __is_meta_io(fio) (PAGE_TYPE_OF_BIO((fio)->type) == META && \ #define __is_meta_io(fio) (PAGE_TYPE_OF_BIO((fio)->type) == META)
(!is_read_io((fio)->op) || (fio)->is_meta))
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi, bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
block_t blkaddr, int type); block_t blkaddr, int type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment