mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 05:02:31 +00:00
f2fs: keep io_flags to avoid IO split due to different op_flags in two fio holders
Let's attach io_flags to bio only, so that we can merge IOs given original
io_flags only.
Fixes: 64bf0eef01
("f2fs: pass the bio operation to bio_alloc_bioset")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
930e260763
commit
0adc2ab0e8
@ -388,11 +388,23 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
|
||||
static unsigned int f2fs_io_flags(struct f2fs_io_info *fio)
|
||||
{
|
||||
unsigned int temp_mask = (1 << NR_TEMP_TYPE) - 1;
|
||||
unsigned int fua_flag = io_flag & temp_mask;
|
||||
unsigned int meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
|
||||
unsigned int fua_flag, meta_flag, io_flag;
|
||||
unsigned int op_flags = 0;
|
||||
|
||||
if (fio->op != REQ_OP_WRITE)
|
||||
return 0;
|
||||
if (fio->type == DATA)
|
||||
io_flag = fio->sbi->data_io_flag;
|
||||
else if (fio->type == NODE)
|
||||
io_flag = fio->sbi->node_io_flag;
|
||||
else
|
||||
return 0;
|
||||
|
||||
fua_flag = io_flag & temp_mask;
|
||||
meta_flag = (io_flag >> NR_TEMP_TYPE) & temp_mask;
|
||||
|
||||
/*
|
||||
* data/node io flag bits per temp:
|
||||
@ -401,9 +413,10 @@ static void __attach_io_flag(struct f2fs_io_info *fio, unsigned int io_flag)
|
||||
* Cold | Warm | Hot | Cold | Warm | Hot |
|
||||
*/
|
||||
if ((1 << fio->temp) & meta_flag)
|
||||
fio->op_flags |= REQ_META;
|
||||
op_flags |= REQ_META;
|
||||
if ((1 << fio->temp) & fua_flag)
|
||||
fio->op_flags |= REQ_FUA;
|
||||
op_flags |= REQ_FUA;
|
||||
return op_flags;
|
||||
}
|
||||
|
||||
static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
|
||||
@ -413,14 +426,10 @@ static struct bio *__bio_alloc(struct f2fs_io_info *fio, int npages)
|
||||
sector_t sector;
|
||||
struct bio *bio;
|
||||
|
||||
if (fio->type == DATA)
|
||||
__attach_io_flag(fio, sbi->data_io_flag);
|
||||
else if (fio->type == NODE)
|
||||
__attach_io_flag(fio, sbi->node_io_flag);
|
||||
|
||||
bdev = f2fs_target_device(sbi, fio->new_blkaddr, §or);
|
||||
bio = bio_alloc_bioset(bdev, npages, fio->op | fio->op_flags, GFP_NOIO,
|
||||
&f2fs_bioset);
|
||||
bio = bio_alloc_bioset(bdev, npages,
|
||||
fio->op | fio->op_flags | f2fs_io_flags(fio),
|
||||
GFP_NOIO, &f2fs_bioset);
|
||||
bio->bi_iter.bi_sector = sector;
|
||||
if (is_read_io(fio->op)) {
|
||||
bio->bi_end_io = f2fs_read_end_io;
|
||||
|
Loading…
Reference in New Issue
Block a user