Message ID | 20231117211544.1740466-4-dhowells@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 754B9C5ACB3 for <linux-mm@archiver.kernel.org>; Fri, 17 Nov 2023 21:16:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F22A08D0010; Fri, 17 Nov 2023 16:16:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ED0138D0002; Fri, 17 Nov 2023 16:16:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFC588D0010; Fri, 17 Nov 2023 16:16:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B9FA88D0002 for <linux-mm@kvack.org>; Fri, 17 Nov 2023 16:16:11 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8E820140E2A for <linux-mm@kvack.org>; Fri, 17 Nov 2023 21:16:11 +0000 (UTC) X-FDA: 81468704142.12.FDFF328 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id C5A9614002E for <linux-mm@kvack.org>; Fri, 17 Nov 2023 21:16:09 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WMd24rGI; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700255769; a=rsa-sha256; cv=none; b=DjTjF2BULQ2uLr76h1yJg+eXC3sEnePQ9vczMBufMsFJ0y1QF2kutHfmSSeNEFFfshPrqB 05iqPBZOML/6bkdE85IBk9NCbATPwEjjF8UAW56euOC7TA41snRJwb7V77qCOC4JxL0D4s Im0OeInukAo0GoLU5DhiGi3iUbUIZnI= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=WMd24rGI; spf=pass (imf09.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700255769; 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=7qvF7oi+5oPEkyJjoyrJDk/ZinoWK2nXUcq9LPlZaNY=; b=02UH3Hi1sYDejIpNEcwmR3wTi2GK2WRUk+CzcCP64+kw3DHzcRE9A3vC4lP+8YtES3Q7aZ jN+CDjOtH1d7w5CcR3Xu6bDt7lK26bEt7FHM7MnIVXMI1+6m4pAgAmyjzyKw2QJ2Q4Hw05 dyaqCdNbUiR/ZNdHhw/cbz1OBqXkl5c= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700255769; 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=7qvF7oi+5oPEkyJjoyrJDk/ZinoWK2nXUcq9LPlZaNY=; b=WMd24rGIgprKdaucxLdyCjTXnxuS1C1Ig12KillQoaiUnPGN1vsP+jKmUvvh9oHoCWqQRy vjg38y2dLWSo7brIYb3pe12MihCkaqX12n9MFcthdKZehF/Rv6AExEoWYgbpXqDdJwAPJi uBH0+pRbK6wi9dN+3n6eiHZ7DmrWIiU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-x5gpf7xiNoOgwEtpMqQMiA-1; Fri, 17 Nov 2023 16:16:00 -0500 X-MC-Unique: x5gpf7xiNoOgwEtpMqQMiA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 7EC613821341; Fri, 17 Nov 2023 21:15:59 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8DB75036; Fri, 17 Nov 2023 21:15:56 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Jeff Layton <jlayton@kernel.org>, Steve French <smfrench@gmail.com> Cc: David Howells <dhowells@redhat.com>, Matthew Wilcox <willy@infradead.org>, Marc Dionne <marc.dionne@auristor.com>, Paulo Alcantara <pc@manguebit.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, Dominique Martinet <asmadeus@codewreck.org>, Ilya Dryomov <idryomov@gmail.com>, Christian Brauner <christian@brauner.io>, 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 03/51] netfs: Allow the netfs to make the io (sub)request alloc larger Date: Fri, 17 Nov 2023 21:14:55 +0000 Message-ID: <20231117211544.1740466-4-dhowells@redhat.com> In-Reply-To: <20231117211544.1740466-1-dhowells@redhat.com> References: <20231117211544.1740466-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C5A9614002E X-Stat-Signature: iz4pdy9333hbjmywby7nqnhfmfh6mmdz X-Rspam-User: X-HE-Tag: 1700255769-496252 X-HE-Meta: U2FsdGVkX18Qcc4MzySQIVqJf0t3QRxp3MyUmkfGr6T6dpGXv53HQsk9Rn84oeAbryVnZkvEKUiYMjW4jzPck9GLznS8ZxkWPeubgRfFRTpmVqwyUWDCIsmxezI3glsSpwetvy/QhH7K/DUj9Gt2LbQ4bbOX7ROElGnDvVYXwtCj2e+bGzCl/p8WcQHXVPbGxyIAkiBaW6yTRQonCBefLnlEkRcFquBm8BJDu9TXLSALNseV/W7Kk43FzOoMpt2kdMc7vvSetbPKbUDIYpo6FK38zljtKoWwM3YNnUQdPmpgHMLS14hmjaQHcL/ALoNMeIyg9EM3kpWL4cRM/B+W5St2jr52BkgakHZl3vMqbM67tX1M20kizjnCyzO2KWP61W+bkkXUORiSjMBIhdccXKiy2eZWCsJtY9MCG+D0bf2xG5+OpeY3ofC8GR7MO+u4JnhBbV/qVYf21MbfaC1pRkL4QS4E9H+VsmNhyUWjewBM40BCn3gXtnTrUS/pjvqNNLoMQsg+/4qqhx50A6JEJVhuKKcDMnVYPaM5qqoGt5RvbolXmBbT+QnCqacaCA3PvnKCXcZ5yj4vlwmtiQpF84A7tsl0pk/bHY1uteAls8NVEbWBxc7JkbHHuJDSwLpwRetXqYbLbQvvHxiHBPzKVSBd6aL1XfJiZtFEQEEvbyTlqZFqkImKAdySAb7yYHPyPipy9HRzVCyUClzXq8EXrqKWBDexBX/8m7MC16TrfFa/fUJClcbWREi7D0nxYjqvIY8Yem/mHZzwsAlVJ8e8r6D63UFWXYSOvmaG9fZXZGKbx+iFB2s1y+qQpLIhPG2lINbK154WYKXNWAZ8EJ0Nyvakphh4h+r+CUCz0yl3dKBwx+aeVZoitoaWgc112+2lKISwWKy2s5X78v0BdpFniOXfO2uWwDROqsjRZnYYIQXxHhKVCyqzPllBFEWioUBNdJJbtwUp30RcTxM3Hsx GmJXmtdt ymLINZV0GUB+eM9aiT209sNLPp7NHjUhh+zQurr/H+0gaFjLBocZzFbxnAyYgmk5TXdGxNIHQIODPk9IUotAEd/xd9MlIFnamRg5Hy6w1CMonegv74ozSrY7jqCDQ6Eq0pwqbzQbOmd3j/5xZWmslkNpdaemFY+GhhUal2huIolSifGrc1vm+Spou1K06rAGvF/96S2SYehSXxSSxIUX9Mh9C2exE2tPxtgiR7jf3qG2wBILhz/xpnG3DAnN4FjIp3h4yG7ijLRKS+p9kGWottBW58bzKCEslo/OdPNwOKf3wWDE= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
netfs, afs, cifs: Delegate high-level I/O to netfslib
|
expand
|
diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index 85f428fc52e6..c4229c5f3f54 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -22,7 +22,8 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping, struct netfs_io_request *rreq; int ret; - rreq = kzalloc(sizeof(struct netfs_io_request), GFP_KERNEL); + rreq = kzalloc(ctx->ops->io_request_size ?: sizeof(struct netfs_io_request), + GFP_KERNEL); if (!rreq) return ERR_PTR(-ENOMEM); @@ -114,7 +115,9 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq { struct netfs_io_subrequest *subreq; - subreq = kzalloc(sizeof(struct netfs_io_subrequest), GFP_KERNEL); + subreq = kzalloc(rreq->netfs_ops->io_subrequest_size ?: + sizeof(struct netfs_io_subrequest), + GFP_KERNEL); if (subreq) { INIT_LIST_HEAD(&subreq->rreq_link); refcount_set(&subreq->ref, 2); diff --git a/include/linux/netfs.h b/include/linux/netfs.h index 282511090ead..ddd55b35e650 100644 --- a/include/linux/netfs.h +++ b/include/linux/netfs.h @@ -212,6 +212,8 @@ struct netfs_io_request { * Operations the network filesystem can/must provide to the helpers. */ struct netfs_request_ops { + unsigned int io_request_size; /* Alloc size for netfs_io_request struct */ + 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); int (*begin_cache_operation)(struct netfs_io_request *rreq);
Allow the network filesystem to specify extra space to be allocated on the end of the io (sub)request. This allows cifs, for example, to use this space rather than allocating its own cifs_readdata struct. Signed-off-by: David Howells <dhowells@redhat.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/netfs/objects.c | 7 +++++-- include/linux/netfs.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-)