diff options
| author | Jaegeuk Kim <jaegeuk@kernel.org> | 2025-02-04 10:06:35 -0800 |
|---|---|---|
| committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2025-02-12 02:29:30 +0000 |
| commit | 5f95c1812a65e4e8a6b89b6c0bafd654e8bc03de (patch) | |
| tree | f30003f7920c0cc75f9e4c0241076a407fa5e01a /fs/f2fs/data.c | |
| parent | 4f91f074702af3931a35c244470ae0c4b66f909c (diff) | |
f2fs: add ioctl to get IO priority hint
This patch adds an ioctl to give a per-file priority hint to attach
REQ_PRIO.
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
| -rw-r--r-- | fs/f2fs/data.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 07b46b444d31..24c5cb1f5ada 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -413,6 +413,7 @@ int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr) static blk_opf_t f2fs_io_flags(struct f2fs_io_info *fio) { unsigned int temp_mask = GENMASK(NR_TEMP_TYPE - 1, 0); + struct folio *fio_folio = page_folio(fio->page); unsigned int fua_flag, meta_flag, io_flag; blk_opf_t op_flags = 0; @@ -438,6 +439,11 @@ static blk_opf_t f2fs_io_flags(struct f2fs_io_info *fio) op_flags |= REQ_META; if (BIT(fio->temp) & fua_flag) op_flags |= REQ_FUA; + + if (fio->type == DATA && + F2FS_I(fio_folio->mapping->host)->ioprio_hint == F2FS_IOPRIO_WRITE) + op_flags |= REQ_PRIO; + return op_flags; } |
