From patchwork Wed Dec 13 15:23:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13491214 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 E1E25C4332F for ; Wed, 13 Dec 2023 15:24:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C9946B03ED; Wed, 13 Dec 2023 10:24:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 753706B03EF; Wed, 13 Dec 2023 10:24:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F5616B03F0; Wed, 13 Dec 2023 10:24:33 -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 4BB116B03ED for ; Wed, 13 Dec 2023 10:24:33 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2493C80BFF for ; Wed, 13 Dec 2023 15:24:33 +0000 (UTC) X-FDA: 81562166826.20.8FBFE7B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf28.hostedemail.com (Postfix) with ESMTP id 5D253C000E for ; Wed, 13 Dec 2023 15:24:31 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ojp4M+ck; spf=pass (imf28.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=1702481071; 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=shWxGi+94hUVdbxc3FCgiKxDR0g1X33mrWTu84CcD7w=; b=txwAu3fdV4uSTGAqkYVaSXDSiwheFUXp6DkLIGLuiuAS2FytmFFWyrMG4GYdqDU6rr9JsC 6Sy9LnsS/zQa/j92m9K9rQH8Cz8Bu3agpUu7IQx1RG351SvP21jI6ot9K24VTv1sl1iwMi 3rM2fl7ESiSFKvWZhcyDxf+CeSphgbk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702481071; a=rsa-sha256; cv=none; b=oCbSVDwC79/t/YuwHUfjlipbZPE47Kkq2kRR0x2NmVFoPcWZzhS0E2Lc/xc976vUWXnnnM 6BVSYpkDZ3dw+15ltUEnC6AfeJMPsoU2dqZyu4BgDTH799MmU9vH4X/foV9Dr5jJA+KUhT a0gRzr8H0u3EjXgHIdvn9wa9zLALg68= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Ojp4M+ck; spf=pass (imf28.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702481070; 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=shWxGi+94hUVdbxc3FCgiKxDR0g1X33mrWTu84CcD7w=; b=Ojp4M+ck/+9mDtm/095jHhKxf82U35JqSBpUWaIRA63NiAExUtPAwwk6EaUs0kcLSglErV XQuJfXVSsBCnkuo7cCtJJd48fRHGQ//7ka1qWs5WW/AmDyLxWOfDDn0cVwOnEfxM2b6j4m Uw//ztYzmSqVKgIEq93he+GX0pbDrEU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-3z4VMODgPtmn2_8Q_yyXqA-1; Wed, 13 Dec 2023 10:24:27 -0500 X-MC-Unique: 3z4VMODgPtmn2_8Q_yyXqA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23E3085A58F; Wed, 13 Dec 2023 15:24:26 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1DF2492BC6; Wed, 13 Dec 2023 15:24:22 +0000 (UTC) From: David Howells To: Jeff Layton , Steve French Cc: David Howells , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Dominique Martinet , Eric Van Hensbergen , Ilya Dryomov , Christian Brauner , linux-cachefs@redhat.com, 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-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 08/39] netfs: Add a ->free_subrequest() op Date: Wed, 13 Dec 2023 15:23:18 +0000 Message-ID: <20231213152350.431591-9-dhowells@redhat.com> In-Reply-To: <20231213152350.431591-1-dhowells@redhat.com> References: <20231213152350.431591-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Stat-Signature: fcf9jaqn4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gFolC BhTnk3RpW0f7UDRaBJVL8NOWZmnSj3t6GXmZNwQ/FnCOFjZXA8rtivgf+Er1KbfFoGf30uUYapG9mxTB2MCuImyXVazq6mkav1+P0zBd8iFpEsWKOhk/pShxCsa6BYg1DZ4H5/o2LOQjDss7iAuBIWPq91Cs2ERwrfVgTvempGnIhkp6TuuufpZc3pLSn6nlzJ0ILUjhIRq9WjMwN/m6U+Vh7g7pQi/qCM7Ixxm2rBC77dZSj9wKsWPUub2jU17EErVCl2tfTxtl8uapkeTYauaQNPoPP+gknhWsMmadIXB9bFvWA4wKtCF/r/8qwwXT3/3Pt4Ub/GJQUciUo+uiJArIMjg== 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: Add a ->free_subrequest() op so that the netfs can clean up data attached to a subrequest. Signed-off-by: David Howells cc: Jeff Layton cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/netfs/objects.c | 2 ++ include/linux/netfs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index c4229c5f3f54..1bd20bdad983 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -145,6 +145,8 @@ static void netfs_free_subrequest(struct netfs_io_subrequest *subreq, struct netfs_io_request *rreq = subreq->rreq; trace_netfs_sreq(subreq, netfs_sreq_trace_free); + if (rreq->netfs_ops->free_subrequest) + rreq->netfs_ops->free_subrequest(subreq); kfree(subreq); netfs_stat_d(&netfs_n_rh_sreq); netfs_put_request(rreq, was_async, netfs_rreq_trace_put_subreq); diff --git a/include/linux/netfs.h b/include/linux/netfs.h index d6f27000eeb0..06f57d9d09f6 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -214,6 +214,7 @@ struct netfs_request_ops { unsigned int io_subrequest_size; /* Alloc size for netfs_io_subrequest struct */ int (*init_request)(struct netfs_io_request *rreq, struct file *file); void (*free_request)(struct netfs_io_request *rreq); + void (*free_subrequest)(struct netfs_io_subrequest *rreq); void (*expand_readahead)(struct netfs_io_request *rreq); bool (*clamp_length)(struct netfs_io_subrequest *subreq);