Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp146039rdb; Thu, 21 Dec 2023 05:29:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQhNJ+JAaoVhqkDOkPNLTxGQMKF80WivJHvaWxQPT2+QquZKy+OV6wYPE7dbuCfEnyQZ5w X-Received: by 2002:aa7:9e9e:0:b0:6d9:77bd:20c6 with SMTP id p30-20020aa79e9e000000b006d977bd20c6mr849536pfq.2.1703165367187; Thu, 21 Dec 2023 05:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703165367; cv=none; d=google.com; s=arc-20160816; b=nD1W+NpftvINPjKWdcOA4taz+JVZjE9QlyVojTLlPblKSvaoUWLQ42eC+UCcWGPYjL JsGjw1pK7JxT1+kLOKg38bwAxbpPWLRmfhPichOMIdP41WkhgcJNEaKEMQxEC2l4mTSQ pkNEPkapK0vfoHTvscAvnwpLjXLStr3sJeYAxMOLirFBUanlQqRuAftWV8fk9GNrHO14 i2Cxw0nuWcoiCyGkuLn31KpBLKH6gcoB/98kDOOqG7zXiV/9w8Lfq9ZuUBJ9KP0wcxiE JdvZ7TvjefcGlfE6TaJq4vCMGol23SjTqKMb+/4cw70VfKd49jYtSPySmEGZV2+hykvO OaqQ== 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=H0vMMTudDfb6r/qBW0AEkSH7nAY0KYX4o9qMLzBZ4rg=; fh=ib4gl95HfLmZdfX9QIMf3rTepWCH9JlNymcDKJTPhJg=; b=s52mS9EwLYXEiSkLHNFIk90+GgLuRl9WdGN1F4MLH+/JuOrKmgzMwD02rn5000LZ3t 2vSWNe3cAITsSYf7+DdyrvPrvwKkRetLVtNPpfXlLpsgw3qCwbNnGkjLqpYcJevzBeAo TuP1ho+fsjTl4epK4FWbCbcFfbqzOIJS92jeG1u6Nll0u7ke+AJ7GrWFdagx85ZekUje c1jER/BgUlUTP9dXUph/iK1R5f/vbrhwbgpkT3OJGXyE9dVcHoJ05YRuHH8hKVjlbgb0 ZiCT4xVpAr2h5GaYO0VP5Yru9oKjYY2GvqqQcFR9D4Nyf9ZXx4ToRbCXaz2xBWVGJ86/ 0y2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="R4fM1mR/"; spf=pass (google.com: domain of linux-kernel+bounces-8455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8455-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i6-20020aa78d86000000b006d97eaba7d3si228075pfr.0.2023.12.21.05.29.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 05:29:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="R4fM1mR/"; spf=pass (google.com: domain of linux-kernel+bounces-8455-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8455-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0FA6A2833DC for ; Thu, 21 Dec 2023 13:29:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 641157B3B7; Thu, 21 Dec 2023 13:24:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R4fM1mR/" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4AC467A23D for ; Thu, 21 Dec 2023 13:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1703165086; 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=H0vMMTudDfb6r/qBW0AEkSH7nAY0KYX4o9qMLzBZ4rg=; b=R4fM1mR/P8jOu0BDwDP7RzXdiQjoXWyxrfNCnepvmKQch84Q7zXLFN6L3qCbov1ZnZ7R1e JWQU1886ggdaXLU0ZYDeET25vGxKF/dgofRkHdAee+XJaFJDgPZoKEa8L3zZzlK4yvvXF1 OGyYUgX9gq5HP6JNtAJH+QAm1OjKxsE= 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-206-7R1v-1MuMnWoS5GVhs_l5g-1; Thu, 21 Dec 2023 08:24:45 -0500 X-MC-Unique: 7R1v-1MuMnWoS5GVhs_l5g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 0954485A58B; Thu, 21 Dec 2023 13:24:44 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.39.195.169]) by smtp.corp.redhat.com (Postfix) with ESMTP id 214632026D66; Thu, 21 Dec 2023 13:24: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 , 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 v5 10/40] netfs: Add a ->free_subrequest() op Date: Thu, 21 Dec 2023 13:23:05 +0000 Message-ID: <20231221132400.1601991-11-dhowells@redhat.com> In-Reply-To: <20231221132400.1601991-1-dhowells@redhat.com> References: <20231221132400.1601991-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@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.4 Add a ->free_subrequest() op so that the netfs can clean up data attached to a subrequest. Signed-off-by: David Howells Reviewed-by: 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);