From patchwork Mon Feb 13 15:32:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13138593 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 57191C636D4 for ; Mon, 13 Feb 2023 15:33:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F7B96B0071; Mon, 13 Feb 2023 10:33:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A8206B0072; Mon, 13 Feb 2023 10:33:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86F896B0073; Mon, 13 Feb 2023 10:33:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 7596C6B0071 for ; Mon, 13 Feb 2023 10:33:13 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 128671209D7 for ; Mon, 13 Feb 2023 15:33:13 +0000 (UTC) X-FDA: 80462662266.05.9421188 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id CF0C0C0020 for ; Mon, 13 Feb 2023 15:33:10 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gWssymss; spf=pass (imf22.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=1676302391; 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=R4xjCyZagSZ40dpePqm+oxRXHK/tDMvf4yIZj/1HgUk=; b=FC8uAig8UgQg6XtUJg2w2k2MSVpjCi0rs/zBbfR55Q5naOA16CVRYia92DeZ89bRGCOFTh w0OfzHkvrh+0CXSev/4b9ozaLp1C37bB9IVndWyaoH7VufXNJjnBiigX3OcKlBuqTl7xF/ mhHLuAzkguQzXioKMF6/GCmOX1/jMVY= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gWssymss; spf=pass (imf22.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=1676302391; a=rsa-sha256; cv=none; b=anTebu6mh+ze1ZpeSt+2BINj7+YOc9nedEEAF6zWDVFRLmRzQ9nmLnhMvOfHrF8wJ8joeI DsuRJp+ProboIFxNBEJa6rSHWFrfviimTPCwOmHgCSlD3wFcvg+Z9OC7t/Fd/92ptvF4hg 5oLl7TOQW+TViPW2qaEYi/uo6r8Liu0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676302390; 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=R4xjCyZagSZ40dpePqm+oxRXHK/tDMvf4yIZj/1HgUk=; b=gWssymss8RBif5HYLS1fTphoLypFib1zIhBq20Spbng3QcdM7ToAzjDwUCmiw1C+UMONwZ ydZ1LJpiuiDgRl+AK9UgBw8oWHupXG0ZHIjq0ditu2DhxaWK1uzVowMn7WL2uNRsrm8AkN wMgsG1VTOCDrfcBRdtolCmP76VMj2xM= 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-496-su6vr_WZN_eGkcSHr8N6ng-1; Mon, 13 Feb 2023 10:33:07 -0500 X-MC-Unique: su6vr_WZN_eGkcSHr8N6ng-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 7CBEC889057; Mon, 13 Feb 2023 15:33:06 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EAA740CF8ED; Mon, 13 Feb 2023 15:33:04 +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 v2 0/4] iov_iter: Adjust styling/location of new splice functions Date: Mon, 13 Feb 2023 15:32:57 +0000 Message-Id: <20230213153301.2338806-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspamd-Queue-Id: CF0C0C0020 X-Stat-Signature: zao5zjif4mxmjcdrfu55o3o14xfjkjgq X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1676302390-372651 X-HE-Meta: U2FsdGVkX19aLoa7E8MB5J/0WNnb8yIdbfEeEd0bgsRAqgxnKy3syEV+NYctxVgK/1uOUErLWTO3jj/SqoEoAmKacwPTZCMcZ1AVgSDtYKpylz0GqEdcgBGb1sLT1HgyTrkb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QF/K78mS/g2TmTvPUtvGkvS0KMehUWcV4sBFN7vLzeMR36OPgjbSkH9YOKydi9St4ESTlR6UK4Zpx/6g/vSuTW9/nIIFwwTkiHDrcmjxi8NIgdg47CfRIlyi1AW5sls247svv4b4= 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] Changes ======= ver #2) - Don't attempt to filter IOCB_* flags in filemap_splice_read(). Link: https://lore.kernel.org/r/20230213134619.2198965-1-dhowells@redhat.com/ # v1 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 | 137 +++++++++++++++++++++++++++++++++-- 5 files changed, 162 insertions(+), 147 deletions(-)