From: NeilBrown <[email protected]> It is planned to remove d_add(), so remove all references in documentation and comments.
Signed-off-by: NeilBrown <[email protected]> --- 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
