libfs: simple_follow_link()
[firefly-linux-kernel-4.4.55.git] / fs / libfs.c
index cb1fb4b9b6377b09b669b833cc3437b259b622f6..72e4e015455f5e6bdc4ea3bba0e4fda28e6057a6 100644 (file)
@@ -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);