From patchwork Mon Feb 13 13:46:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13138460 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 890BEC636CC for ; Mon, 13 Feb 2023 13:46:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05F596B0071; Mon, 13 Feb 2023 08:46:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F2A906B0073; Mon, 13 Feb 2023 08:46:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCC3B280001; Mon, 13 Feb 2023 08:46:29 -0500 (EST) 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 CEAF06B0071 for ; Mon, 13 Feb 2023 08:46:29 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9E35F80742 for ; Mon, 13 Feb 2023 13:46:29 +0000 (UTC) X-FDA: 80462393298.13.B55C656 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id E0E331C001E for ; Mon, 13 Feb 2023 13:46:27 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZW2eBBPW; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1676295988; a=rsa-sha256; cv=none; b=NiyAUTAZYgpwA1M9WdzLmd2zeZEfuAbZlals0zdOJVTX9/ZP41IuaGUUoWOLD5vXrZPUiT dq42+YBFWbXDlnFOzi4xC9KGB6B1l7kd9ne3iHLXe1BDS3yhBdJpzqvqrJ3oe1kJ8FSqW2 o9CArWtR5kIxRTaKDrfSqJ7v7z7yLdk= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ZW2eBBPW; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1676295988; 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:references:dkim-signature; bh=jpj+Hi64Ov256tSq+vKlLJQsr7J0tYvdjVC2kndFEfc=; b=MfH5LZXjuD+IHqJzN/JdF+xoabT9lMqJ9ytyVRQJIuTQAFI6zcn4hD3iiVR6WnS8r/zzi4 h9q6w3+TpWKgDq6AyzYEFDHXfTXCtNh8OmemVh0WFA33HWuj/YdqDkTDEFJ+r/kzrPdyU4 VewbOFpFxqEKqn1t5ZdEAvSQoz36jwc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676295987; 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; bh=jpj+Hi64Ov256tSq+vKlLJQsr7J0tYvdjVC2kndFEfc=; b=ZW2eBBPWs3tlnR6F/v7PxPtbrJ+vO0RvdPbRuyNsJ8nFMX8SmsUmiTHVYGYfBsc9IPrqxW jFmuYqXeQWkNg3JGFMTu/Gq1aInp/DSpHG2IP0PnR7op/V+pnLF+cNopJFiNssWoUxoWe7 tv+5E2Sfoc5iX9Am2GVKzRUYGTFkEvw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-7ekccTIgNjWw5z9w3Wxjfg-1; Mon, 13 Feb 2023 08:46:24 -0500 X-MC-Unique: 7ekccTIgNjWw5z9w3Wxjfg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6DDF0811E6E; Mon, 13 Feb 2023 13:46:23 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id E51E040C83B6; Mon, 13 Feb 2023 13:46:20 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/4] iov_iter: Adjust styling/location of new splice functions Date: Mon, 13 Feb 2023 13:46:15 +0000 Message-Id: <20230213134619.2198965-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspam-User: X-Rspamd-Queue-Id: E0E331C001E X-Rspamd-Server: rspam01 X-Stat-Signature: hercxak7cbotu6rpymjfywwsmcikq5g1 X-HE-Tag: 1676295987-764923 X-HE-Meta: U2FsdGVkX188fdfaf1DdmwbSlOE/xFKECh0s9lsicuEm/zKotevBe3PKJSLI6mjkqsMA5KyF3jVUB1mjudqOnoWnbwD/YU6fuJOVlZF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CurCoI627Y1/wP8Vd/PltuEZih08Cz5BOBAX8T+l3Xb5+DA3gZY6EzimsXSkL0mMv2nqxhXLr401/RE61hwV/HtpkBiE1iOKZHN+PBU/I3qqE5Zg3eU1sYGnz4Gq+IlB93gGx8N2AMSj6Nvfy4MvadgqX4QXC7QfQs= 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: Hi Jens, Al, Christoph, Here are patches to make some changes that Christoph requested[1] to the new generic file splice functions that I implemented[2]. Apart from one functional change, they just altering the styling and move one of the functions to a different file: (1) Rename the main functions: generic_file_buffered_splice_read() -> filemap_splice_read() generic_file_direct_splice_read() -> direct_splice_read() (2) Abstract out the calculation of the location of the head pipe buffer into a helper function in linux/pipe_fs_i.h. (3) Use init_sync_kiocb() in filemap_splice_read(). This is where the functional change is. Some kiocb fields are then filled in where they were set to 0 before, including setting ki_flags from f_iocb_flags. I've filtered out IOCB_NOWAIT as the function is supposed to be synchronous. (4) Move filemap_splice_read() to mm/filemap.c. filemap_get_pages() can then be made static again. I've pushed the patches here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=iov-extract-3 I've also updated worked the changes into the commits on my iov-extract branch if that would be preferable, though that means Jens would need to update his for-6.3/iov-extract again. David Link: https://lore.kernel.org/r/Y+n0n2UE8BQa/OwW@infradead.org/ [1] Link: https://lore.kernel.org/r/20230207171305.3716974-1-dhowells@redhat.com/ [2] David Howells (4): splice: Rename new splice functions splice: Provide pipe_head_buf() helper splice: Use init_sync_kiocb() in filemap_splice_read() splice: Move filemap_read_splice() to mm/filemap.c fs/splice.c | 146 ++------------------------------------ include/linux/pagemap.h | 2 - include/linux/pipe_fs_i.h | 20 ++++++ include/linux/splice.h | 4 ++ mm/filemap.c | 138 +++++++++++++++++++++++++++++++++-- 5 files changed, 163 insertions(+), 147 deletions(-)