From mboxrd@z Thu Jan 1 00:00:00 1970 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAD58106ACEC for ; Thu, 12 Mar 2026 21:56:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E74D6B00D9; Thu, 12 Mar 2026 17:56:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BF446B00DB; Thu, 12 Mar 2026 17:56:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A14E6B00DC; Thu, 12 Mar 2026 17:56:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 16A2A6B00D9 for ; Thu, 12 Mar 2026 17:56:52 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A540658E14 for ; Thu, 12 Mar 2026 21:56:51 +0000 (UTC) X-FDA: 84538771422.10.C42D737 Received: from flow-b6-smtp.messagingengine.com (flow-b6-smtp.messagingengine.com [202.12.124.141]) by imf17.hostedemail.com (Postfix) with ESMTP id 8D6EB40006 for ; Thu, 12 Mar 2026 21:56:49 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=ownmail.net header.s=fm1 header.b=We4QHEc5; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=dJKk8gs7; spf=pass (imf17.hostedemail.com: domain of neilb@ownmail.net designates 202.12.124.141 as permitted sender) smtp.mailfrom=neilb@ownmail.net; dmarc=pass (policy=none) header.from=ownmail.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1773352609; h=from:from:sender:reply-to: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=Gqr5GRMgf06YnKH/0CimKgertEevcw92OqmrRngbywk=; b=MrD5ChDMNkiPPLEJMkCX5hwRYM3c1jOCp3G7oiLx5XyPGt5n+5+dXmoFWxt7TuXgu9nCJf z53Xh0hHTKbNRYLD18EbGBeVPnglp+tQBCspi2ZiuTryQbWOCOna2MPCK4DSc9kjnXMWv5 Ljfsrkl6VZIMG+b3WZO1mfsbi4gR9uw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1773352609; a=rsa-sha256; cv=none; b=pVLhCS/xGu5UPyw+6IfM167LiQivTC96USzOtkgllf3iNu/R9Br/aKM+HHWJbVOvREI33G jdQ63MIq4mS/N2U4r9WuLrXS0Qv0UkTUjB43Fhan+bqcbOBLRhsdLpTm5SE0LZhvF4dXeP JvCldD821F+tSX0RfBiwoxM+yKxhRgY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=ownmail.net header.s=fm1 header.b=We4QHEc5; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=dJKk8gs7; spf=pass (imf17.hostedemail.com: domain of neilb@ownmail.net designates 202.12.124.141 as permitted sender) smtp.mailfrom=neilb@ownmail.net; dmarc=pass (policy=none) header.from=ownmail.net Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailflow.stl.internal (Postfix) with ESMTP id 6A68B1301B63; Thu, 12 Mar 2026 17:56:47 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Thu, 12 Mar 2026 17:56:48 -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=fm1; t=1773352607; x=1773359807; bh=Gqr5GRMgf06YnKH/0CimKgertEevcw92OqmrRngbywk=; b= We4QHEc5TNY1r6emZ7SsqEkPBAFl7fjcHi6srpfWQ1jfp9RJyRfEF8fnUh1L1DCn NUV0TnodOWGmPyjahfVZyst7SyBFImTOBbu5reeCNuxZa9HRPVB4nYbPa9eKOqKj CPhvVoePIv8KrFKC9jWx48sJ90oGywC9Kg3zkO5a5jeQQfPK+hJjBscSS6duK7Cb 4Pu+8L4kIn61BbJxZZaydewbyuURl9IDnc5JFrYPrp1xqGiRHGGd6dO+zw/46d9v FWLsgwMkK6Rw70z4NcymA80fUToAHDfDhkXCxQcBYAwiDj6lNIFttjsKy3vYkGwg nbi7TF6fILEzY76fZqID3A== 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=fm1; t=1773352607; x=1773359807; bh=G qr5GRMgf06YnKH/0CimKgertEevcw92OqmrRngbywk=; b=dJKk8gs7CF4KRCcfh 89WVjnhITgi2+635oEUJk+087w20YQpJyBQQRSv6sMvRFBFpbSYz45v1LYD7YSEF k5RjCZgWsz/jDYeuZ1/RmyGF7eTyz8EUQ+zX4XOys/kG00CKqN3XP/Hhwoh55q5p PBoqLjFiU/UtroUW0Z+Eqx5GO4FSz7jp/i1vGOgYuK+F9VG42MXubrcWhALXIcE/ 03DnMHBjvq88RBcy+yoHWGYj8PbashFFwXz6e3vWCTpBOCgBfX3IhkxEH5nO4Y9U amCTP9WGxg1h6I4qU4J31S/WBH+GxRhVgrevtJSzFc1T2ODHmcXC3fIdvp2qeyWc 4WATg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkeejleduucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhhrggfgsedtkeertdertddtnecuhfhrohhmpefpvghilheu rhhofihnuceonhgvihhlsgesohifnhhmrghilhdrnhgvtheqnecuggftrfgrthhtvghrnh epveevkeffudeuvefhieeghffgudektdelkeejiedtjedugfeukedvkeffvdefvddunecu vehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehmrghilhhfrhhomhepnhgvihhlsg esohifnhhmrghilhdrnhgvthdpnhgspghrtghpthhtohephedupdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopehvihhrohesiigvnhhivhdrlhhinhhugidrohhrghdruhhkpd hrtghpthhtoheplhhinhhugidqgihfshesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgt phhtthhopehlihhnuhigqdhunhhiohhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtoheplhhinhhugidqthhrrggtvgdqkhgvrhhnvghlsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqnhhfshesvhhgvghrrdhkvghrnhgvlh drohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkhgvrh hnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqvgigthegsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqvghfihesvhhgvghrrdhkvghrnhgvlh drohhrgh X-ME-Proxy: Feedback-ID: i9d664b8f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Mar 2026 17:56:33 -0400 (EDT) From: NeilBrown To: Linus Torvalds , Alexander Viro , Christian Brauner , Jan Kara , Jeff Layton , Trond Myklebust , Anna Schumaker , Carlos Maiolino , Miklos Szeredi , Amir Goldstein , Jan Harkes , Hugh Dickins , Baolin Wang , David Howells , Marc Dionne , Steve French , Namjae Jeon , Sungjong Seo , Yuezhang Mo , Andreas Hindborg , Breno Leitao , "Theodore Ts'o" , Andreas Dilger , Steven Rostedt , Masami Hiramatsu , Ilya Dryomov , Alex Markuze , Viacheslav Dubeyko , Tyler Hicks , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Jeremy Kerr , Ard Biesheuvel Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-unionfs@vger.kernel.org, coda@cs.cmu.edu, linux-mm@kvack.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, ecryptfs@vger.kernel.org, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-efi@vger.kernel.org Subject: [PATCH 46/53] Remove references to d_add() in documentation and comments. Date: Fri, 13 Mar 2026 08:12:33 +1100 Message-ID: <20260312214330.3885211-47-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty In-Reply-To: <20260312214330.3885211-1-neilb@ownmail.net> References: <20260312214330.3885211-1-neilb@ownmail.net> Reply-To: NeilBrown MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: eirk3unzmdezjg8uxsd31cyyd8aye7o1 X-Rspam-User: X-Rspamd-Queue-Id: 8D6EB40006 X-Rspamd-Server: rspam12 X-HE-Tag: 1773352609-497068 X-HE-Meta: U2FsdGVkX1/FAHQfH6yZLk0P4aWSaIiiUTYKTMSZQ8eE3nRsy9f1mLvNuVDKTXJywQJVZKvATYx8OdOii+e9VwzHLUxvoaBxfEZNEGy6BGw5g0vFScZH5U1ZV/4pEimbpfG/+x6KrlYMetBcDUlLp3AROT/dwh1yo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Ng63NOTvgcQz9vedVUP4DEJp42Ko1eR4xFNapZl2NwYLWV1gQmiscG5AdXA5qIetUv5asW87YkLb/tSfhA3u3K3ynzLFNS9FdSap2XQ9CIsU50ZjBoySG36Dw+SZtgy3UpMYWBq36NEkgbv+HZIKCWmzOS1MQVIEbE+UbC+ty4TjF39WodhKnN+Hj05ps9IUioYaGAGZSGoh932H9FQCo1LrJste1kMJv9FJpzS8SUJtQlvec1+iiFPJfYpYeb+eAvjLO8bc/NWR/u9d8XB2YZ6NReuxmCB0uBalGQ+TnTAZEKsOPfq29UeWvTvOxmkrCqcD1UlhkBXIFfavC8Xt+aT5L8SiqfvMHTae/Yjq+xutJos9Opl8BWcLrRUTBe0iSdlQec3PkcGlUR9H7/PG6lBkcRx0r4Isi0X4w/sXOv64c= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: NeilBrown It is planned to remove d_add(), so remove all references in documentation and comments. Signed-off-by: NeilBrown --- Documentation/filesystems/nfs/exporting.rst | 10 ++-------- Documentation/filesystems/vfs.rst | 4 ++-- fs/afs/dir.c | 5 +++-- fs/dcache.c | 2 +- fs/ocfs2/namei.c | 2 +- fs/xfs/xfs_iops.c | 6 +++--- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Documentation/filesystems/nfs/exporting.rst b/Documentation/filesystems/nfs/exporting.rst index a01d9b9b5bc3..ccaacdc72576 100644 --- a/Documentation/filesystems/nfs/exporting.rst +++ b/Documentation/filesystems/nfs/exporting.rst @@ -101,14 +101,8 @@ Filesystem Issues For a filesystem to be exportable it must: 1. provide the filehandle fragment routines described below. - 2. make sure that d_splice_alias is used rather than d_add - when ->lookup finds an inode for a given parent and name. - - If inode is NULL, d_splice_alias(inode, dentry) is equivalent to:: - - d_add(dentry, inode), NULL - - Similarly, d_splice_alias(ERR_PTR(err), dentry) = ERR_PTR(err) + 2. Use d_splice_alias() when ->lookup finds an inode for a given + parent and name. Typically the ->lookup routine will simply end with a:: diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst index d8df0a84cdba..26dec777ca5c 100644 --- a/Documentation/filesystems/vfs.rst +++ b/Documentation/filesystems/vfs.rst @@ -460,7 +460,7 @@ otherwise noted. ``lookup`` called when the VFS needs to look up an inode in a parent directory. The name to look for is found in the dentry. This - method must call d_add() to insert the found inode into the + method must call d_splice_alias() to insert the found inode into the dentry. The "i_count" field in the inode structure should be incremented. If the named inode does not exist a NULL inode should be inserted into the dentry (this is called a negative @@ -1433,7 +1433,7 @@ manipulate dentries: d_iput() method is called). If there are other references, then d_drop() is called instead -``d_add`` +``d_splice_alias`` add a dentry to its parents hash list and then calls d_instantiate() diff --git a/fs/afs/dir.c b/fs/afs/dir.c index b5c593f50079..f259ca2da383 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -960,8 +960,9 @@ static struct dentry *afs_lookup_atsys(struct inode *dir, struct dentry *dentry, dput(ret); } - /* We don't want to d_add() the @sys dentry here as we don't want to - * the cached dentry to hide changes to the sysnames list. + /* We don't want to d_splice_alias() the @sys dentry here as we + * don't want to the cached dentry to hide changes to the + * sysnames list. */ ret = NULL; out_s: diff --git a/fs/dcache.c b/fs/dcache.c index c48337d95f9a..9a6139013367 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3323,7 +3323,7 @@ struct dentry *d_splice_alias_ops(struct inode *inode, struct dentry *dentry, * @dentry must be negative and may be in-lookup or unhashed or hashed. * * If inode is a directory and has an IS_ROOT alias, then d_move that in - * place of the given dentry and return it, else simply d_add the inode + * place of the given dentry and return it, else simply __d_add the inode * to the dentry and return NULL. * * If a non-IS_ROOT directory is found, the filesystem is corrupt, and diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 268b79339a51..0d3116142bd7 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -172,7 +172,7 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry, ocfs2_dentry_attach_gen(dentry); bail_unlock: - /* Don't drop the cluster lock until *after* the d_add -- + /* Don't drop the cluster lock until *after* the d_splice_alias -- * unlink on another node will message us to remove that * dentry under this lock so otherwise we can race this with * the downconvert thread and have a stale dentry. */ diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index ec19d3ec7cf0..2641061ba1db 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -356,9 +356,9 @@ xfs_vn_ci_lookup( if (unlikely(error != -ENOENT)) return ERR_PTR(error); /* - * call d_add(dentry, NULL) here when d_drop_negative_children - * is called in xfs_vn_mknod (ie. allow negative dentries - * with CI filesystems). + * call d_splice_alias(NULL, dentry) here when + * d_drop_negative_children is called in xfs_vn_mknod + * (ie. allow negative dentries with CI filesystems). */ return NULL; } -- 2.50.0.107.gf914562f5916.dirty