Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5390812rdb; Wed, 13 Dec 2023 07:26:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNJWOZSjCd07hMV/ayKyKALUrAx3oMMy+ckFCx9OUiFk4AQA/r6JA0v1bFnVWU1mPeZP5O X-Received: by 2002:a17:90b:3ece:b0:286:b062:ab7 with SMTP id rm14-20020a17090b3ece00b00286b0620ab7mr3763347pjb.41.1702481164657; Wed, 13 Dec 2023 07:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702481164; cv=none; d=google.com; s=arc-20160816; b=ty6x/GRTLSrVR9do2gckF6jLG0ZU0EG7BZLNK1ElySCm5IuFe90SXMDnMh4zUxrMzJ mwPr+Sv2NLn8JlcqswoyEOVJ2ng3SZYEka/QvEd8Ztk91hlq9UuQdYGcjx08Ef/ID6Wq VyTlMb7/8mt5tyVbDYsKxDeQvmSL1tnz5zr0J+g05HHs6/XGLorPRNK9DeI3fcUUYSc+ +IosN3u/EnmYGjTH+4b6qFEL+ezskAPElEhVy8jaSeZFJS+YsiX5GSYTbHtuUx8W28qY fLq8gzRoyLJrwgypXIh5qPqmM8xpZGU4vkawTs6EO0pk5yWZZ2f92ZpaKRAlSqBjR5ty vfzQ== 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=shWxGi+94hUVdbxc3FCgiKxDR0g1X33mrWTu84CcD7w=; fh=ib4gl95HfLmZdfX9QIMf3rTepWCH9JlNymcDKJTPhJg=; b=pf+yixygO3oeq8TDgonrUkEA3LsK0Ju7Z18XVbcZy+0WJDg0yyVqVTb+rZaFVuzPLW cResH95dgx+9d2H/vybqPINffqbEJ3pSFp5/0UHZt/zvhmRnj3RmMxlnzm1SfE2/xskx IX/PK47/yASDDSfvDnVJO1LdSaNlqYL3lCTFgHevgH3woXfVRud6MMxPWNNYBW1b5Jxu 2V9q2kQSnvwXuM014PLoReLYRDrr39cTjIVcQLM+FB+UTRyXM4x99zHe8t6Tuge1+2Sf aLLsAIWbIANBFHRt2gCW+cqCLZnaCjnwQ9iUFXqhSv1R4PhfGUjF6vE6B1wWhm7JMyFd QLtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fKcqY3l9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id lj14-20020a17090b344e00b0028ae12f4ecdsi1372779pjb.171.2023.12.13.07.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:26:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fKcqY3l9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id A479A80B31EC; Wed, 13 Dec 2023 07:25:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442607AbjLMPYm (ORCPT + 99 others); Wed, 13 Dec 2023 10:24:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442569AbjLMPY2 (ORCPT ); Wed, 13 Dec 2023 10:24:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE11112 for ; Wed, 13 Dec 2023 07:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702481072; 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=fKcqY3l9KiKXQy2dxBBl4WJqRUmt8RNtMSh9kIrSbI8nUigp/mD1uwx8utf7dQ4LVorWaT cUuz6DWATgWXFpF3AQYMaAwd+nS/sdsqaKOAMhYwr+pWH4oSkRT+eVj0slfo4FyoR7OIks DHMnwwMylArKy2zZKDA9wnBH2owCP0o= 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 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:25:07 -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 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);