Commit 9d4ed6d4 authored by Andreas Hindborg's avatar Andreas Hindborg Committed by Jens Axboe
Browse files

ublk: add helper to check if device supports user copy

parent 68392b00
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 */