diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-20 16:36:09 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-02 19:49:30 -0400 |
commit | 76aab3ab61f3051362f20fc26e2c50a65d6ba904 (patch) | |
tree | cba211535a3e126b192c4c8e70654d46e5f2baf3 /fs/proc/proc_sysctl.c | |
parent | 3781764b5cb109152af180a4f17cd3a24d5bc51f (diff) |
proc_sys_fill_cache(): switch to d_alloc_parallel()
make it usable with directory locked shared
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/proc_sysctl.c')
-rw-r--r-- | fs/proc/proc_sysctl.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index fe5b6e6c4671..d69e2385862c 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -627,18 +627,19 @@ static bool proc_sys_fill_cache(struct file *file, | |||
627 | 627 | ||
628 | child = d_lookup(dir, &qname); | 628 | child = d_lookup(dir, &qname); |
629 | if (!child) { | 629 | if (!child) { |
630 | child = d_alloc(dir, &qname); | 630 | DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq); |
631 | if (child) { | 631 | child = d_alloc_parallel(dir, &qname, &wq); |
632 | if (IS_ERR(child)) | ||
633 | return false; | ||
634 | if (d_in_lookup(child)) { | ||
632 | inode = proc_sys_make_inode(dir->d_sb, head, table); | 635 | inode = proc_sys_make_inode(dir->d_sb, head, table); |
633 | if (!inode) { | 636 | if (!inode) { |
637 | d_lookup_done(child); | ||
634 | dput(child); | 638 | dput(child); |
635 | return false; | 639 | return false; |
636 | } else { | ||
637 | d_set_d_op(child, &proc_sys_dentry_operations); | ||
638 | d_add(child, inode); | ||
639 | } | 640 | } |
640 | } else { | 641 | d_set_d_op(child, &proc_sys_dentry_operations); |
641 | return false; | 642 | d_add(child, inode); |
642 | } | 643 | } |
643 | } | 644 | } |
644 | inode = d_inode(child); | 645 | inode = d_inode(child); |