Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1055707rdg; Fri, 13 Oct 2023 08:59:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH85KQ+5ZQb2gLF82nUx9k1luUTl4vkOgVadU4ZaYufZOwoyww2shpIgRw72DA10IwZpjQU X-Received: by 2002:a17:902:9898:b0:1c9:b196:d294 with SMTP id s24-20020a170902989800b001c9b196d294mr10154643plp.20.1697212769968; Fri, 13 Oct 2023 08:59:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697212769; cv=none; d=google.com; s=arc-20160816; b=Q8Ub6i/CDBc/4aH2Kj/qHQ5AL+QMO0Smykiogv96WLia0T+FBM0rHlGhgJWpGfjdw6 XFiQ1INcrr5ZNb0GRu9ZvQBv0teCcZw7OkE9mlzQsiESb/3aY6Mia0FgoyHq0pnAt7gi Sqs0KNwbpaRScqhoRxL+UN3WSec/3uEsS6A2S/VVG5ooq3QyL0lB1sqyNQwzyRHWg5Pn HFT2Meqf9XUk994GjUSntutz4bHYACaz/lCzdfvmJnL85IjGFg3CnpdkP/fg3IkZW6UP BAYrmwF4Fc9/b0bA3J0SM2REuC/08Sp/5s6OAWQeWC/qUETnfVotLY6u/FGX9VtPIDa8 xdCw== 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=qZVSDRhH8TCwDqqtYYaWhbNXvdmkKJuIxH0fFLIHYlQ=; fh=jmUmYsO8YmwX20Dqv2n3fkhLiq7FjoQi2Bp7neHz30s=; b=spF/2D6y8xUqCW1fJTsethxtkitjsFG+xz1f/nfFUhastYzN25rTg3dkI1rLeNgZOX LzadCLDK7eyjbWKkWY8Urxa82ZxDDbrquJ5PzjhPvRSOwDl5dtRM7aDSoJC9di4JLa38 fU90wB85+to+bhKXdjayWfFaPCmkS1JiXTizCuDU0RLeISHgP6P05MxQ40NynHcFoed0 TgsP+/97h0qsKvyQRO4oK7YY3ppaSDtLABhJP2x8WiuAcno8NMpFxrH7KmU7b2e+vd8e 39dZOqjtMMxNOEjumdhNUy7H0Bs+6wJgWQImZNP4HCShF3YV0whAuOTuLUxRdhazwCp3 9IDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Eh/Vv6co"; 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 z18-20020a170903019200b001c6182d9fdasi5144783plg.326.2023.10.13.08.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 08:59:29 -0700 (PDT) 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="Eh/Vv6co"; 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 753568311BD4; Fri, 13 Oct 2023 08:59:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232657AbjJMP7Y (ORCPT + 99 others); Fri, 13 Oct 2023 11:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232452AbjJMP7R (ORCPT ); Fri, 13 Oct 2023 11:59:17 -0400 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 5B918EE for ; Fri, 13 Oct 2023 08:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697212674; 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=Eh/Vv6coK01Q3WgtMqB4lauu+H1vwCWBf6am3zE5cByZP63DR6IQiQQe4VKaZFqeggkTo0 r6oIJ1NtkWIDyQpsWUgv1G4nz/SCvqGPrDGgopjG1TtzPvRgtIkEcDsFlVxbGOQjb+wDwn cmIea9hGZYyWuV0iEvj2+7UdWWtWc28= 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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, 13 Oct 2023 08:59:28 -0700 (PDT) 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);