Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1061886rdg; Fri, 13 Oct 2023 09:06:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkZWPUQ35xaJTNLbpBsuHTPN6mGjGI2nTyWPDXyYLWEkc0ys36EyajWoovAqr1nUAQy5UB X-Received: by 2002:a17:902:cec1:b0:1c9:c32e:c9a0 with SMTP id d1-20020a170902cec100b001c9c32ec9a0mr896794plg.2.1697213200460; Fri, 13 Oct 2023 09:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697213200; cv=none; d=google.com; s=arc-20160816; b=z7/R13u8t3BeTN7MXru5cWsdlhlpd2eB5gIywZc2vo3EoeVPsChdboKOBtoGEi+ojQ OAqObY7cAK/AyE5+3FtiRNwypmC/kN/sDzTKrt1tsIPIXgZHbUeuh9GP6qqDV1KYg/ti YP/+hTzq6gMatHz8W1yXqGRMJDU8/5BSBZgRvpisGYtZSHEiYlphOF695M47U9mass+1 2UJy1L6JSn1z+9jqa2FDa3bokGtF8jUyHZaI2bfeXvsdyKg2+8Y1d7Xdx9Ru/pgyVrtU uyZcdQGJzQxrMf5VRpiLt30KiCMf4VGvBC2h1vD+0Bi3mYO2MF47WvKr6Wjo1ev2pFyi Wxvw== 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=QCasRecNkSMoqSQLnZiX89u33dCID3L05AOtURpI2pA=; b=fx89X1/p/YcSKyAx8iNQT2JuDEJdvkBaOsfleYyaZhUM08z+7agPVPs7BetGSbKVvH ERjoi+O+9QjcgpsjHEqB7n24hbT8UesgZzY1xCMNAasvt52200QIDJU3EhrVaP3m9g9G cT59Yd0Soizwwf/M7WlmGu/BiXBh/rqcytfSnYHruz8yVP1GH6HurGdK3eSUT+FYln9v t1VxCXg3NQsxPwpgtFQvYVXIFQ98mDaPBP9YyQZIPFxmmaKbMRVScBfDhgU+d4zQIcn6 k5XtM+/uqp1Ca8XGKWQSIGtPUMb5yFHxE21mbdrG7RbVt8zLKsbxacGj1ATcRBcGbDpI BT+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QffI2e5u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-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. [23.128.96.32]) by mx.google.com with ESMTPS id bq25-20020a056a000e1900b0069339f19f7dsi16687704pfb.199.2023.10.13.09.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 09:06:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QffI2e5u; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-nfs-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 BA34281B0CDF; Fri, 13 Oct 2023 09:06:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbjJMQGC (ORCPT + 99 others); Fri, 13 Oct 2023 12:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232753AbjJMQFk (ORCPT ); Fri, 13 Oct 2023 12:05:40 -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 399C9CA for ; Fri, 13 Oct 2023 09:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697213088; 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=QffI2e5ukJHpOC/vjtxDG/ghehUNosgr5+dUxFu9T0nLYnRSg2yPPGUv6f8oseOu7h+uYh 0XylKlWvkgiC52+bKnciEU4MBjZ2M9v18gnTChHHfK1cy8rRPuboENQ30P4quv5+/fU9qS TMcztHV97/WfeuYUHix6qeDvgiupBt4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-1TUMEKTKP-Sh9eEOTPIfmg-1; Fri, 13 Oct 2023 12:04:46 -0400 X-MC-Unique: 1TUMEKTKP-Sh9eEOTPIfmg-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 6368C87B2D6; Fri, 13 Oct 2023 16:04:44 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.226]) by smtp.corp.redhat.com (Postfix) with ESMTP id B58021C060DF; Fri, 13 Oct 2023 16:04:41 +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-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 17:03:34 +0100 Message-ID: <20231013160423.2218093-6-dhowells@redhat.com> In-Reply-To: <20231013160423.2218093-1-dhowells@redhat.com> References: <20231013160423.2218093-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=-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 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-nfs@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 13 Oct 2023 09:06:23 -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);