aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/dm-bufio.h
diff options
context:
space:
mode:
authorHongyu Jin <hongyu.jin@unisoc.com>2024-01-24 13:35:54 +0800
committerMike Snitzer <snitzer@kernel.org>2024-02-20 14:22:55 -0500
commite9b2238e47cb66521381c0bf9234e979afa19d77 (patch)
tree19b73de3634979bc1fef64ea082e9c330d504b2f /include/linux/dm-bufio.h
parentdm io: Support IO priority (diff)
downloadwireguard-linux-e9b2238e47cb66521381c0bf9234e979afa19d77.tar.xz
wireguard-linux-e9b2238e47cb66521381c0bf9234e979afa19d77.zip
dm bufio: Support IO priority
Some IO will dispatch from kworker with different io_context settings than the submitting task, we may need to specify a priority to avoid losing priority. Add dm_bufio_read_with_ioprio() and dm_bufio_prefetch_with_ioprio() for use by bufio users to pass an ioprio other than IOPRIO_DEFAULT. Co-developed-by: Yibin Ding <yibin.ding@unisoc.com> Signed-off-by: Yibin Ding <yibin.ding@unisoc.com> Signed-off-by: Hongyu Jin <hongyu.jin@unisoc.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Mikulas Patocka <mpatocka@redhat.com> [snitzer: introduced _with_ioprio() wrappers to reduce churn] Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'include/linux/dm-bufio.h')
-rw-r--r--include/linux/dm-bufio.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/dm-bufio.h b/include/linux/dm-bufio.h
index 75e7d8cbb532..d1503b815a78 100644
--- a/include/linux/dm-bufio.h
+++ b/include/linux/dm-bufio.h
@@ -64,6 +64,9 @@ void dm_bufio_set_sector_offset(struct dm_bufio_client *c, sector_t start);
void *dm_bufio_read(struct dm_bufio_client *c, sector_t block,
struct dm_buffer **bp);
+void *dm_bufio_read_with_ioprio(struct dm_bufio_client *c, sector_t block,
+ struct dm_buffer **bp, unsigned short ioprio);
+
/*
* Like dm_bufio_read, but return buffer from cache, don't read
* it. If the buffer is not in the cache, return NULL.
@@ -86,6 +89,10 @@ void *dm_bufio_new(struct dm_bufio_client *c, sector_t block,
void dm_bufio_prefetch(struct dm_bufio_client *c,
sector_t block, unsigned int n_blocks);
+void dm_bufio_prefetch_with_ioprio(struct dm_bufio_client *c,
+ sector_t block, unsigned int n_blocks,
+ unsigned short ioprio);
+
/*
* Release a reference obtained with dm_bufio_{read,get,new}. The data
* pointer and dm_buffer pointer is no longer valid after this call.