diff options
author | Andreas Hindborg <a.hindborg@samsung.com> | 2023-08-04 13:46:08 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-08-08 23:45:53 +0200 |
commit | 9d4ed6d46272bb60036a6539aae74eafcbbb3d2d (patch) | |
tree | dad5b29a656714106aaf7aed61abd2ffb8c3c779 /drivers/block | |
parent | iocost_monitor: improve it by adding iocg wait_ms (diff) | |
download | linux-9d4ed6d46272bb60036a6539aae74eafcbbb3d2d.tar.xz linux-9d4ed6d46272bb60036a6539aae74eafcbbb3d2d.zip |
ublk: add helper to check if device supports user copy
This will be used by ublk zoned storage support.
Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20230804114610.179530-2-nmi@metaspace.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ublk_drv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 1c823750c95a..8d271901efac 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -185,6 +185,11 @@ struct ublk_params_header { __u32 types; }; +static inline bool ublk_dev_is_user_copy(const struct ublk_device *ub) +{ + return ub->dev_info.flags & UBLK_F_USER_COPY; +} + static inline void __ublk_complete_rq(struct request *req); static void ublk_complete_rq(struct kref *ref); @@ -2037,7 +2042,7 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd) UBLK_F_URING_CMD_COMP_IN_TASK; /* GET_DATA isn't needed any more with USER_COPY */ - if (ub->dev_info.flags & UBLK_F_USER_COPY) + if (ublk_dev_is_user_copy(ub)) ub->dev_info.flags &= ~UBLK_F_NEED_GET_DATA; /* We are not ready to support zero copy */ |