Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36438269rwd; Tue, 11 Jul 2023 00:36:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFauL8XOhqlqw0VGuNRdJqceqzrd4WvrPXO8yY/2oIiHy5UjAqmPpgECcu7TrNSsKOvhy7n X-Received: by 2002:a05:6358:9206:b0:134:dc90:b7d1 with SMTP id d6-20020a056358920600b00134dc90b7d1mr11559200rwb.25.1689060992215; Tue, 11 Jul 2023 00:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689060992; cv=none; d=google.com; s=arc-20160816; b=Ky8wbeHjMcR9KM92gXnxtIbLiX9jXDRfjgl2xYPxeOKDUVkkqnoQg77W+R8h8rO/Jz G/0nkuiamONTkQkOdH3GWydXJvfZ1ipu4vtFzYAve2d6AiIXSGw4Dqa3cVr4jF72J5PO /kgyjoeySM3qqPuEyvqu245qKjOJX60uw7mArQ7LRdUgrkDXCT123Y0DEeljTSW5phUt U/dWRv8RiBoCu55xPds2BtJDCyw1Dt/x/0P8d0UUH2UXvt8PclZ9JEldK7jE5/5cJGEK OCuXNKqNaZNzDFA46EJtFiHrgAJNWeqN9G2sNjZWUVCmrqt5HIwJz358ofLNZynzwy9G 5bWQ== 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=focX8nBuBNMfP3yvQTZ90we/dxGl+5x2+q++Ze1GKL4=; b=UAGZ7E8Hz2wZQ8qOvqiDkFkPosZDmbMmLcPSPBtQxOSAnoHkI1L6GTegEiM4w3DRvc KXQlttJNOwqxNV6okqvC+lKZKpuKNgYsfYDBrvMQLU2OyPDnXqYYviQaQTE6ExgpzYQy pf/jqCYQql8Wb8uOykZmGafJeW71px6qqFZmBuailh7ilRorJXBojLPRnMeYrqTt/qQr LaSuo6xWFZTyOhyHTtOre9wHYcdWoOVlpUS+WW9DmBHjdKnu0cZ62Q1yRO7BgjsZgH2h wZbzoqswQwyjwzpQVQZzozv2Xqn5zTXjn0u+mseJWP2KsvTz/tmVEhf7XpQaQAxzQmKR 4gsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=Ftypam7p; 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 bs185-20020a6328c2000000b00553b02a9a17si1015681pgb.256.2023.07.11.00.36.19; Tue, 11 Jul 2023 00:36:32 -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=Ftypam7p; 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 S230462AbjGKHYK (ORCPT + 99 others); Tue, 11 Jul 2023 03:24:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230018AbjGKHYI (ORCPT ); Tue, 11 Jul 2023 03:24:08 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCAB3E73 for ; Tue, 11 Jul 2023 00:24:05 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-4fbbfaacfc1so8526305e87.1 for ; Tue, 11 Jul 2023 00:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1689060244; x=1691652244; 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=Ftypam7peF0jzVg1jOvJGykz+ctIhQtlZw9llhkyUUbT5jfcOz2NmfqvHqqQjxymx/ TSBs8G4zUCEPFFMORMYNJwU2gf8PWgaF8fm/Lmw1+asDemT/L7Q6Fqqq5nsD6sxNLcFQ CLKrsWdjxq79XTDMdsaRq0x1ebYoMl7MexdqdAVHxW8Hwm9TXzjuEu+4+UZwJspiN0kX 7IdFVFoqRNEtTjp9HvhUiGZ/RjY0ZHscDP6tI0iaWjm0ti26N/85za5ra+bn3FIkK/vq OSnVg+RccPykMBoVKEVz7gro2oKGkkGjcF8JOeyeYrHiK/UjVaOogzXhNJ5k/DF52qp6 DyFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689060244; x=1691652244; 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=G8PULLT1oo5/Asn/+68fqvlbQx7HMK3Xqgc+q5WqXFMA19lET2L3+tbKGYDejBOuXQ b29MBiHh2tkxE953AFVuBS7v1uVlUT/4XRyl9D+tuKPW56Ii8/mH1beH91tqGJyr0jaw F0+zsPC+orbXrGns9nIk28ELEXcpbJaE026oBpBHEii4+SV9qtiRItjvZyHrYgyt6loY RRNeWL72wMN53w+gOR9s5sMTIsMEFO7kZSw5YgxTp3tLwKqIq/aTuc4FG0MFU8j8hCjD stnfx8hIQioo5vB9r4PiMDLzl10MP2qwHPNJR+YFkiOTGJVc9Hu5vzerK/oppT3XdG6t Y99Q== X-Gm-Message-State: ABy/qLZ+mjPJNXvEBeRG7l09q0DMFnew1MPkD1iDRfGoJv32Kk9rwh3t UFHMc7bf5/1tQwcXCIhBF6HpQQ== X-Received: by 2002:a19:645e:0:b0:4fb:8948:2b2b with SMTP id b30-20020a19645e000000b004fb89482b2bmr10837808lfj.48.1689060244068; Tue, 11 Jul 2023 00:24:04 -0700 (PDT) Received: from localhost ([185.108.254.55]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004fbb0ccbc9csm206562lfp.83.2023.07.11.00.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jul 2023 00:24:03 -0700 (PDT) From: Andreas Hindborg To: Ming Lei Cc: Hans Holmberg , Jens Axboe , Matias Bjorling , linux-block@vger.kernel.org (open list:BLOCK LAYER), Christoph Hellwig , gost.dev@samsung.com, linux-kernel@vger.kernel.org (open list), Andreas Hindborg , Aravind Ramesh , Damien Le Moal , Minwoo Im , Johannes Thumshirn Subject: [PATCH v8 1/2] ublk: add helper to check if device supports user copy Date: Tue, 11 Jul 2023 09:23:52 +0200 Message-ID: <20230711072353.200873-2-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230711072353.200873-1-nmi@metaspace.dk> References: <20230711072353.200873-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, 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