From patchwork Fri Nov 17 21:14:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13459374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C45DC072A2 for ; Fri, 17 Nov 2023 21:16:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 904498D000E; Fri, 17 Nov 2023 16:16:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B4D28D0002; Fri, 17 Nov 2023 16:16:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 755B28D000E; Fri, 17 Nov 2023 16:16:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5A5B78D0002 for ; Fri, 17 Nov 2023 16:16:10 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 3613A1CB49E for ; Fri, 17 Nov 2023 21:16:10 +0000 (UTC) X-FDA: 81468704100.04.2D37ACB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 7E67D1C0023 for ; Fri, 17 Nov 2023 21:16:08 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="O2/6kPEB"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700255768; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hEis0LpqHig0B1ZU0ewbKxCSS/w/yhv1086SqFY6jkI=; b=bAfb+NbJKetGiL1U7G+Dyo/7VB5O4ypUOXlQtDT5zzFLuJFQaBqqSzQ8a3JWMr2W1ibrCl ldO9b0q4e5O8IO7E3rcXWgEBKlFXp2tJAzvsXetXFb1HOIVI2hPxDjpKpUlvhFsozf3trv hr+mYlfVkeJr90HpXLMINk0SC+L0oMs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="O2/6kPEB"; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf18.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700255768; a=rsa-sha256; cv=none; b=terCmuPMtyqtxpuUzhk2U5QDnrlG4i+vjmwqAiO7VEcEUFaLinH7DG7oCNnswNgizIVY1s iAtL3K7ws4LdLpiPM3XRVozYQCEa6y6WG3iXGXtwV3AlNis99tOe15GrQFkQtzy1mahFLg GSpJcy7VdwJBBqG8IBIdGchQto8uc90= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700255767; 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=hEis0LpqHig0B1ZU0ewbKxCSS/w/yhv1086SqFY6jkI=; b=O2/6kPEBP6CTZhvIoz+Ynr4GvPDNWtzSYZUeZDy8JiKqHTWSK9Ljc6PDh/uy/uGgJD7xlW iBGcS1qlhToJCpWM5wIAKmIjCC+Fri3y6k0McOEOxomfgjfardA1C8s4YWzhmH2z+4v6cR Fo+1X4TT2ZxqvWpxc9Y8Oony5LOjSaY= 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-658-6kgqm_xqNl-O_djWqEdQ7g-1; Fri, 17 Nov 2023 16:16:04 -0500 X-MC-Unique: 6kgqm_xqNl-O_djWqEdQ7g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 E659A185A784; Fri, 17 Nov 2023 21:16:02 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52EBD2166B29; Fri, 17 Nov 2023 21:16:00 +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-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 v2 04/51] netfs: Add a ->free_subrequest() op Date: Fri, 17 Nov 2023 21:14:56 +0000 Message-ID: <20231117211544.1740466-5-dhowells@redhat.com> In-Reply-To: <20231117211544.1740466-1-dhowells@redhat.com> References: <20231117211544.1740466-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 X-Rspamd-Queue-Id: 7E67D1C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0 TuCruMXM/mpJmNrTF4hwB+YjY2S9IpNwUipgTCqe1eIn2QG7VSVReQe9lIVXcOlXyqQrAynu/bt0S1Ox4q6nb2nA2OqHP2KhGy4JM07KrKfYkAsKcCvBhXRpW0E3BAHoFj+BEoWYiPjeYKUFhYY/DQ/NEooLhlR/6PiRJoeEA54itNEagLXSpDVi7o2lumBVVnPH7bZfe82+uHc0hMGROIkkXm2nXA5e+BmA7inqvT4REWiktuI6pVbGtt1zQhu7EQ1bWfOHabBcnISE9lreq0pLfA8H/5wolHYJ0EjYckUlDJFhWXJyrrdFoZ2HEGuY40FkNPMGSf4XV4aMuUKj18S/Kdg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 ddd55b35e650..0633cd9644e1 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -216,6 +216,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);