Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27952185rwd; Tue, 4 Jul 2023 10:11:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DCktboTEGzMM0yZi3yYreQ5d2HdkixpQs4dgIro2nmuh6sGCPrPfHBz1aBGh85RWNBylu X-Received: by 2002:a9d:7f9a:0:b0:6b7:4036:4fce with SMTP id t26-20020a9d7f9a000000b006b740364fcemr14549541otp.9.1688490674637; Tue, 04 Jul 2023 10:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688490674; cv=none; d=google.com; s=arc-20160816; b=CdIwfFC3tvpM0t+lXCszLB8jdtD2vfYpg63jGYOzv5lC01EPnuGuZv8wKsJdrycx4s qpW15GOYh4fnjnQ+cKoNMkg212VVvKWiB4v0B1nCLcflbtNWeAz27j2GEkaDUNW3xFWQ XfB2odyn06Iu92+aASe7Y5vgQv1A7poAdhmKbYjSKvdga/i+2jomlwZFTm85SKs/BDH1 sqbXhCphcpxYqH68ahQ6aT3Q4HbEv287U4d0eQHI7QGQvPoRpNNmMaJFAdZ+adz84m6d dKC+qY7kBwqDqJ68eoqY1VMGaw9f74S8crPWLs+NqKc7RSNZSL863fBEtUl4+++bKVL6 cHaA== 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=kerXQTH1dAySlTElaGBSfiCF85mcj9UpEbZgolqgBfs=; fh=JwN0p46ZlpvloRQl/55YovaDle/zmEWTwso8DKF8XUk=; b=vkce74W87tlpA5o77FO6TqIExemibMAxLfEXAmeDo1EkDzck6xgPy/Rr6hgzFplmBe qGuWIMDWsw1Nc851d2r9PV5zoqkhbxsE2qytakg0I7gWuyrPmae8XQS41JahZ1Uonypc CB1EMT6CVqNVDhJGVKSS9kw0gU7yrgwY5Nt+MhPgYt7BzkEQV9BRM5u6H/E9jhS/yIUV Bxgi84x2TJUkTRyq96LLV30MC2jmTIK+tclg1Od0shMkBYXtYGvoH39/oERRWTaqEmli 6Fmpp47YNo9pMHqhzoty5iBJKvwE8TpmChuBd2qPcJ11jKdxRztLq1bn0Jk+hE9OEzEz L5dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=P8TZLt+1; 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 i62-20020a638741000000b0053fb7968569si20893819pge.429.2023.07.04.10.10.59; Tue, 04 Jul 2023 10:11:14 -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=P8TZLt+1; 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 S231773AbjGDQw2 (ORCPT + 99 others); Tue, 4 Jul 2023 12:52:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231535AbjGDQwX (ORCPT ); Tue, 4 Jul 2023 12:52:23 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2899710D5 for ; Tue, 4 Jul 2023 09:52:21 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-98377c5d53eso678294366b.0 for ; Tue, 04 Jul 2023 09:52:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1688489539; x=1691081539; 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=kerXQTH1dAySlTElaGBSfiCF85mcj9UpEbZgolqgBfs=; b=P8TZLt+1iMw/L7r0tZACsMST9Y8BUHGj1lAZtCsqY0Npj4VwghEArRmx/9vTR+lx3H Zmsn906MCbl2K6oAIhjvpUvDL6XsbJkD0xd6p10uPhZnTj0H/waRssXsK2kafcMK3Jpr eC1rtmCHpjyxOhkOW7YE6ZwY6CIpn/MGxh2dOjqlTntRiWoEO3fhoT+3AEC8B8e97rdd SrgxFbfzEqnQfsd0Qdss1xyLs2chavG2Tskkds/qxENIaeB17c6rNwj5c6TYf1Jy6/Bw Tby0JvFq/Jc7Mwaf6JrmJ/2aSHgw52LABuLY+aQi/X2YmLIUlmBTdml3y2P4zaDhluBc 9kIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688489539; x=1691081539; 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=kerXQTH1dAySlTElaGBSfiCF85mcj9UpEbZgolqgBfs=; b=jnje0DD66DWGiLAqQAWNon/wievS30+ZSHUbRE3lCoWM+1afpeNtUDS8c8qEUtnWcF Qzrx2E5CmxTmWPHiI6PdfBwgLMVzbHv86l0JO2FJC4AmFI5diRAsGRnXzGt7e8jMoYO0 Nzd7Rzmiwf3d5ViEOohXxlpxsGnqnihaqPFdBwaIq5D/ASxio0TgLCNpQrZwCvNahaU1 3nVdT/qAnrD8SXOxrkRCZUa8D69uJ+goseTnvAucylZxF0IVrsamZrqgmmec1Wp78wdT HUIFAoff/3cfAYB48J/ngPUPsXllBMjp20GSEwrnFnTEMDN78mE1TL/aQfearnlH0IzR GKZA== X-Gm-Message-State: ABy/qLYX4MeJteuQGnbTJ1a6HxYeDSuyLeF3t+I+btidSMVoOEHz2pL5 EXGmf3dKdgmtpdSVj9QLaEPqnw== X-Received: by 2002:a17:907:2ce6:b0:965:6075:d0e1 with SMTP id hz6-20020a1709072ce600b009656075d0e1mr12305216ejc.72.1688489539778; Tue, 04 Jul 2023 09:52:19 -0700 (PDT) Received: from localhost ([79.142.230.34]) by smtp.gmail.com with ESMTPSA id k12-20020a1709063e0c00b0098e2eaec394sm12378270eji.101.2023.07.04.09.52.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 09:52:19 -0700 (PDT) From: Andreas Hindborg To: Ming Lei Cc: linux-kernel@vger.kernel.org (open list), Matias Bjorling , Hans Holmberg , Jens Axboe , Minwoo Im , Aravind Ramesh , gost.dev@samsung.com, linux-block@vger.kernel.org (open list:BLOCK LAYER), Christoph Hellwig , Damien Le Moal , Andreas Hindborg Subject: [PATCH v5 4/5] ublk: add helper to check if device supports user copy Date: Tue, 4 Jul 2023 18:52:08 +0200 Message-ID: <20230704165209.514591-5-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230704165209.514591-1-nmi@metaspace.dk> References: <20230704165209.514591-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.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 -- 2.41.0