]> err.no Git - linux-2.6/blobdiff - fs/jffs2/symlink.c
Merge /spare/repo/linux-2.6/
[linux-2.6] / fs / jffs2 / symlink.c
index 65ab6b001dcac9d24d9d40aa8bc8527980a0587b..82ef484f5e12337ba1cc190e30275e0ebe7a9e16 100644 (file)
@@ -18,7 +18,7 @@
 #include <linux/namei.h>
 #include "nodelist.h"
 
-static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
+static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
 
 struct inode_operations jffs2_symlink_inode_operations =
 {      
@@ -27,9 +27,10 @@ struct inode_operations jffs2_symlink_inode_operations =
        .setattr =      jffs2_setattr
 };
 
-static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
+static void *jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        struct jffs2_inode_info *f = JFFS2_INODE_INFO(dentry->d_inode);
+       char *p = (char *)f->dents;
        
        /*
         * We don't acquire the f->sem mutex here since the only data we
@@ -45,19 +46,20 @@ static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
         * nd_set_link() call.
         */
        
-       if (!f->dents) {
+       if (!p) {
                printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n");
-               return -EIO;
+               p = ERR_PTR(-EIO);
+       } else {
+               D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents));
        }
-       D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->dents));
 
-       nd_set_link(nd, (char *)f->dents);
+       nd_set_link(nd, p);
        
        /*
         * We unlock the f->sem mutex but VFS will use the f->dents string. This is safe
         * since the only way that may cause f->dents to be changed is iput() operation.
         * But VFS will not use f->dents after iput() has been called.
         */
-       return 0;
+       return NULL;
 }