Commit 3781764b authored by Al Viro's avatar Al Viro

proc_fill_cache(): switch to d_alloc_parallel()

... making it usable with directory locked shared
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 61922694
...@@ -1819,14 +1819,19 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, ...@@ -1819,14 +1819,19 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
child = d_hash_and_lookup(dir, &qname); child = d_hash_and_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))
goto end_instantiate; goto end_instantiate;
if (instantiate(d_inode(dir), child, task, ptr) < 0) { if (d_in_lookup(child)) {
int err = instantiate(d_inode(dir), child, task, ptr);
d_lookup_done(child);
if (err < 0) {
dput(child); dput(child);
goto end_instantiate; goto end_instantiate;
} }
} }
}
inode = d_inode(child); inode = d_inode(child);
ino = inode->i_ino; ino = inode->i_ino;
type = inode->i_mode >> 12; type = inode->i_mode >> 12;
......
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