diff options
author | Al Viro | 2023-11-18 16:50:29 -0500 |
---|---|---|
committer | Al Viro | 2023-11-25 02:49:43 -0500 |
commit | fb7945b484b8a3c1e204c36eb9e4cf99f32141ee (patch) | |
tree | b964a03fe82cf9df2085f978c9e397851f2729de /fs/nsfs.c | |
parent | 9024b4c96576162a13e58003b0d58e93ebe3ac33 (diff) |
nsfs: use d_make_root()
Normally d_make_root() is used to create the root dentry of superblock;
here we use it for a different purpose, but... idiomatic or not, we
need the same operation.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nsfs.c')
-rw-r--r-- | fs/nsfs.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/nsfs.c b/fs/nsfs.c index 9a4b228d42fa..34e1e3e36733 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -90,12 +90,9 @@ slow: inode->i_fop = &ns_file_operations; inode->i_private = ns; - dentry = d_alloc_anon(mnt->mnt_sb); - if (!dentry) { - iput(inode); + dentry = d_make_root(inode); /* not the normal use, but... */ + if (!dentry) return -ENOMEM; - } - d_instantiate(dentry, inode); dentry->d_fsdata = (void *)ns->ops; d = atomic_long_cmpxchg(&ns->stashed, 0, (unsigned long)dentry); if (d) { |