2023-07-11 07:36:32

by Andreas Hindborg

[permalink] [raw]
Subject: [PATCH v8 1/2] ublk: add helper to check if device supports user copy

From: Andreas Hindborg <[email protected]>

This will be used by ublk zoned storage support.

Signed-off-by: Andreas Hindborg <[email protected]>
---
drivers/block/ublk_drv.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

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 */
--
2.41.0



2023-07-12 15:22:16

by Ming Lei

[permalink] [raw]
Subject: Re: [PATCH v8 1/2] ublk: add helper to check if device supports user copy

On Tue, Jul 11, 2023 at 09:23:52AM +0200, Andreas Hindborg wrote:
> From: Andreas Hindborg <[email protected]>
>
> This will be used by ublk zoned storage support.
>
> Signed-off-by: Andreas Hindborg <[email protected]>
> ---

Reviewed-by: Ming Lei <[email protected]>

BTW, both Damien and I have reviewed this one, and you can put the
reviewed-by tag in patch.

Thanks,
Ming


2023-07-14 21:41:02

by Andreas Hindborg

[permalink] [raw]
Subject: Re: [PATCH v8 1/2] ublk: add helper to check if device supports user copy


Ming Lei <[email protected]> writes:

> On Tue, Jul 11, 2023 at 09:23:52AM +0200, Andreas Hindborg wrote:
>> From: Andreas Hindborg <[email protected]>
>>
>> This will be used by ublk zoned storage support.
>>
>> Signed-off-by: Andreas Hindborg <[email protected]>
>> ---
>
> Reviewed-by: Ming Lei <[email protected]>
>
> BTW, both Damien and I have reviewed this one, and you can put the
> reviewed-by tag in patch.

Argh, I knew there was something I forgot for v9. Sorry.

BR Andreas