Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1947449rdb; Thu, 7 Dec 2023 13:24:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFj/un0uEZCqnbhfzmHsX2F1B6P5C+THshvyxTzciQpUmnH+BX48/222OKtxwLGQye7CF6A X-Received: by 2002:a17:902:ecce:b0:1cf:9c0b:b3dc with SMTP id a14-20020a170902ecce00b001cf9c0bb3dcmr3180394plh.69.1701984293580; Thu, 07 Dec 2023 13:24:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701984293; cv=none; d=google.com; s=arc-20160816; b=hX1mH8bZJw7vyUaac0MYAEw6T5uIW3zPKFDLFOnT7triq/X1mSHiUpo06CYRdxQaVs P+fDurl9eKxvM7qULJ3TtwrqXtA+CAi1LySXOt1MTWfTAMWJDUEFcbG03Ud7xdi+B/du 86MmdR+cdS/mlchXJtYhzcaehV4SAu70msOm6ZYXWG9yYR/wFjf2OXuyIp1E6RTRrzEg 1cQSmVKWSesxTvT4LI2PjskwD9ZBdOal8ZVSQVmM/XQGDTuOKvdPevha/2yltZZC1upg mvZqcrp3jwB+vYanzS3vVyNvLORhI0ASwLMxxcNOIpuzuhnLcRXyLtfsgSetOtsSF7oh aHZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=shWxGi+94hUVdbxc3FCgiKxDR0g1X33mrWTu84CcD7w=; fh=ib4gl95HfLmZdfX9QIMf3rTepWCH9JlNymcDKJTPhJg=; b=CpzRgHlxgiUdU/+WdhjI0mja5nLw/mnxvuAYdKZpWz8wW2VZ4/juLSJ3koxKKJsS2a dKbOsRlmQpw8rtcye7pdeZMAiL+vCdB1VK85o+u/hr03DV3NbG1B67Zj1UOzhRdyARzg BSmiOWDv7056HL0D733KnWXtOu5XDld2bw5mC6QO3xWrAymPPC1jiOWj/gXkeuM9M2VS Pck003+2crK/Hdp1lJse6qGfnjmUKTM/fbbI95mPUhmXJaXGfBlbbI5+tt+RERsDWKGh d5gTnua03npL11iI93GMShRSpOcawK1Dqh3iUV5a7JQle6w6wGIYdflml8TZZzfVGZoH xl1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RWQDQ1FT; spf=pass (google.com: domain of linux-nfs+bounces-397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d16-20020a170902ced000b001d09aec8a00si356856plg.371.2023.12.07.13.24.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 13:24:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RWQDQ1FT; spf=pass (google.com: domain of linux-nfs+bounces-397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6B680B20EDD for ; Thu, 7 Dec 2023 21:24:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CADE85ABAC; Thu, 7 Dec 2023 21:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RWQDQ1FT" X-Original-To: linux-nfs@vger.kernel.org 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 AE33C173C for ; Thu, 7 Dec 2023 13:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701984162; 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=RWQDQ1FTbu/dYfiHg/naV2EfR8ztcufZ2yjFa1e5OxVzP3cCaYmpAVFCr11CEmuiSqIrDi BCaOaORY/VxitDmsla+1y+6Pl1nWs5ZZe9AOQbDzDfM9no20tGo4Y8x0vIKJ2kRZ2owB9s Q72916impvKUf/77eH/xYTkt+yludKg= 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-607-x7mvjHNlOQiZNHCPmJ_SPg-1; Thu, 07 Dec 2023 16:22:39 -0500 X-MC-Unique: x7mvjHNlOQiZNHCPmJ_SPg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 7E5F0185A787; Thu, 7 Dec 2023 21:22:38 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id E42301C060AF; Thu, 7 Dec 2023 21:22:35 +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 v3 08/59] netfs: Add a ->free_subrequest() op Date: Thu, 7 Dec 2023 21:21:15 +0000 Message-ID: <20231207212206.1379128-9-dhowells@redhat.com> In-Reply-To: <20231207212206.1379128-1-dhowells@redhat.com> References: <20231207212206.1379128-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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);