Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp803786rdb; Fri, 17 Nov 2023 13:17:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOdXaja9ccjpCmZX4RbGBpFTM+k0uzxFmFDPilUIB16lkL5LZSKVovZErh3WDTkCxd1xe7 X-Received: by 2002:a05:6a20:6a0b:b0:187:b2a7:c6cd with SMTP id p11-20020a056a206a0b00b00187b2a7c6cdmr348827pzk.57.1700255843145; Fri, 17 Nov 2023 13:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700255843; cv=none; d=google.com; s=arc-20160816; b=opWU9gfEyuQrXDJDH5L6QxUBCFpJMmYxOvDLEg0m+a9W4m64DIatpd+uylBjLwN31d 4TL2VHfQRiPjvzmuNltkrIbfSzlPbE7yEJXyppvHL3dh8Ti8RiB7GZUiKFDgpSCwcWOM 4J7V/Oj9EbrxSeB+U1UAe5IODw0whTzEjc/uixRCfbXK+cF8FJ0vPw5fn5jXGJ/yTFYb 253PffFzet/oy1KbBmuTU7yvegX1ymfUhgHSMZDrjBpaoBUCarqtfZmcR+1EDSs/U/gs UhFSANIHqJBvZtPYBgef2MmfmtxioNdrblObRTL+qW2UMCWekOgYAlVKPTXqQ+EqXaT7 qcXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hEis0LpqHig0B1ZU0ewbKxCSS/w/yhv1086SqFY6jkI=; fh=lVY/c7gYUTDnyYYKKvGQU3Q29dA69hck6eN/HP5dBQ0=; b=zGzhtPzR6EFWzmVFWoddRqgvd2Dz6RdgZbA26zFOYr+5r5IAt4L3R+Pg/3uqFHkw2b XTZSeSPIVCmSCDL2OEh1uWPU1beLycw98uLJJimQ0ESMH6hahGB34IJjHU8HHKtuUitb MBIiPTkqAr/nM7BFiCznYE+A8BqjY/fw0oPXIYmP7/OyjmZeUXbieKWPfPNGS2N+pTY3 tvEfVhwPnytzjT2JR4Me9JAYRkfVNzx3rFOWroGcoV4+EBkkT17Vc06MlUci3U1UX8+1 mLmSbG9EhmE3zh4yxUNWqvAuJy9M0AK5SwGhw5uOp7SF5XeqoVtbe0FmYVsbpES2thHq Vxyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z8GTuKaH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id pj13-20020a17090b4f4d00b00274df6d4c38si2715522pjb.89.2023.11.17.13.17.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 13:17:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z8GTuKaH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 33E97829589C; Fri, 17 Nov 2023 13:16:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346272AbjKQVQX (ORCPT + 99 others); Fri, 17 Nov 2023 16:16:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235754AbjKQVQN (ORCPT ); Fri, 17 Nov 2023 16:16:13 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A61173E for ; Fri, 17 Nov 2023 13:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700255766; 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=hEis0LpqHig0B1ZU0ewbKxCSS/w/yhv1086SqFY6jkI=; b=Z8GTuKaHswEOfEgsydpq8JSaxmMI6UKpMI1p6vi3wGBylHmAPzQKW9yLrjnE6nCHplXbI2 OCxO2IywD/7Zd6vdlwcpgKQhpZitFeVY7khKZKpA0jd+MQdxEPdAeclo+S64p3CkTfzGe8 UFO+DmpgGIfVCi/0ORZqAvSr006Cdzw= 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-658-6kgqm_xqNl-O_djWqEdQ7g-1; Fri, 17 Nov 2023 16:16:04 -0500 X-MC-Unique: 6kgqm_xqNl-O_djWqEdQ7g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 E659A185A784; Fri, 17 Nov 2023 21:16:02 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52EBD2166B29; Fri, 17 Nov 2023 21:16:00 +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 , 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 v2 04/51] netfs: Add a ->free_subrequest() op Date: Fri, 17 Nov 2023 21:14:56 +0000 Message-ID: <20231117211544.1740466-5-dhowells@redhat.com> In-Reply-To: <20231117211544.1740466-1-dhowells@redhat.com> References: <20231117211544.1740466-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 17 Nov 2023 13:16:37 -0800 (PST) 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 ddd55b35e650..0633cd9644e1 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -216,6 +216,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);