From nobody Tue Apr 7 16:16:40 2026 Received: from flow-b6-smtp.messagingengine.com (flow-b6-smtp.messagingengine.com [202.12.124.141]) (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 8412F317142; Thu, 12 Mar 2026 21:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773352610; cv=none; b=IOW8MaDXJhNTCwtsMpSK9RKDR8LzLp+z17tSoNVTNjanjxdKjxVFKQVJRUZ4WYRXnGmC3zbLwkct8Qu+M7h+Fa1BqRS5GtrP5GcTS48s0XeL8IIje0OT/xBbPkU7zRDuCDQRMbnUdLzMUwTaY5ZHsd/Lj/HKpoPVUUEjrOE09zQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773352610; c=relaxed/simple; bh=qepEFLlJxKxGECKoKiRMdWLTH8oH6zcVxSk9a5QLego=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rS1tOE3ovHZXKv5rUL//k6YlMqkarbRu/nB8dlePF/KWZeO8i2sdHpS6Qio4SQUWfqkHJ2TWPG0bW4M8GzeK5MGtcdpW+Nit/xSdrVC7zvBdmPCjTG48pfwJIQsht8qOb8y/C9MwqpI7mmC1Gn0FAHO8pzw35eXboNc+TVoqZ5w= 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=We4QHEc5; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=dJKk8gs7; arc=none smtp.client-ip=202.12.124.141 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="We4QHEc5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dJKk8gs7" 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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/fi= lesystems/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: =20 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) =3D ERR_PTR(err) + 2. Use d_splice_alias() when ->lookup finds an inode for a given=20 + parent and name. =20 Typically the ->lookup routine will simply end with a:: =20 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 =20 -``d_add`` +``d_splice_alias`` add a dentry to its parents hash list and then calls d_instantiate() =20 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 *di= r, struct dentry *dentry, dput(ret); } =20 - /* 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 =3D 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, s= truct dentry *dentry, ocfs2_dentry_attach_gen(dentry); =20 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 !=3D -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; } --=20 2.50.0.107.gf914562f5916.dirty