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
f2df5da6
Commit
f2df5da6
authored
Jul 19, 2018
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fold generic_readlink() into its only caller
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
69448867
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
24 deletions
+12
-24
fs/namei.c
fs/namei.c
+12
-24
No files found.
fs/namei.c
View file @
f2df5da6
...
...
@@ -4712,29 +4712,6 @@ int readlink_copy(char __user *buffer, int buflen, const char *link)
return
len
;
}
/*
* A helper for ->readlink(). This should be used *ONLY* for symlinks that
* have ->get_link() not calling nd_jump_link(). Using (or not using) it
* for any given inode is up to filesystem.
*/
static
int
generic_readlink
(
struct
dentry
*
dentry
,
char
__user
*
buffer
,
int
buflen
)
{
DEFINE_DELAYED_CALL
(
done
);
struct
inode
*
inode
=
d_inode
(
dentry
);
const
char
*
link
=
inode
->
i_link
;
int
res
;
if
(
!
link
)
{
link
=
inode
->
i_op
->
get_link
(
dentry
,
inode
,
&
done
);
if
(
IS_ERR
(
link
))
return
PTR_ERR
(
link
);
}
res
=
readlink_copy
(
buffer
,
buflen
,
link
);
do_delayed_call
(
&
done
);
return
res
;
}
/**
* vfs_readlink - copy symlink body into userspace buffer
* @dentry: dentry on which to get symbolic link
...
...
@@ -4748,6 +4725,9 @@ static int generic_readlink(struct dentry *dentry, char __user *buffer,
int
vfs_readlink
(
struct
dentry
*
dentry
,
char
__user
*
buffer
,
int
buflen
)
{
struct
inode
*
inode
=
d_inode
(
dentry
);
DEFINE_DELAYED_CALL
(
done
);
const
char
*
link
;
int
res
;
if
(
unlikely
(
!
(
inode
->
i_opflags
&
IOP_DEFAULT_READLINK
)))
{
if
(
unlikely
(
inode
->
i_op
->
readlink
))
...
...
@@ -4761,7 +4741,15 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
spin_unlock
(
&
inode
->
i_lock
);
}
return
generic_readlink
(
dentry
,
buffer
,
buflen
);
link
=
inode
->
i_link
;
if
(
!
link
)
{
link
=
inode
->
i_op
->
get_link
(
dentry
,
inode
,
&
done
);
if
(
IS_ERR
(
link
))
return
PTR_ERR
(
link
);
}
res
=
readlink_copy
(
buffer
,
buflen
,
link
);
do_delayed_call
(
&
done
);
return
res
;
}
EXPORT_SYMBOL
(
vfs_readlink
);
...
...
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