Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2576023rdb; Fri, 22 Sep 2023 02:44:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbZ69jM4XMq9dIOTJqwFbL9dEvB2lex3rC18CB/KiU0yMp3ZkIozcLR6Z1Rf55z4ry0Egq X-Received: by 2002:a05:6871:551:b0:1b3:8cfd:fecf with SMTP id t17-20020a056871055100b001b38cfdfecfmr8457686oal.0.1695375892234; Fri, 22 Sep 2023 02:44:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695375892; cv=none; d=google.com; s=arc-20160816; b=tZOt5czVAxJqqrYjNcJngLlWFw6C7u529OJq53P1uhQoMtfk9zoBOqQxIkUOmWO0Xv dgGFmrXXi1OMqUsDPFSm5B5zZcSON1ZTxcEZDzpzvjV9WFR94bKMItXNothXU/FPUovB vbc/S6+zyISX8IK+bkKLQr7kqidg2r65qrOhBgSV0tmK3NdSPsJzzguQDEQbQgONSaU5 ukghiVstTIE3cKkx63V7i01kOH1kbE3jzcIDNCIKQIMRhwVu0jSgXHmqmhxHZZ9OUTMJ e2iygEDewEwKbJSKR/FssQJc9jilSEILa13xkba3Bgz+rLld1w53ow4b7ryXpblVb5dK 4S3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IwJ/bmdw3Gec3l4YY78ErHglpPqocLkLICgmqsOvJUQ=; fh=F9cXzIM6+eqMHjvfyj5TF5u9rE42RCKI684tuK7nORI=; b=DKMIcwCsWitjMWF9s2vR3smwnas05wFpmUq7QG1Li1hONrr3zYpJnbi2f9NSjTTNHH 1K33IzZto59zBATA3l53gK2exIW2ptjJfmTVg07jdfEh4xJ6pVEIglD8avvkg+Lkzmc2 3x/ajOr+DsH2l+8EvC8er/YB4Ly9tPocsQwXUE2hZY1py9VvnHWcR69MderNejH+yr/X GQp5fXEn7hxExaGaVIgWB2hbprxKBS3hH05Ki6HF5JyzcPtyX9MhoguU+rnHLd6urus5 M6vUQK1XjZN/ClQrwb0AU4lhhIjCkpSIScLiEXWsP2CctvWH6dL1X/C4i2mPs4XoTDZr uGjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hhaIBnCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id i69-20020a638748000000b0057ab7d42f99si3338044pge.51.2023.09.22.02.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 02:44:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hhaIBnCa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8BC6F81F8523; Fri, 22 Sep 2023 02:34:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233046AbjIVJeZ (ORCPT + 99 others); Fri, 22 Sep 2023 05:34:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233186AbjIVJeP (ORCPT ); Fri, 22 Sep 2023 05:34:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061E0CDE; Fri, 22 Sep 2023 02:34:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4E5EC433C9; Fri, 22 Sep 2023 09:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695375248; bh=3sau3zGAqT64PlvL93L3t5WW9upTsJ7zh15tcnTdr5Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hhaIBnCaAbuCpSxAopP2bOKGZnEbjsw1ElAoo3Zz7BnAv+l/F+pFaAiLxFA9ny7H4 9L3mO0A6LcrzntFIYgI89H2ltGDEBIp8buJfoqqX2Oket8WLh5QH4+7vA52PjIoXmF zewHVEDJJ5s7nk3si4FZfbeiSKzOb+PQs0ixFTAuCpuG4a7+rn8HDBUBtzxA5Z7LmQ 9DxTufr/nkZ/j9CT/d7cv8Tjl14CVfZvwM5GTA2Jm9SOkAMYeEIgEsSi7Kk/Fh87yA C7Y3P8pP44GUxZbrjNnO7rg1kLoKIIy5/7H2qkrSrshAyEnkdWKtxFpFjNqPVSTvqh bwiFNK1GyFDMQ== Date: Fri, 22 Sep 2023 10:34:01 +0100 From: Simon Horman To: David Howells Cc: Jens Axboe , Al Viro , Linus Torvalds , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 07/11] iov_iter: Add a kernel-type iterator-only iteration function Message-ID: <20230922093401.GW224399@kernel.org> References: <20230920222231.686275-1-dhowells@redhat.com> <20230920222231.686275-8-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230920222231.686275-8-dhowells@redhat.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 22 Sep 2023 02:34:29 -0700 (PDT) On Wed, Sep 20, 2023 at 11:22:27PM +0100, David Howells wrote: > Add an iteration function that can only iterate over kernel internal-type > iterators (ie. BVEC, KVEC, XARRAY) and not user-backed iterators (ie. UBUF > and IOVEC). This allows for smaller iterators to be built when it is known > the caller won't have a user-backed iterator. > > Signed-off-by: David Howells > cc: Alexander Viro > cc: Jens Axboe > cc: Christoph Hellwig > cc: Christian Brauner > cc: Matthew Wilcox > cc: Linus Torvalds > cc: David Laight > cc: linux-block@vger.kernel.org > cc: linux-fsdevel@vger.kernel.org > cc: linux-mm@kvack.org > --- > include/linux/iov_iter.h | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/include/linux/iov_iter.h b/include/linux/iov_iter.h > index 270454a6703d..a94d605d7386 100644 > --- a/include/linux/iov_iter.h > +++ b/include/linux/iov_iter.h > @@ -271,4 +271,35 @@ size_t iterate_and_advance(struct iov_iter *iter, size_t len, void *priv, > return iterate_and_advance2(iter, len, priv, NULL, ustep, step); > } > > +/** > + * iterate_and_advance_kernel - Iterate over a kernel iterator > + * @iter: The iterator to iterate over. > + * @len: The amount to iterate over. > + * @priv: Data for the step functions. nit: an entry for @priv2 belongs here > + * @step: Processing function; given kernel addresses. > + * > + * Like iterate_and_advance2(), but rejected UBUF and IOVEC iterators and does > + * not take a user-step function. > + */ > +static __always_inline > +size_t iterate_and_advance_kernel(struct iov_iter *iter, size_t len, void *priv, > + void *priv2, iov_step_f step) > +{ ...