···99 *1010 */11111212-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt1313-1414-#include <linux/kernel.h>1515-#include <linux/fs.h>1616-#include <linux/namei.h>1712#include "nodelist.h"1818-1919-static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);20132114const struct inode_operations jffs2_symlink_inode_operations =2215{2316 .readlink = generic_readlink,2424- .follow_link = jffs2_follow_link,1717+ .follow_link = simple_follow_link,2518 .setattr = jffs2_setattr,2619 .setxattr = jffs2_setxattr,2720 .getxattr = jffs2_getxattr,2821 .listxattr = jffs2_listxattr,2922 .removexattr = jffs2_removexattr3023};3131-3232-static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)3333-{3434- struct jffs2_inode_info *f = JFFS2_INODE_INFO(d_inode(dentry));3535- char *p = (char *)f->target;3636-3737- /*3838- * We don't acquire the f->sem mutex here since the only data we3939- * use is f->target.4040- *4141- * 1. If we are here the inode has already built and f->target has4242- * to point to the target path.4343- * 2. Nobody uses f->target (if the inode is symlink's inode). The4444- * exception is inode freeing function which frees f->target. But4545- * it can't be called while we are here and before VFS has4646- * stopped using our f->target string which we provide by means of4747- * nd_set_link() call.4848- */4949-5050- if (!p) {5151- pr_err("%s(): can't find symlink target\n", __func__);5252- p = ERR_PTR(-EIO);5353- }5454- jffs2_dbg(1, "%s(): target path is '%s'\n",5555- __func__, (char *)f->target);5656-5757- nd_set_link(nd, p);5858-5959- /*6060- * We will unlock the f->sem mutex but VFS will use the f->target string. This is safe6161- * since the only way that may cause f->target to be changed is iput() operation.6262- * But VFS will not use f->target after iput() has been called.6363- */6464- return NULL;6565-}6666-