Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp2128970rwp; Fri, 14 Jul 2023 00:52:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlEERxTJ25y53VAQClUExUTAUjFBrtWOnCFOlkKMaxr2xF07yMy/1ZU7flWBP1ERMpABGqFd X-Received: by 2002:a17:906:2213:b0:988:f93:32e8 with SMTP id s19-20020a170906221300b009880f9332e8mr3939888ejs.26.1689321177974; Fri, 14 Jul 2023 00:52:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689321177; cv=none; d=google.com; s=arc-20160816; b=TMSMMGjPdgQhvj2SEylx2zDlHjMMC7N2hd3UJiO4mnrklLANWaEccGuPAlxUBh8239 vTNymi1bY63EnFfj182N+8iENlE8PA+uM78xhgFgHlA0JRjBtKZD99BcY4Vu8KGcUHJv 3fQzSWoy1sk13yuJP4Ye2E8DIqyuKEKJMDHXQnvoPXEVLyWOblTmROZcV+lOBUdqpdDU xDiGebfRBLnsv/vWCz31rZIOAQJQznHVIFaSyDoD+JZqRWorEWesOs3gYPYRTt7z1caf +6dxe+gnoQj8xGBL8LswXEc6XpLzUi/9+By+V3V6QT71IsckiRRbsd5xvDbzsqzZFCCp 2W+A== 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=Oi0UZ5ys0+JCMzjNx8pLfW28DZeUX1tJu4pF3Gnzbpw=; b=fjRODDF/FjieeU6WBhpIFpXq8gmeQfVAMrl5N8A597godS4IqMRczv5qRRh28h/BWA ffOn/aq/bn+peXjoZUmlwm4ar6WR0/Whr+kMY8OTL0h+xHcLpxwwFpjOgsPKnABH2EGh A33ehsMMrWS7voL39g7T5Qcq+MSNsKZSf9jYr6TYaHja+a4uAIT7Wy9nS+INWCt3PJRL 3e7/oHNZ4q8RSOaHSeTxjVC8T6DINiPyFiKJJOLifJOMYOnbxebh72oMQfL8TlzuW8jJ peRgGpXWLmfbUAAlL0Kfn9/WdNKnhWnVu+pGZVrTmKFSfctN2g0giWvl2379Eedw/5fl uBNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@metaspace-dk.20221208.gappssmtp.com header.s=20221208 header.b=3y7lQ5pB; 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 op10-20020a170906bcea00b00991f9e2a81asi9242138ejb.238.2023.07.14.00.52.32; Fri, 14 Jul 2023 00:52:57 -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=3y7lQ5pB; 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 S233975AbjGNHZc (ORCPT + 99 others); Fri, 14 Jul 2023 03:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234678AbjGNHZ2 (ORCPT ); Fri, 14 Jul 2023 03:25:28 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29102723 for ; Fri, 14 Jul 2023 00:25:26 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fb94b1423eso2745517e87.1 for ; Fri, 14 Jul 2023 00:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20221208.gappssmtp.com; s=20221208; t=1689319525; x=1689924325; 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=3y7lQ5pB6aU5w2NYLHZyCpC3h2fedz/S7KPBC8S0fQKNsW5rbgTRd+0DQxRfoBTe9G 9Og2eZ1tWDFoLcw2TQvfyA5iZG4NTLc0qYfQag2YCVKrsz1eTcbe98M6lvY5vcUx5Sb1 k5MH5cszbsJ5Y0ukpV0A4qy9KfNcZBxjM1t+8DVaFTvSpll45Fs7v3LTqVBc74ixo8O3 cWm2QoOXiDrzA5opBYb1WTZ2AbiuG7Yr0Zyl8XA00SMY8ObqTK/aoX+1XtHwFbckZwSt 10MJiBoD8701fLM9wrZiMM+EFdh0tzDkEp7toGKqa/1iU2CB9XXDAj63hrQlkASBN0Sx 4qLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689319525; x=1689924325; 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=BiMjUyD+yJqhrB+sFmc0BrFmyG9D3EZHOWLXTuciAJRqdksZQGD0iqEsayDnTJ7F50 tpRex/+ovDqgSRepbWT7klG42gbh8sLWgFuBDEw6jtZqdL0A2dHcVL0Zz8nTZ1Gva3Ae dT+cvtoSBT0kdYczf6QYbN8mQN7gFJlbiBtzKuoK3dyHLt11PTrHN99I9KL9RNwmwWVB rLXAUZqmKkD+hyPFeTBYmUUiP4M3vq8eqQn+w8bobp1S9H3rsCtibLqJppn8jYvpwEed cQi+XFvOFcpXocmMH5VLI3ugJIljKSVj1Axg+rfg5vxpypceuXsR4AsGVJbPayYa6qDD OYZQ== X-Gm-Message-State: ABy/qLaTPKQFL6oEWxbOP9sS4TQnlYsoa67ithfXBbaom5t6Pb8z+Jjk 83i6h30vm3nSLII9RQ2SHGFrfw== X-Received: by 2002:a19:2d53:0:b0:4fb:7be5:4870 with SMTP id t19-20020a192d53000000b004fb7be54870mr2960808lft.46.1689319525103; Fri, 14 Jul 2023 00:25:25 -0700 (PDT) Received: from localhost ([185.108.254.55]) by smtp.gmail.com with ESMTPSA id p12-20020a05651238cc00b004fa4323ec97sm1372952lft.301.2023.07.14.00.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 00:25:24 -0700 (PDT) From: Andreas Hindborg To: Ming Lei Cc: Matias Bjorling , linux-kernel@vger.kernel.org (open list), Damien Le Moal , Jens Axboe , gost.dev@samsung.com, Christoph Hellwig , Andreas Hindborg , Johannes Thumshirn , Aravind Ramesh , linux-block@vger.kernel.org (open list:BLOCK LAYER), Hans Holmberg , Minwoo Im Subject: [PATCH v9 1/2] ublk: add helper to check if device supports user copy Date: Fri, 14 Jul 2023 09:25:09 +0200 Message-ID: <20230714072510.47770-2-nmi@metaspace.dk> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230714072510.47770-1-nmi@metaspace.dk> References: <20230714072510.47770-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