Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30454310rwd; Thu, 6 Jul 2023 06:15:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEReyRaVyqg60pAS0nO5+bMlTkCyL9g7jcRnY8YmnUZbL6/OUvfbLLocDhG6vlAu1cc8CQV X-Received: by 2002:a05:6358:3184:b0:129:c1dc:e6d8 with SMTP id q4-20020a056358318400b00129c1dce6d8mr1430130rwd.32.1688649307225; Thu, 06 Jul 2023 06:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688649307; cv=none; d=google.com; s=arc-20160816; b=bCX7Egvjihc1544BnUWo9t8QKt6bIOwMZRTBdWDuzQWawWNLuChfK1W1aC9ep0YoXc bqDjnRyuT+X0jXz/oK3i+RH9MhuO0zhmp21GERrpn+hfEc+B0v2+++f/c6dLVrQ0uPQH +vHz7yt2kyPmLg8UDE1Nxp+rtW/bma4g4huVQBBTMRPmORRwn9A/EaI0mXGYr+wszV24 bVNXhtvZ5gsrvLVHxlHVbz/9mUzTu6/lNUd58H3RY0kpzDtPrtNHmb0tDsiDQfz8KNxx U6gHElUvf9pkkq87pCIRQYEvAQ/43tykPi8i2ns4AXum4gB/JwlgXBslP904zCCrrlf2 Itgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gLXkkNKLC2QFI1E0y4rm62aHVfDJbTTFbFsFl9CT7J4=; fh=hMdgxxsl9tYkO69YX4aPzTvF7kBpDiInwjZJ/g4Eeno=; b=f5vEEEJWKbtM7LxW4QNJc/OTYe1WjOk1KKj08Epq8aZE3JO20U+Yx4zNkQGWNlWwtG ztGjMeGvY+rWGPFvw+Ga2RArYJmrp5/5E/fGX9sYjwcGHKhFy39mQ3cXX3MnhpTVb9QF G2NjfUK6MwoK75s0YfIfbUJwLOopAXUqll9nrQzcWQEqNFwfGXf5fns04L1HnTgbCwG7 HHh0D6IiapC27t9yos0+2j3FurNNFBot6AO73ozUCBFdPrxh7cWEjYBvWPa5OfpWzG01 GV2QUE4ABYonYUOy6L+lBdJUYR/+1L4jHCObx4sileUWxU46MnEBf1o9WkO22DbkiwIl 83Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=HCaK+Prq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u185-20020a6385c2000000b00553c2f8509esi1382866pgd.706.2023.07.06.06.14.53; Thu, 06 Jul 2023 06:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=HCaK+Prq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232442AbjGFNJl (ORCPT + 99 others); Thu, 6 Jul 2023 09:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjGFNJj (ORCPT ); Thu, 6 Jul 2023 09:09:39 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1304F1BF3 for ; Thu, 6 Jul 2023 06:09:35 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fb4146e8fcso5807745e9.0 for ; Thu, 06 Jul 2023 06:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1688648973; x=1691240973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gLXkkNKLC2QFI1E0y4rm62aHVfDJbTTFbFsFl9CT7J4=; b=HCaK+PrqspwGk54iH8oYp3wJQ5uxRgIn42NvEuBjDiaeAAgDfTHkpHQsHMbahhGoH1 RKXlQnPU9osRpZE7aC6KqnUcproBMndzGwFm6CQ36CZSudGdOBUiaUs2WMHz/DEZcEis RG53ughv1yul1OJUlwhicAkFdEM0HfLZy9ny5Eq68kSOeMauH4xHljsuZPXmS4IMSK0E M2zUkmMh6pI/62DwdUdVYi0dj8hYARngR0uWYLv6vxm+NnwEw9Pirc/525HDwglhYz1P QvhxtimiOuEb9U0siUR4f/66w8t44Meg+vnvFSKM0PEek2yAKri/mbwPlSJwWq1PYgBG Kp2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688648973; x=1691240973; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gLXkkNKLC2QFI1E0y4rm62aHVfDJbTTFbFsFl9CT7J4=; b=TYAk5J2kMowIUwygqZNjNJm9pvVnRfEurUq8zSXKHtG/TAAbfT2AC+qqhEGY/JDdTC bM5x2ouT+s6VFJsi1fv7SEQzdFqv3fZmPY/AqafKGW1+197dlhb59E9PUVxzrMduffQ2 WIF80yzQ6YUQBRXIyB/BeEH0JPPYP3/ybcdkDnDGbX7u6SePiZBx069CMXOzotYeh73H YvwbCjlB/8P9pKDolbWgGnmWvyQkNxqYKXJnyjiAKUoRivY9/9F0WFa0RKfIcjsiYJTy r1c6SFkElSmardfVNLxIU+U0PYvIcExD31KqUaGAvZfLRiWkduSwb88G4PiqT0HdVXmJ jmDg== X-Gm-Message-State: ABy/qLYbq7SVtp3+XDPav9eA5+MmZr+/cLgD09L9f0C0Lz0zLP5xfiCa qiZvBFY7YUPK6njVaOGedvxZJA== X-Received: by 2002:a05:600c:a6a2:b0:3fa:955a:9291 with SMTP id ip34-20020a05600ca6a200b003fa955a9291mr4923212wmb.9.1688648973370; Thu, 06 Jul 2023 06:09:33 -0700 (PDT) Received: from localhost ([147.161.155.79]) by smtp.gmail.com with ESMTPSA id h16-20020adff4d0000000b0031134bcdacdsm1869763wrp.42.2023.07.06.06.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 06:09:33 -0700 (PDT) From: Andreas Hindborg To: Ming Lei Cc: linux-kernel@vger.kernel.org (open list), linux-block@vger.kernel.org (open list:BLOCK LAYER), Andreas Hindborg , Minwoo Im , Matias Bjorling , gost.dev@samsung.com, Jens Axboe , Aravind Ramesh , Johannes Thumshirn , Hans Holmberg , Christoph Hellwig , Damien Le Moal Subject: [PATCH v6 2/3] ublk: add helper to check if device supports user copy Date: Thu, 6 Jul 2023 15:09:29 +0200 Message-ID: <20230706130930.64283-3-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230706130930.64283-1-nmi@metaspace.dk> References: <20230706130930.64283-1-nmi@metaspace.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Hindborg This will be used by ublk zoned storage support. Signed-off-by: Andreas Hindborg --- 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