[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <451e842b-8233-2d85-00f4-d3a0bae1e694@kernel.org>
Date: Wed, 5 Jul 2023 08:43:58 +0900
From: Damien Le Moal <dlemoal@...nel.org>
To: Andreas Hindborg <nmi@...aspace.dk>, Ming Lei <ming.lei@...hat.com>
Cc: open list <linux-kernel@...r.kernel.org>,
Matias Bjorling <Matias.Bjorling@....com>,
Hans Holmberg <Hans.Holmberg@....com>,
Jens Axboe <axboe@...nel.dk>,
Minwoo Im <minwoo.im.dev@...il.com>,
Aravind Ramesh <Aravind.Ramesh@....com>, gost.dev@...sung.com,
"open list:BLOCK LAYER" <linux-block@...r.kernel.org>,
Christoph Hellwig <hch@...radead.org>,
Andreas Hindborg <a.hindborg@...sung.com>
Subject: Re: [PATCH v5 4/5] ublk: add helper to check if device supports user
copy
On 7/5/23 01:52, Andreas Hindborg wrote:
> From: Andreas Hindborg <a.hindborg@...sung.com>
>
> This will be used by ublk zoned storage support.
>
> Signed-off-by: Andreas Hindborg <a.hindborg@...sung.com>
Looks good.
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
> ---
> drivers/block/ublk.c | 2 +-
> drivers/block/ublk.h | 5 +++++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/ublk.c b/drivers/block/ublk.c
> index a0453619bf67..0b1ec102aaae 100644
> --- a/drivers/block/ublk.c
> +++ b/drivers/block/ublk.c
> @@ -1947,7 +1947,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 */
> diff --git a/drivers/block/ublk.h b/drivers/block/ublk.h
> index 2a4ab721d513..fcbcc6b02aa0 100644
> --- a/drivers/block/ublk.h
> +++ b/drivers/block/ublk.h
> @@ -100,4 +100,9 @@ struct ublk_io {
> struct io_uring_cmd *cmd;
> };
>
> +static inline bool ublk_dev_is_user_copy(const struct ublk_device *ub)
> +{
> + return ub->dev_info.flags & UBLK_F_USER_COPY;
> +}
> +
> #endif
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists