summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro2015-05-02 15:54:06 +0200
committerAl Viro2015-05-11 04:18:20 +0200
commit61ba64fc0768879a300599b011c176203bdf27d9 (patch)
treed04c61005dabd79e05edca9ed87c88c0a04905da /fs
parentext4: split inode_operations for encrypted symlinks off the rest (diff)
downloadkernel-qcow2-linux-61ba64fc0768879a300599b011c176203bdf27d9.tar.gz
kernel-qcow2-linux-61ba64fc0768879a300599b011c176203bdf27d9.tar.xz
kernel-qcow2-linux-61ba64fc0768879a300599b011c176203bdf27d9.zip
libfs: simple_follow_link()
let "fast" symlinks store the pointer to the body into ->i_link and use simple_follow_link for ->follow_link() Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/inode.c1
-rw-r--r--fs/libfs.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index ea37cd17b53f..952fb4852e38 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -152,6 +152,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
inode->i_pipe = NULL;
inode->i_bdev = NULL;
inode->i_cdev = NULL;
+ inode->i_link = NULL;
inode->i_rdev = 0;
inode->dirtied_when = 0;
diff --git a/fs/libfs.c b/fs/libfs.c
index cb1fb4b9b637..72e4e015455f 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -1093,3 +1093,16 @@ simple_nosetlease(struct file *filp, long arg, struct file_lock **flp,
return -EINVAL;
}
EXPORT_SYMBOL(simple_nosetlease);
+
+void *simple_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+ nd_set_link(nd, d_inode(dentry)->i_link);
+ return NULL;
+}
+EXPORT_SYMBOL(simple_follow_link);
+
+const struct inode_operations simple_symlink_inode_operations = {
+ .follow_link = simple_follow_link,
+ .readlink = generic_readlink
+};
+EXPORT_SYMBOL(simple_symlink_inode_operations);