From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 BCF6F27A916; Mon, 27 Apr 2026 04:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777262852; cv=none; b=smTnbsdwuLaFueqpWApfaAWkNSHhjzAfpGLTRrEeVgoyELRqrZopTbZc3ivPHS1k4d7lt+n61oiqC0R8b36jgruz81RcNWJ40iOwHpuc0PWo+adcbj1+e74ytdq3MghyI9FtNrRkDUiawJarRcbgKM++6xWRMX/PqXyUVpk1oUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777262852; c=relaxed/simple; bh=Ry03XapnV8ZPqRwD/otU1U6sq93iLJCjUmdAQ3JSF0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i+GKvBd3aNvimZWgy7F2HbrCA+4irrvCIHTNQzESmCNJfB+PbJvbT2Pw7zdQT+Kl5rdXIe/3UEyBqfOekBp53/rPyDqGhi58vpvTv5IW4nnNjELbdDeWRzEJL0epDD7YXDzOJ9Q9YNXwJQ4tnoowio36qt1gwU9QzMEKDoSjoUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ownmail.net; spf=pass smtp.mailfrom=ownmail.net; dkim=pass (2048-bit key) header.d=ownmail.net header.i=@ownmail.net header.b=e0tiocWc; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=p4mRIl61; arc=none smtp.client-ip=103.168.172.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ownmail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ownmail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ownmail.net header.i=@ownmail.net header.b="e0tiocWc"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="p4mRIl61" Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id 029E8EC03EF; Mon, 27 Apr 2026 00:07:30 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Mon, 27 Apr 2026 00:07:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ownmail.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to; s=fm2; t=1777262849; x=1777349249; bh=V1Hs5eklgfQn0H62/n/RsRquBHKKGkv3SWjXFgqWxeg=; b= e0tiocWcJeBFeHuA5Zoj1O729A0fdUG37W01YmLRh6FhslRIR5noVjJ8r3ggkvye FGxcwqUSIav/8W6ncfZl4c5MVbekdl7kncuXIlIaZNoToWZWLXH684lXDqczzQ8G HmLut2f3iO5Cuc+uOg8Ypf9r5i/lJLmVlO1myX6ZHzRquESI2BWHanaoTEILk+v0 NacqYs5HqTZSJP2nEggrx6PdGjE5h+NlCyE8zizTkbOoAyRS49LkMZ1BhJ86tyfQ fkriInG9qvxGhc2UzrP2Wz4VmkD0lme6gMHbQXTuolFegttaf9KrfBzI7Wgj4gfX VCEWZ0LX+8Aiki2CgGs53A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1777262849; x=1777349249; bh=V 1Hs5eklgfQn0H62/n/RsRquBHKKGkv3SWjXFgqWxeg=; b=p4mRIl610gvuGSfiC N8oRLAKLafsXb7EaQRcqYPiR3ZlQL+/E5tYRIgkjndVTm5gdtHpZl1eIxJC5CyFR 3YI4PcI9o43Bgj3pQFrokiEAbWntDAkX1eRcuDN0Gn1FCP0EZN+m/o1uRgIlxQuD tBwikkbUkKK7cVvlhKD4el+xv1Hqyi+qCPdPlcbmSsX8cfdP5D24nUNJiUEwlPGo 7Ynr1X3yhYJdvrQWirHnRwCCg/6qaLFxMcW8mRAIggPZA0jlMj3g48xGw9AKqBCL kgLzC6gOYFZc+gHSg4WO9/sq6n8uW+BIQ2IoW6O/bNXdc65+CqkcPP9dMt7wbG2C dx1xw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdejjeeikecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfrhgggfestdekredtredttdenucfhrhhomheppfgvihhluehr ohifnhcuoehnvghilhgssehofihnmhgrihhlrdhnvghtqeenucggtffrrghtthgvrhhnpe evveekffduueevhfeigefhgfdukedtleekjeeitdejudfgueekvdekffdvfedvudenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnvghilhgsse hofihnmhgrihhlrdhnvghtpdhnsggprhgtphhtthhopeduiedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepvhhirhhoseiivghnihhvrdhlihhnuhigrdhorhhgrdhukhdprh gtphhtthhopehlihhnuhigqdhunhhiohhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhg pdhrtghpthhtoheplhhinhhugidqnhhfshesvhhgvghrrdhkvghrnhgvlhdrohhrghdprh gtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdp rhgtphhtthhopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorh hgpdhrtghpthhtoheplhhinhhugidqvghfihesvhhgvghrrdhkvghrnhgvlhdrohhrghdp rhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpthhtohepjhgrtg hksehsuhhsvgdrtgiipdhrtghpthhtohepjhhksehoiihlrggsshdrohhrgh X-ME-Proxy: Feedback-ID: i9d664b8f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Apr 2026 00:07:25 -0400 (EDT) From: NeilBrown To: Linus Torvalds , Alexander Viro , Christian Brauner , Jan Kara , Jeff Layton , Trond Myklebust , Anna Schumaker , Miklos Szeredi , Amir Goldstein , Jeremy Kerr , Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 11/19] efivarfs: use d_alloc_name() Date: Mon, 27 Apr 2026 14:01:29 +1000 Message-ID: <20260427040517.828226-12-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty In-Reply-To: <20260427040517.828226-1-neilb@ownmail.net> References: <20260427040517.828226-1-neilb@ownmail.net> Reply-To: NeilBrown Precedence: bulk X-Mailing-List: linux-unionfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: NeilBrown efivarfs() is one of the few remaining users of d_alloc(). Other similar filesystems use d_alloc_name() in the same circumstances. Now that d_alloc_name() supports ->d_hash (providing that it never fails), change efivarfs to use that. Signed-off-by: NeilBrown --- fs/efivarfs/super.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 1c5224cf183e..232d9757804c 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -189,26 +189,6 @@ static const struct dentry_operations efivarfs_d_ops = { .d_hash = efivarfs_d_hash, }; -static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name) -{ - struct dentry *d; - struct qstr q; - int err; - - q.name = name; - q.len = strlen(name); - - err = efivarfs_d_hash(parent, &q); - if (err) - return ERR_PTR(err); - - d = d_alloc(parent, &q); - if (d) - return d; - - return ERR_PTR(-ENOMEM); -} - bool efivarfs_variable_is_present(efi_char16_t *variable_name, efi_guid_t *vendor, void *data) { @@ -263,9 +243,9 @@ static int efivarfs_create_dentry(struct super_block *sb, efi_char16_t *name16, memcpy(entry->var.VariableName, name16, name_size); memcpy(&(entry->var.VendorGuid), &vendor, sizeof(efi_guid_t)); - dentry = efivarfs_alloc_dentry(root, name); - if (IS_ERR(dentry)) { - err = PTR_ERR(dentry); + dentry = d_alloc_name(root, name); + if (!dentry) { + err = -ENOMEM; goto fail_inode; } -- 2.50.0.107.gf914562f5916.dirty