mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 22:24:11 +08:00
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>
This commit is contained in:
parent
9024b4c965
commit
fb7945b484
@ -90,12 +90,9 @@ slow:
|
|||||||
inode->i_fop = &ns_file_operations;
|
inode->i_fop = &ns_file_operations;
|
||||||
inode->i_private = ns;
|
inode->i_private = ns;
|
||||||
|
|
||||||
dentry = d_alloc_anon(mnt->mnt_sb);
|
dentry = d_make_root(inode); /* not the normal use, but... */
|
||||||
if (!dentry) {
|
if (!dentry)
|
||||||
iput(inode);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
d_instantiate(dentry, inode);
|
|
||||||
dentry->d_fsdata = (void *)ns->ops;
|
dentry->d_fsdata = (void *)ns->ops;
|
||||||
d = atomic_long_cmpxchg(&ns->stashed, 0, (unsigned long)dentry);
|
d = atomic_long_cmpxchg(&ns->stashed, 0, (unsigned long)dentry);
|
||||||
if (d) {
|
if (d) {
|
||||||
|
Loading…
Reference in New Issue
Block a user