Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28316183rwd; Tue, 4 Jul 2023 17:28:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlHkihb+Tw8vym/BPmwRsI6vynFCqgsSnudweZPVUCq9RCeXrrvByY5ifl6cFxFvj2rHcFcl X-Received: by 2002:a05:6808:114b:b0:3a3:96db:8da8 with SMTP id u11-20020a056808114b00b003a396db8da8mr9667828oiu.32.1688516930754; Tue, 04 Jul 2023 17:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688516930; cv=none; d=google.com; s=arc-20160816; b=elwhWOzyCm2n8eEy3OQXlC2WuVvgDakwX+NFAwQU7O0KfyHff+MQKCwdKkgRC2qVUi I0wTrtp+hqK90niy44ci+jsfSmCkJITnZZb2Kx8woEqvX0IYyPKEs2u3KLF2+sgsqw+D lUOrE4BF+i/cVROyRtLk89QmnOq985NiXYLX2pypT6bsqhAkKl7mDjjN/Yes4HStpy6G nodLODWSNqbLsQ6Zz8JW1sf5em6IWvk7tiIMia8bDrtxxn7kIcipP2/SNjx/hAP0LJZF eL8SDGd0uziZGLFygkR/9rIqbQNpIk75mksMMu6x6ND+lCV3Cc0qofaS+UbJRMUVnJZE qXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=p7RTErHvpa5W25Vm3YP0r5GxjD1GtxdHTRHcmFyzSHQ=; fh=iMPekPHZZnx0/sz0ha4Rn4d8gXBiV+BUtgFT05msYfA=; b=UTBpvujbEd0VUXoLJC4hyJHzNICPnu61QRi85KxxG2jFKU/ecE/xJpei78XXEDdbB5 32idx39jdzhv5+UsHJIFrYuqgcPdE4xskKpFWbZil2oC1CQFFh0YnDHpuP8lnW+QDz7n u9wbZYS3H0BYgINjSZ5CGLcNDnHWax0xGOcCX+uge2FmTmqBRcCzyXxCfEGGGsSdvPpB GxvCBa8RoSfKSUGlv96ftHvmVVGBYU8yyZAOfluh7jockDf2HAeOHKWpuDa1MfSYy+9+ 5THh+J75LCJr3nphMBdQ+nHEPRh1GRIhnvnkgH4X79izvdmsKkpOjBGMlsOwBE2HotFO sfBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CKS9UMP+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu4-20020a17090b1b0400b0025669d0176asi446741pjb.134.2023.07.04.17.28.36; Tue, 04 Jul 2023 17:28:50 -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=@kernel.org header.s=k20201202 header.b=CKS9UMP+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbjGDXoD (ORCPT + 99 others); Tue, 4 Jul 2023 19:44:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230259AbjGDXoC (ORCPT ); Tue, 4 Jul 2023 19:44:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1998B133; Tue, 4 Jul 2023 16:44:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ABE1861405; Tue, 4 Jul 2023 23:44:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA50FC433C7; Tue, 4 Jul 2023 23:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688514241; bh=ceayCKM3+x6ed5rZZm2T8UQm1FTZPyFU9zOczId87uI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CKS9UMP+8Jd5GwgH+mtjfRSJQkZ9xonvTumDGZUqoYbJzW/83bsl23P6i2E3Mdou6 dyDutVrDe3/IUaypeYZ3FiefL+ruoidHj3gHgV/sHb7rtAG9j3X1tslOmNAYPF3yYq UFpgUDlms0c9IMKFCwfVjjo8+saub4ZvyVD2b5p3QaoZ1dDd6inFuveguWdUsrSlFe cfx9yfknL4jGzQR7O6iLz4eKrCfHP/AZ4Z2LMZuY3XMjeaV+HJCPQNQyZ7b6jn2dG2 OK0MTSgMHhkUSR6Ui/Ba0DiO/N9K45urH+eOMppLzTijnbxewdtys+khF9XVPoU7ey 4eYO8+Xh2pvWA== Message-ID: <451e842b-8233-2d85-00f4-d3a0bae1e694@kernel.org> Date: Wed, 5 Jul 2023 08:43:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v5 4/5] ublk: add helper to check if device supports user copy Content-Language: en-US To: Andreas Hindborg , Ming Lei Cc: open list , Matias Bjorling , Hans Holmberg , Jens Axboe , Minwoo Im , Aravind Ramesh , gost.dev@samsung.com, "open list:BLOCK LAYER" , Christoph Hellwig , Andreas Hindborg References: <20230704165209.514591-1-nmi@metaspace.dk> <20230704165209.514591-5-nmi@metaspace.dk> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20230704165209.514591-5-nmi@metaspace.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,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 On 7/5/23 01:52, Andreas Hindborg wrote: > From: Andreas Hindborg > > This will be used by ublk zoned storage support. > > Signed-off-by: Andreas Hindborg Looks good. Reviewed-by: Damien Le Moal > --- > 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 -- Damien Le Moal Western Digital Research