提交 4aa32895 编写于 作者: C Christoph Hellwig 提交者: Al Viro

fs: remove vfs_follow_link

For a long time no filesystem has been using vfs_follow_link, and as seen
by recent filesystem submissions any new use is accidental as well.

Remove vfs_follow_link, document the replacement in
Documentation/filesystems/porting and also rename __vfs_follow_link
to match its only caller better.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 b05430fc
...@@ -451,3 +451,7 @@ in your dentry operations instead. ...@@ -451,3 +451,7 @@ in your dentry operations instead.
-- --
[mandatory] [mandatory]
->readdir() is gone now; switch to ->iterate() ->readdir() is gone now; switch to ->iterate()
[mandatory]
vfs_follow_link has been removed. Filesystems must use nd_set_link
from ->follow_link for normal symlinks, or nd_jump_link for magic
/proc/<pid> style links.
...@@ -660,7 +660,7 @@ static __always_inline void set_root_rcu(struct nameidata *nd) ...@@ -660,7 +660,7 @@ static __always_inline void set_root_rcu(struct nameidata *nd)
} }
} }
static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *link) static __always_inline int __follow_link(struct nameidata *nd, const char *link)
{ {
int ret; int ret;
...@@ -874,7 +874,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p) ...@@ -874,7 +874,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p)
error = 0; error = 0;
s = nd_get_link(nd); s = nd_get_link(nd);
if (s) { if (s) {
error = __vfs_follow_link(nd, s); error = __follow_link(nd, s);
if (unlikely(error)) if (unlikely(error))
put_link(nd, link, *p); put_link(nd, link, *p);
} }
...@@ -4236,11 +4236,6 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) ...@@ -4236,11 +4236,6 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
return res; return res;
} }
int vfs_follow_link(struct nameidata *nd, const char *link)
{
return __vfs_follow_link(nd, link);
}
/* get the link contents into pagecache */ /* get the link contents into pagecache */
static char *page_getlink(struct dentry * dentry, struct page **ppage) static char *page_getlink(struct dentry * dentry, struct page **ppage)
{ {
...@@ -4352,7 +4347,6 @@ EXPORT_SYMBOL(vfs_path_lookup); ...@@ -4352,7 +4347,6 @@ EXPORT_SYMBOL(vfs_path_lookup);
EXPORT_SYMBOL(inode_permission); EXPORT_SYMBOL(inode_permission);
EXPORT_SYMBOL(unlock_rename); EXPORT_SYMBOL(unlock_rename);
EXPORT_SYMBOL(vfs_create); EXPORT_SYMBOL(vfs_create);
EXPORT_SYMBOL(vfs_follow_link);
EXPORT_SYMBOL(vfs_link); EXPORT_SYMBOL(vfs_link);
EXPORT_SYMBOL(vfs_mkdir); EXPORT_SYMBOL(vfs_mkdir);
EXPORT_SYMBOL(vfs_mknod); EXPORT_SYMBOL(vfs_mknod);
......
...@@ -2494,7 +2494,6 @@ extern const struct file_operations generic_ro_fops; ...@@ -2494,7 +2494,6 @@ extern const struct file_operations generic_ro_fops;
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
extern int vfs_readlink(struct dentry *, char __user *, int, const char *); extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
extern int vfs_follow_link(struct nameidata *, const char *);
extern int page_readlink(struct dentry *, char __user *, int); extern int page_readlink(struct dentry *, char __user *, int);
extern void *page_follow_link_light(struct dentry *, struct nameidata *); extern void *page_follow_link_light(struct dentry *, struct nameidata *);
extern void page_put_link(struct dentry *, struct nameidata *, void *); extern void page_put_link(struct dentry *, struct nameidata *, void *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册