From patchwork Wed Aug 14 20:38:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13763961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4669CC531DC for ; Wed, 14 Aug 2024 20:40:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CCB706B0085; Wed, 14 Aug 2024 16:40:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C7B966B00A9; Wed, 14 Aug 2024 16:40:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1BC06B00AA; Wed, 14 Aug 2024 16:40:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 938486B0085 for ; Wed, 14 Aug 2024 16:40:50 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5275241242 for ; Wed, 14 Aug 2024 20:40:50 +0000 (UTC) X-FDA: 82452019860.23.CF022AB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id A33E4A0016 for ; Wed, 14 Aug 2024 20:40:48 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d1XEm0J4; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723668012; a=rsa-sha256; cv=none; b=btjVNFD07A26m5ntZDe0CHyL0HO+pXMmZFsT314LVQSHaVuaMCJTJOGx8UH2aGOB+fqQPp BVdZ+O31qPb0GRGMKZXhHMPhIAHwPbp4BwEHqX3GHL10VXDbrPRT3bTmGy8CCVZsshJgbE I3t2DaT8mLJ6kiU4myoG+kgLTxZIaks= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=d1XEm0J4; spf=pass (imf15.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723668012; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=w97nPU0tAGeP5M9LqJOBxzdkU1NC+KgCeHw19Arp5sY=; b=PTj89j7EfGUON1+plYIKkTBujKr/2iMTBiUd7FYlOO/Wkcs9deB7PFKoTHTYKQSs5pgASJ Qj+2NqyK21blj766I78n5PH+VIjUrDvpR0Dak3OOx89mUvfqFJ/7/1z0kdH2mB2vkkHlYL ie6y0eRJlV2F6qD728j1W3IYjq8keLg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723668048; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w97nPU0tAGeP5M9LqJOBxzdkU1NC+KgCeHw19Arp5sY=; b=d1XEm0J4ahPVLt6VtTqceq0aln6EgREjcRbALYmaYBzKzsl+Dl67sYfGQVZUy3/hBGv7Mr 2VIVpyIbYBc1gi17MUYIAa7wZeH+kbZZrQsbTWPU1nTDbMQqnj3fh//5RuZTTYsMP+3g00 PQIw4vlvvrL/vpKcGvzQzsDH+0yjtPE= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-41-BVHWuZvpPrWVhSRWafLQKA-1; Wed, 14 Aug 2024 16:40:44 -0400 X-MC-Unique: BVHWuZvpPrWVhSRWafLQKA-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EBA0F1954206; Wed, 14 Aug 2024 20:40:40 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.30]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E563719560A3; Wed, 14 Aug 2024 20:40:34 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Viro Subject: [PATCH v2 13/25] iov_iter: Provide copy_folio_from_iter() Date: Wed, 14 Aug 2024 21:38:33 +0100 Message-ID: <20240814203850.2240469-14-dhowells@redhat.com> In-Reply-To: <20240814203850.2240469-1-dhowells@redhat.com> References: <20240814203850.2240469-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Stat-Signature: xpkf1sefsqcsdj63p6xp4gidqgqzchj8 X-Rspamd-Queue-Id: A33E4A0016 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1723668048-504558 X-HE-Meta: U2FsdGVkX1+b/VmU1iSLfP7EFCBjAVHBd1XfFe4SPn4HM2i8Q7QNAYpDSPhTxkDT60GNwFjRbWoITyIMH6lMR+/9t15XZQJaEXAH0NksIRtSaMs3/4bjYzVDeZfgr+Ef8OZPZzLVhaA3qqQc0a6Vag52BPdPRgc6ZPuicmirFM387hKS8kqueyo+JrXAwH/yDlPlGgH9xM4sfgs3vLZmkA/B3Dp+qYbRu9efSDhoj5F/mSGDmR47DnxagGQMctAZAPn/8w3pZB19RfGLnQWi5yCmOPC9aelBfx6e5FHN2ILaHo9o+MgGZItAzGl9cTzbM9JPJZOBZAkeWViqtsvvDUKDHNDKEX8yTbbSrgsAc/ifQuRmP+YLGa9NdqrS2ZUzkfTf5uFiNf0e3DinlvXhUDlI1NZiHJOcPHgm91aGaMzO5c3wdTg5Ys0g7VHhRZLdFbTc6BQP18aaFalRyK75GMaml78G2JD8oJ6IDJ1KZHQu8p6mdbmT2izeDJOjuFN9aVhdFT0XZzPeN6g017/YO6IfIjn/WNAhY4Ojs1XsGYdCzs40MtwtwPGYMxalyB8ptlGvKnyLFUlyALrxZFN1KXvlNhW0pw8QecwzMXX3OujoXU+68tqGlh5Oi3UVqfFQb2Y8SF9ynw+hsSEj+f4aDRclxCOzbedYVn3Qu6FqNiC/GZx+qJHnOC8prFHg9NboEqcXdlreUCbfPTIUvk7wSJoGgV4Wz/4aXjknlYSuHgmZIdqbdbDCaMhwxIPOzQKiMN85TgBm/YThwob0dMrPror/uSR5aZM80ilEigTG+IuXZxMyYKcUPXVGJTEAicfFGBeTUT6Zj+lPEODtF3oVp8v0kro702prky2cr6rlNOILoN3VIVVMCUInbX7ruV0aDdJMBGPiYlc2/qRgWW5UMdI+uZa9mJzIokfvg/zbLh+oalhd1s8vnKaI0tS8CNWJOoTPgU/hPPXGjnJvDkK v5TQhpjs nT6gSUaXdceozDcVu6F1+4NfrkUb/ZEaeuk8u0K0gHoQJuasFhpWwOobpDmyPnwIz4T962URC+cNfdAUx03uAM8GdIHhuw49xmJhW8f8QBxxz85XaoldcOl48RSCyOVDpE3vmYmXFI1qMF4tBua3yopkz6p6ugNw54Te0QfuBABwTZHgG3G9ewpAj1eO37ToGvLjcJPpRO+qydDG+aeB0nEEcig8z1OHaTHxC4yXftk9zM9FjgbNC+TgcdVqz8AOAymaa31qqrqh/GRYAwnIkjSFI5OA0SyEVIoujxD8N7Z+LoazRxgHy2HfqX9oez54sNqe/XbR3WgTvV0twPyvYv+eltgXLrzp6+bSIv0Ap2SELQA1GDxEjCCXSmTLPdKWc9OBZ0du1MXakvx5kfduXJfXKKwGBj8L3v1VITXeLpPDBCR44tf+Uu7/W3l4dGS8gjl1X0SPA6bCc+0pxos056q63D0NGurYWUHmqqUZWxA4Z8QXTec425xC40e4kWtZyFk2zYNPgIPK+HBp/qKfITCAdXbepz6OX+tmVKYxZEJ4BbsVftglc5tltxOnALtQAjpCJ5tNVPj2s1Dk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Provide a copy_folio_from_iter() wrapper. Signed-off-by: David Howells cc: Alexander Viro cc: Christian Brauner cc: Matthew Wilcox cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- include/linux/uio.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/uio.h b/include/linux/uio.h index 845d110acadc..853f9de5aa05 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h @@ -189,6 +189,12 @@ static inline size_t copy_folio_to_iter(struct folio *folio, size_t offset, return copy_page_to_iter(&folio->page, offset, bytes, i); } +static inline size_t copy_folio_from_iter(struct folio *folio, size_t offset, + size_t bytes, struct iov_iter *i) +{ + return copy_page_from_iter(&folio->page, offset, bytes, i); +} + static inline size_t copy_folio_from_iter_atomic(struct folio *folio, size_t offset, size_t bytes, struct iov_iter *i) {