mtd/fs/jffs2 symlink.c,1.17,1.18

gleixner at infradead.org gleixner at infradead.org
Sun Nov 6 06:03:29 EST 2005


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv22128

Modified Files:
	symlink.c 
Log Message:
Mainline sync. Fix symlink error handling and function pointers by Al Viro

Index: symlink.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/symlink.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- symlink.c	17 Jul 2005 11:13:47 -0000	1.17
+++ symlink.c	6 Nov 2005 11:03:27 -0000	1.18
@@ -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,10 +27,11 @@
 	.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->target;
+
 	/*
 	 * We don't acquire the f->sem mutex here since the only data we
 	 * use is f->target.
@@ -44,19 +45,19 @@
 	 * nd_set_link() call.
 	 */
 	
-	if (!f->target) {
+	if (!p) {
 		printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n");
-		return -EIO;
+		p = ERR_PTR(-EIO);
 	}
 	D1(printk(KERN_DEBUG "jffs2_follow_link(): target path is '%s'\n", (char *) f->target));
 
-	nd_set_link(nd, (char *)f->target);
+	nd_set_link(nd, p);
 	
 	/*
 	 * We will unlock the f->sem mutex but VFS will use the f->target string. This is safe
 	 * since the only way that may cause f->target to be changed is iput() operation.
 	 * But VFS will not use f->target after iput() has been called.
 	 */
-	return 0;
+	return NULL;
 }
 





More information about the linux-mtd-cvs mailing list