Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
888e2b03
Commit
888e2b03
authored
May 03, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch the rest of procfs lookups to d_splice_alias()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
0168b9e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
fs/proc/generic.c
fs/proc/generic.c
+1
-2
fs/proc/proc_sysctl.c
fs/proc/proc_sysctl.c
+12
-3
No files found.
fs/proc/generic.c
View file @
888e2b03
...
...
@@ -256,8 +256,7 @@ struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
if
(
!
inode
)
return
ERR_PTR
(
-
ENOMEM
);
d_set_d_op
(
dentry
,
&
proc_misc_dentry_ops
);
d_add
(
dentry
,
inode
);
return
NULL
;
return
d_splice_alias
(
inode
,
dentry
);
}
read_unlock
(
&
proc_subdir_lock
);
return
ERR_PTR
(
-
ENOENT
);
...
...
fs/proc/proc_sysctl.c
View file @
888e2b03
...
...
@@ -554,9 +554,8 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry,
if
(
!
inode
)
goto
out
;
err
=
NULL
;
d_set_d_op
(
dentry
,
&
proc_sys_dentry_operations
);
d_add
(
dentry
,
inode
);
err
=
d_splice_alias
(
inode
,
dentry
);
out:
if
(
h
)
...
...
@@ -684,6 +683,7 @@ static bool proc_sys_fill_cache(struct file *file,
if
(
IS_ERR
(
child
))
return
false
;
if
(
d_in_lookup
(
child
))
{
struct
dentry
*
res
;
inode
=
proc_sys_make_inode
(
dir
->
d_sb
,
head
,
table
);
if
(
!
inode
)
{
d_lookup_done
(
child
);
...
...
@@ -691,7 +691,16 @@ static bool proc_sys_fill_cache(struct file *file,
return
false
;
}
d_set_d_op
(
child
,
&
proc_sys_dentry_operations
);
d_add
(
child
,
inode
);
res
=
d_splice_alias
(
inode
,
child
);
d_lookup_done
(
child
);
if
(
unlikely
(
res
))
{
if
(
IS_ERR
(
res
))
{
dput
(
child
);
return
false
;
}
dput
(
child
);
child
=
res
;
}
}
}
inode
=
d_inode
(
child
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment