From patchwork Fri Oct 13 15:56:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13421068 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 3346FCDB482 for ; Fri, 13 Oct 2023 15:57:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97EC28D0166; Fri, 13 Oct 2023 11:57:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E0C38D0015; Fri, 13 Oct 2023 11:57:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E5938D0166; Fri, 13 Oct 2023 11:57:56 -0400 (EDT) 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 542AE8D0015 for ; Fri, 13 Oct 2023 11:57:56 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 25F4E1CA8F2 for ; Fri, 13 Oct 2023 15:57:56 +0000 (UTC) X-FDA: 81340894152.27.BC54CE8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 5FDB7100026 for ; Fri, 13 Oct 2023 15:57:54 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Xjqm/caE"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697212674; 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=qZVSDRhH8TCwDqqtYYaWhbNXvdmkKJuIxH0fFLIHYlQ=; b=Pw40J6H8b53oxXJzadE8BoxZmrggC8Cvpk2M3BLPqP+L3EZpxtnBRKRkzc/R3eRCY2iIa1 jEgngNpet1UDpbZLJrOUHgzUnTCy3mvZbwuQIVPSNoL3Q8Sti9RRcf2oFT1ptP3JEaTXOI Js2lRm0hEk7wRTFLsqRiZuF0kZOboKY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="Xjqm/caE"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697212674; a=rsa-sha256; cv=none; b=AD4LZdgVjLh8ielbDjQBxjxRT67SJiY+vDAO6N1zy8MFpMwtRqpj79iZPBNAs7ZoAyzORw hPhwOY6+Od8AlXJLs9yViU32OYQfjkVZsVWvsiN/RI5R/r/2L/YVRs4/vi8E7h+UOsx8jP f1JKOE8yB75cGBMC/Gcy9Ucp3k1HoIs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697212673; 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=qZVSDRhH8TCwDqqtYYaWhbNXvdmkKJuIxH0fFLIHYlQ=; b=Xjqm/caEqoVCdgkLwF3qgy581w0W84j8pIGCpCqS3Q0NcdMGSpOVZmN2WjoEaMdvB175PP 7w1PehKmrENrN5s/iB5eJrP4/wGO7Wd/qidpK765hcnEF4Q2zqkuB7rvOkBr6JFXGDSvxa XtKclf9JprTrmiPhq5OgH83acMNE1II= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-358-qqDjH4-bPva_BatiZBcR7A-1; Fri, 13 Oct 2023 11:57:50 -0400 X-MC-Unique: qqDjH4-bPva_BatiZBcR7A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 26A151E441D8; Fri, 13 Oct 2023 15:57:49 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63FD71C06535; Fri, 13 Oct 2023 15:57:46 +0000 (UTC) From: David Howells To: Jeff Layton , Steve French Cc: David Howells , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Dominique Martinet , Ilya Dryomov , Christian Brauner , 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, linux-cachefs@redhat.com Subject: [RFC PATCH 05/53] netfs: Add a ->free_subrequest() op Date: Fri, 13 Oct 2023 16:56:38 +0100 Message-ID: <20231013155727.2217781-6-dhowells@redhat.com> In-Reply-To: <20231013155727.2217781-1-dhowells@redhat.com> References: <20231013155727.2217781-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Rspam-User: X-Rspam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cFOtnetFXRDta5R h7d9dK35 ydAFcLh+uQ6PgBuzp1OdrX65bDb6JcGQ+oewVk7qOK9QQDOqZYvPuWpR0nURJHWXI7E6k2UUWnSmujKUg2ODuN6FPYdrmjRY/yIOXyBO9ClB514QKbylSq7wZYvef1ngPOFYXy5/Vto/cjpb5qvkThoFclEmEJnb4ZrwMxi8Ue748Vakk1xSZWPQlgfKZtxflQtV1NdVvXa41Q4AVsILB0M544tiwGIeMQNWhFwRrR1800u8PWXrkIcjMvrLq1eFeVBH3QmywE4eSfFYsGgsyCuTESG4wJ+4rGOrI/1NNNkn4L0mq5XxhdmrQVfoiWv41PEDhxy9T4ZqwDI7IIuIAirV9lA== 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: 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 2f1865ff7cce..8e92b8401aaa 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -147,6 +147,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 6942b8cf03dc..ed64d1034afa 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -218,6 +218,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); int (*begin_cache_operation)(struct netfs_io_request *rreq); void (*expand_readahead)(struct netfs_io_request *rreq);