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
Kirill Smelkov
linux
Commits
7fee4868
Commit
7fee4868
authored
Jan 14, 2010
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch proc/self to nd_set_link()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ac278a9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
fs/proc/base.c
fs/proc/base.c
+19
-5
No files found.
fs/proc/base.c
View file @
7fee4868
...
...
@@ -2369,16 +2369,30 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
{
struct
pid_namespace
*
ns
=
dentry
->
d_sb
->
s_fs_info
;
pid_t
tgid
=
task_tgid_nr_ns
(
current
,
ns
);
char
tmp
[
PROC_NUMBUF
];
if
(
!
tgid
)
return
ERR_PTR
(
-
ENOENT
);
sprintf
(
tmp
,
"%d"
,
task_tgid_nr_ns
(
current
,
ns
));
return
ERR_PTR
(
vfs_follow_link
(
nd
,
tmp
));
char
*
name
=
ERR_PTR
(
-
ENOENT
);
if
(
tgid
)
{
name
=
__getname
();
if
(
!
name
)
name
=
ERR_PTR
(
-
ENOMEM
);
else
sprintf
(
name
,
"%d"
,
tgid
);
}
nd_set_link
(
nd
,
name
);
return
NULL
;
}
static
void
proc_self_put_link
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
,
void
*
cookie
)
{
char
*
s
=
nd_get_link
(
nd
);
if
(
!
IS_ERR
(
s
))
__putname
(
s
);
}
static
const
struct
inode_operations
proc_self_inode_operations
=
{
.
readlink
=
proc_self_readlink
,
.
follow_link
=
proc_self_follow_link
,
.
put_link
=
proc_self_put_link
,
};
/*
...
...
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