Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3482818rwo; Fri, 4 Aug 2023 05:47:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPcZfZFUCGKEMNkWiISfAB8x2KyrrvEMa4BuzW2tKR7G9zYe36L+8518N7eOCXHusC8Swa X-Received: by 2002:a17:90a:788d:b0:262:fc8a:ecf with SMTP id x13-20020a17090a788d00b00262fc8a0ecfmr1483675pjk.27.1691153227724; Fri, 04 Aug 2023 05:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691153227; cv=none; d=google.com; s=arc-20160816; b=BZgssV4U2b6tHOiYLDuOmxl52Hbzb0eGA3gCwhqzOfQaZZcicgkGSGs+QzgLtMUYk5 Og3BcO2IN2okUao6T0967en1cluifECAxw2qUomWhWi0flKmr2aS6viUJZOaqF8MyVWy DcsiOlNeh/GRErd9yVrGGw5300M1uIOo5SJ0YlDO1hujwUOHfvikl0F9k2pHsHWQFU8k F1mqH1IPHGQYQTeZ7Pe8xP6ceuScI6W0vr0bNLFAo5kwJ4PdxwCvz2hIfSNEb2xZ75gd GMIqM+QYQdksBTsS8zRPJTnJ9tENiJDUXbxRMwQy+VpGFa101e7ZJrkQxrFpVRaIa0jI byXg== 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=ngj/h6FVXWzaXcOU3qKFEOyCMSzua1y3RfSgTGuGcj4=; fh=MRpJHaAdGmAwVR88wnjM/og1keo0gVciJTCT+pKu/C4=; b=ERG77N7jSz04CI1O9ojrtlBtmf4tm+Mqz586+SYMsG6/i1vIRV8/QTxlt3L7hBjpQ3 cgmu0+8ihWb5jrtMDod3wmvpm1SVonce3r50q1rvxl0GdCpI9SZ+5NH4VeQL75HlsqZ+ famQw3TxfYNRoHueMrbQiSV4l8ZC2Ld6NewIpM3QLrH6wOLVodNlZiozRif+Rszth4iY MEXq0sAahnWg7fhkYeJiKjMpdMw7uaHl8zdb7egcSAZBqospZ2lP42HWPYu41FlNmw+f rAmcBcA12yPn2dEF4UHhcy124Bp13ORWDbuZ0Zq0CxsjoUdqWeTPNR1ewTErxidmH9lI ydng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=Gci5XiM2; 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 j10-20020a17090a318a00b002689d34ae8dsi5122531pjb.18.2023.08.04.05.46.55; Fri, 04 Aug 2023 05:47: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=Gci5XiM2; 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 S230270AbjHDLqY (ORCPT + 99 others); Fri, 4 Aug 2023 07:46:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjHDLqV (ORCPT ); Fri, 4 Aug 2023 07:46:21 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3CCE127 for ; Fri, 4 Aug 2023 04:46:13 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-99c1f6f3884so278068966b.0 for ; Fri, 04 Aug 2023 04:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1691149572; x=1691754372; 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=ngj/h6FVXWzaXcOU3qKFEOyCMSzua1y3RfSgTGuGcj4=; b=Gci5XiM2gbNQ3sH2Aw1TjX010iTrsiC/9UcDBGlVhKReHYHeXVQ3O6luHDQJe79H5T ipRqhTHQhdcmmWh7ySeumvysj3Dbmf/O04dTS6GIIN+7BfpLceEQKMSVuXE9zkrWfmlT znTpxK+OzdbsY0bt2WBs0Y2TTm+mw6rHGTnpHPaH66qjA2zmHAr1cJYNp/pOM5+SaGAY 8HAWPUFC/NsL9SI81AKtAd5c2LE2VkUGLHVGEvQCRxJU/TJ/UK2MfVkBlsYI5qIaDW8i mOWKzUywKPx3MY9fQ7lsc9Z3XAHwRDgCiBTtPgH+yGSoRqZc/+X+TXMtvYWEJYogvyn/ 9aCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691149572; x=1691754372; 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=ngj/h6FVXWzaXcOU3qKFEOyCMSzua1y3RfSgTGuGcj4=; b=OI0GfyxCoH60HwwmbI3W7Y+dCstwFdONZCPWkGhuxhk9dtNC4AWM6z2AiLWBB8Gh4A 2ga4+1vEP3oJvS30joh001P5LnTv0y0rplA05Xv3skkktesErwCnFfLBNYI6BTuwh4Qo NVPNaU9h9aGODZs9a/8lpgxfwtMFrnMX4gTmF1Y5CqK0fJzyL1s+55tr5fRp7rxVHqe4 UGTF/UqjiHCW7zQtvrwxz5/Q/QTHMpurdS7ZoJ1o9TMatstLvu/IKH37W88C6xSYyyej 2CBIKT2iGGnlCP7dW4Xd/TG5EVBQ37/XAphvRV9PpQWqErCiPmM4I7UxlAwpKMn0P7KC O+iA== X-Gm-Message-State: AOJu0YxreMCjmV6UkQdQY4/MOdlMNWQWFCBZutH/akzhUh2rcXXucp+l E2+f2uxhAk//o60PqGGnQeY0YQ== X-Received: by 2002:a17:906:2ca:b0:99c:9e69:6a19 with SMTP id 10-20020a17090602ca00b0099c9e696a19mr1528787ejk.18.1691149572527; Fri, 04 Aug 2023 04:46:12 -0700 (PDT) Received: from localhost ([194.62.217.4]) by smtp.gmail.com with ESMTPSA id gt7-20020a170906f20700b00988b86d6c7csm1189295ejb.132.2023.08.04.04.46.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 04:46:12 -0700 (PDT) From: "Andreas Hindborg (Samsung)" To: Ming Lei Cc: Aravind Ramesh , Christoph Hellwig , gost.dev@samsung.com, Minwoo Im , Hans Holmberg , Matias Bjorling , Damien Le Moal , Andreas Hindborg , Johannes Thumshirn , linux-kernel@vger.kernel.org (open list), Jens Axboe , linux-block@vger.kernel.org (open list:BLOCK LAYER), Johannes Thumshirn Subject: [PATCH v11 1/3] ublk: add helper to check if device supports user copy Date: Fri, 4 Aug 2023 13:46:08 +0200 Message-ID: <20230804114610.179530-2-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230804114610.179530-1-nmi@metaspace.dk> References: <20230804114610.179530-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_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 Reviewed-by: Ming Lei Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- 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 21d2e71c5514..db3523e281a6 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); @@ -2038,7 +2043,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