diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-09-09 10:16:41 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-10 18:56:29 -0400 |
commit | aac34df11791d25417f7d756dc277b6f95996b47 (patch) | |
tree | 0a0becb7fdff62056c065b9223058f0285fd5bf5 | |
parent | b05430fc9341fea7a6228a3611c850a476809596 (diff) |
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | Documentation/filesystems/porting | 4 | ||||
-rw-r--r-- | fs/namei.c | 10 | ||||
-rw-r--r-- | include/linux/fs.h | 1 |
3 files changed, 6 insertions, 9 deletions
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 206a1bdc7321..f0890581f7f6 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -451,3 +451,7 @@ in your dentry operations instead. | |||
451 | -- | 451 | -- |
452 | [mandatory] | 452 | [mandatory] |
453 | ->readdir() is gone now; switch to ->iterate() | 453 | ->readdir() is gone now; switch to ->iterate() |
454 | [mandatory] | ||
455 | vfs_follow_link has been removed. Filesystems must use nd_set_link | ||
456 | from ->follow_link for normal symlinks, or nd_jump_link for magic | ||
457 | /proc/<pid> style links. | ||
diff --git a/fs/namei.c b/fs/namei.c index 409a441ba2ae..b0b2cf25075b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -660,7 +660,7 @@ static __always_inline void set_root_rcu(struct nameidata *nd) | |||
660 | } | 660 | } |
661 | } | 661 | } |
662 | 662 | ||
663 | static __always_inline int __vfs_follow_link(struct nameidata *nd, const char *link) | 663 | static __always_inline int __follow_link(struct nameidata *nd, const char *link) |
664 | { | 664 | { |
665 | int ret; | 665 | int ret; |
666 | 666 | ||
@@ -874,7 +874,7 @@ follow_link(struct path *link, struct nameidata *nd, void **p) | |||
874 | error = 0; | 874 | error = 0; |
875 | s = nd_get_link(nd); | 875 | s = nd_get_link(nd); |
876 | if (s) { | 876 | if (s) { |
877 | error = __vfs_follow_link(nd, s); | 877 | error = __follow_link(nd, s); |
878 | if (unlikely(error)) | 878 | if (unlikely(error)) |
879 | put_link(nd, link, *p); | 879 | put_link(nd, link, *p); |
880 | } | 880 | } |
@@ -4236,11 +4236,6 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | |||
4236 | return res; | 4236 | return res; |
4237 | } | 4237 | } |
4238 | 4238 | ||
4239 | int vfs_follow_link(struct nameidata *nd, const char *link) | ||
4240 | { | ||
4241 | return __vfs_follow_link(nd, link); | ||
4242 | } | ||
4243 | |||
4244 | /* get the link contents into pagecache */ | 4239 | /* get the link contents into pagecache */ |
4245 | static char *page_getlink(struct dentry * dentry, struct page **ppage) | 4240 | static char *page_getlink(struct dentry * dentry, struct page **ppage) |
4246 | { | 4241 | { |
@@ -4352,7 +4347,6 @@ EXPORT_SYMBOL(vfs_path_lookup); | |||
4352 | EXPORT_SYMBOL(inode_permission); | 4347 | EXPORT_SYMBOL(inode_permission); |
4353 | EXPORT_SYMBOL(unlock_rename); | 4348 | EXPORT_SYMBOL(unlock_rename); |
4354 | EXPORT_SYMBOL(vfs_create); | 4349 | EXPORT_SYMBOL(vfs_create); |
4355 | EXPORT_SYMBOL(vfs_follow_link); | ||
4356 | EXPORT_SYMBOL(vfs_link); | 4350 | EXPORT_SYMBOL(vfs_link); |
4357 | EXPORT_SYMBOL(vfs_mkdir); | 4351 | EXPORT_SYMBOL(vfs_mkdir); |
4358 | EXPORT_SYMBOL(vfs_mknod); | 4352 | EXPORT_SYMBOL(vfs_mknod); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 529d8711baba..49e71b0f0e9f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2494,7 +2494,6 @@ extern const struct file_operations generic_ro_fops; | |||
2494 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) | 2494 | #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) |
2495 | 2495 | ||
2496 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); | 2496 | extern int vfs_readlink(struct dentry *, char __user *, int, const char *); |
2497 | extern int vfs_follow_link(struct nameidata *, const char *); | ||
2498 | extern int page_readlink(struct dentry *, char __user *, int); | 2497 | extern int page_readlink(struct dentry *, char __user *, int); |
2499 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); | 2498 | extern void *page_follow_link_light(struct dentry *, struct nameidata *); |
2500 | extern void page_put_link(struct dentry *, struct nameidata *, void *); | 2499 | extern void page_put_link(struct dentry *, struct nameidata *, void *); |