Message ID | 20241108173236.1382366-23-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 43DD2D64070 for <linux-mm@archiver.kernel.org>; Fri, 8 Nov 2024 17:35:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C8D688D0002; Fri, 8 Nov 2024 12:35:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C16A98D0001; Fri, 8 Nov 2024 12:35:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8FA48D0002; Fri, 8 Nov 2024 12:35:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 830C38D0001 for <linux-mm@kvack.org>; Fri, 8 Nov 2024 12:35:35 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 39ACF1A048F for <linux-mm@kvack.org>; Fri, 8 Nov 2024 17:35:35 +0000 (UTC) X-FDA: 82763629032.18.5C8B998 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf17.hostedemail.com (Postfix) with ESMTP id D3BD840025 for <linux-mm@kvack.org>; Fri, 8 Nov 2024 17:35:04 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MqzNENKq; spf=pass (imf17.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=1731087106; 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=u3/1sOVuQqHpfo8UyVSOFEz4LX0EnJcfMGVnlE5mJ3g=; b=CzreKlm6OmJ3ucEWxAsTludvlUWPqfn+9JL/LavPdPu5DGhCqkmUgCRj+txr6Ti3xkk6T2 6Jd29yLSoVqzz9bjVKxdNq5HhwgwkTomvAr/zhhLGacJcPCwbqLYQAYq6mVzmlgKVkIaYN psx2UxSbxp6B19qBmwrXmZTfmUZ+yI0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=MqzNENKq; spf=pass (imf17.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=1731087106; a=rsa-sha256; cv=none; b=rmDYLl8jn4OvGddyKlCALddpKPBTkWnJx6xv/dvrOvqmtZk6UX14eP0YzySX8gluBifWvD YHoCshYDoOO7dFI/+F+6OwUj8Bjz1r2n35xhCKet3poap4G97Xbid7VHe2nWPoKTf+43ET LelH6ywmMgZ2ECPtxbcEtxzFbWhvZt4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731087332; 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=u3/1sOVuQqHpfo8UyVSOFEz4LX0EnJcfMGVnlE5mJ3g=; b=MqzNENKqh6AYX2qDBAENlZh+uShvPY46k/LfQNOIFJoYRbUlHf4f7bzzhSeF042zQMXMYQ tE1bZN2R5VxJraVPT90NPpVvlhYJiGyEWt11Jiex5geEfkG1ayypGZm0s42V8x2g7iwH28 XLz/JtL0fqWS8JSkP6sAnhNt2Yq3tUo= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-t4pemmCkOQy6-Im92WTkrw-1; Fri, 08 Nov 2024 12:35:29 -0500 X-MC-Unique: t4pemmCkOQy6-Im92WTkrw-1 X-Mimecast-MFC-AGG-ID: t4pemmCkOQy6-Im92WTkrw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 543341956095; Fri, 8 Nov 2024 17:35:26 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B97131955F3D; Fri, 8 Nov 2024 17:35:20 +0000 (UTC) From: David Howells <dhowells@redhat.com> To: Christian Brauner <christian@brauner.io>, Steve French <smfrench@gmail.com>, Matthew Wilcox <willy@infradead.org> Cc: David Howells <dhowells@redhat.com>, Jeff Layton <jlayton@kernel.org>, Gao Xiang <hsiangkao@linux.alibaba.com>, Dominique Martinet <asmadeus@codewreck.org>, Marc Dionne <marc.dionne@auristor.com>, Paulo Alcantara <pc@manguebit.com>, Shyam Prasad N <sprasad@microsoft.com>, Tom Talpey <tom@talpey.com>, Eric Van Hensbergen <ericvh@kernel.org>, Ilya Dryomov <idryomov@gmail.com>, netfs@lists.linux.dev, 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-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 22/33] afs: Make afs_init_request() get a key if not given a file Date: Fri, 8 Nov 2024 17:32:23 +0000 Message-ID: <20241108173236.1382366-23-dhowells@redhat.com> In-Reply-To: <20241108173236.1382366-1-dhowells@redhat.com> References: <20241108173236.1382366-1-dhowells@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: D3BD840025 X-Stat-Signature: i3m3atgiathspcrkijw7fe9gaggq79ja X-Rspam-User: X-HE-Tag: 1731087304-630188 X-HE-Meta: U2FsdGVkX18GMDB0i2X3Jo/LfuHnYbUfNo/z6x7DINYKhsBgfXmZRjKLfZVyvPczTXJpdLxD6WZzd3guyVY7FfoF6jbPsCoF5UVZm1+3oN0Ql5h0emB2TTHUlh9sptHDUKp0L0EHHeFuVI1OeOVplb55A79NzEV+PLUdGNBRp+/nQFC9ZqW4kSD2hq13E3l8+vt/aQkVjtQJvqYZv9Yb+B1/+GJnkX5pW1dPCyARU/rvQENKw2NT1ANVdCM3wjks1LNvItq05itITPllWQJTazzB1C2+VMinh8KpCA2SYE3N9l3Rm+5BjiZOtnkqn6jSYi6RklhF1zk+It1SQOezIbYkwAzMsiLURh7qwrwnMLo30kwGvYmjTQXRsBBVdEKATzE/xuE9bH5zR7pjQIbwHk0VHQVNaNhV4PLY6+rlTfY8vJqx2H2GRCmS8QYiD53kXTTrLMoN74Bn1uSCG/Gw3PFuuOhdVX/aFSE90S11NNTZZpRMEfQ2Y8vgabvrRYsZe+RsbDzJkpaVlxoeU34nDSBcKYEtGpWeWSlAbCEqZI8WPazKp2xooqhXtSgZgVIAdbvhk9L+wo/0KlL5nJOJpRsIuUmx1yW0+usemXWyniAeTgWAKdMsbbvGiqMVXcBg+bvoDfkoDB44cFz6dqW+17FiM5lbSNfYV7gazUvbeTWn6dJJlohCrSLhiXZyFJdi6Tm81noKDvkXLWkKubqIE3/dPe1TnIaYXi2CK61t5d+WCP5pLBp20o8E8euO5l3VJfd16wzleoF3QErv8fkjuZOOT/+Fe8QCyz7DYY2jknK4q4shLvFhWdMfvFRUexuEllNFc9snv8DTw6Rtu0ieSYB9HGVKCT6mb7akuau8as+BiO+rYkp6W4dettYnxR+YixoVeOMsCfzqJ3TkkdGUQ1KleaDjoU+epAInnN+KTQh/q+XuOAuDc/lxXBjgvc4mM4hfmSUGtauwMmJcWlN 0A5fncVf CPq5hH7/HPtTdEv8+xas1myrZZTkneSLX3RNIEo/y3djXEMcRrmXxqzA8EoqJGe2leMKHlNYl+MrM1n9QDosVS+dGEOBX4OmgVINHnyt0EXJ2K+bBT/2RrN4xQg9agbXbSHFgtZWOZ2FzvDZ5fS4VCYTvD91uvdoTdjzEfydabkt2E9eH8DMnUnYRRUPV7uyOwhqzy09lPpO2agVlvLG2Dxx+o9a99lCkrNuc75t/GJLnrh5IB4uLosH0hwjRsQp5qqgdicMNoudxFC/Qmb+pUKQ+VUfndQsTi1ttjNNQRA5ySAnBN85PJA41D7ANUXxVbRQTAmHEJMHdQbaMddg1KKh88t9gUYvxd+FSNHvjppVVo0qvjiQSYWyFkrI8GiqRzKYVRqKWnpCtLFVWFh3rXOfiiJmsO4Kl2oLABEn3pm1aoBit2ojAxFjYbd+/1XCxtJuijTTuVsB+OWI32UB4e6jesZG6xr7QOenslrSbJx6m9Lh4rCgKl606RWNd+KQdXdaP6o8g9xLOjhGaSJRKOGeJdLfdyfQ56ygd1l5nqRt9n3ys+jgHnuvH3I7IQ4s19J8MP5Tp2YmErFkuYgRRFt3D7A== 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: Read performance improvements and "single-blob" support
|
expand
|
diff --git a/fs/afs/file.c b/fs/afs/file.c index f717168da4ab..a9d98d18407c 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -372,10 +372,26 @@ static int afs_symlink_read_folio(struct file *file, struct folio *folio) static int afs_init_request(struct netfs_io_request *rreq, struct file *file) { + struct afs_vnode *vnode = AFS_FS_I(rreq->inode); + if (file) rreq->netfs_priv = key_get(afs_file_key(file)); rreq->rsize = 256 * 1024; rreq->wsize = 256 * 1024 * 1024; + + switch (rreq->origin) { + case NETFS_READ_SINGLE: + if (!file) { + struct key *key = afs_request_key(vnode->volume->cell); + + if (IS_ERR(key)) + return PTR_ERR(key); + rreq->netfs_priv = key; + } + break; + default: + break; + } return 0; }
In a future patch, AFS directory caching will go through netfslib and this will involve, at times, running on behalf of ->lookup(), which doesn't provide us with a file from which we can get an authentication key. If a file isn't provided, make afs_init_request() get a key from the process's keyrings instead when setting up a read. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org --- fs/afs/file.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)