Commit 76aab3ab authored by Al Viro's avatar Al Viro

proc_sys_fill_cache(): switch to d_alloc_parallel()

make it usable with directory locked shared
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3781764b
...@@ -627,18 +627,19 @@ static bool proc_sys_fill_cache(struct file *file, ...@@ -627,18 +627,19 @@ static bool proc_sys_fill_cache(struct file *file,
child = d_lookup(dir, &qname); child = d_lookup(dir, &qname);
if (!child) { if (!child) {
child = d_alloc(dir, &qname); DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
if (child) { child = d_alloc_parallel(dir, &qname, &wq);
if (IS_ERR(child))
return false;
if (d_in_lookup(child)) {
inode = proc_sys_make_inode(dir->d_sb, head, table); inode = proc_sys_make_inode(dir->d_sb, head, table);
if (!inode) { if (!inode) {
d_lookup_done(child);
dput(child); dput(child);
return false; return false;
} else {
d_set_d_op(child, &proc_sys_dentry_operations);
d_add(child, inode);
} }
} else { d_set_d_op(child, &proc_sys_dentry_operations);
return false; d_add(child, inode);
} }
} }
inode = d_inode(child); inode = d_inode(child);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment