Linux filesystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@ownmail.net>
To: Ilya Dryomov <idryomov@gmail.com>,
	Alex Markuze <amarkuze@redhat.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Christian Brauner <brauner@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel@vger.kernel.org, ceph-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] cephfs: stop using d_add()
Date: Tue, 29 Sep 2026 12:47:41 +1000	[thread overview]
Message-ID: <20260929025331.1436824-4-neilb@ownmail.net> (raw)
In-Reply-To: <20260929025331.1436824-1-neilb@ownmail.net>

From: NeilBrown <neil@brown.name>

d_add() is being deprecated in favour of d_splice_alias()
So replace all uses in cephfs.

Signed-off-by: NeilBrown <neil@brown.name>
---
 fs/ceph/dir.c   | 4 ++--
 fs/ceph/inode.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 2e5c0ccb1b34..35c18020d0f4 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -779,7 +779,7 @@ struct dentry *ceph_finish_lookup(struct ceph_mds_request *req,
 						d_inode(dentry->d_parent);
 					if (!parent ||
 					    ceph_snap(parent) == CEPH_NOSNAP)
-						d_add(dentry, NULL);
+						d_splice_alias(NULL, dentry);
 				}
 			}
 		}
@@ -853,7 +853,7 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
 			doutc(cl, " dir %llx.%llx complete, -ENOENT\n",
 			      ceph_vinop(dir));
 			if (d_unhashed(dentry))
-				d_add(dentry, NULL);
+				d_splice_alias(NULL, dentry);
 			di->lease_shared_gen = atomic_read(&ci->i_shared_gen);
 			return NULL;
 		}
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 01c468a509e2..07868fcfc6cc 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1813,7 +1813,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req)
 			} else if (have_lease) {
 				if (d_unhashed(dn) &&
 				    ceph_snap(dir) == CEPH_NOSNAP)
-					d_add(dn, NULL);
+					d_splice_alias(NULL, dn);
 			}
 
 			if (!d_unhashed(dn) && have_lease)
-- 
2.50.0.107.gf914562f5916.dirty


      parent reply	other threads:[~2026-09-29  2:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  2:47 [PATCH 0/3] cephfs: prepare for changes to VFS locking NeilBrown
2026-09-29  2:47 ` [PATCH 1/3] cephfs: Use d_alloc_trylock() in ceph_readdir_prepopulate() NeilBrown
2026-09-29  2:47 ` [PATCH 2/3] cephfs: Don't d_drop() before d_splice_alias() NeilBrown
2026-09-29  2:47 ` NeilBrown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260929025331.1436824-4-neilb@ownmail.net \
    --to=neilb@ownmail.net \
    --cc=amarkuze@redhat.com \
    --cc=brauner@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=slava@dubeyko.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox