mtd/fs/jffs2 symlink-v24.c,1.13,1.14

dmarlin at infradead.org dmarlin at infradead.org
Fri Aug 6 14:09:31 EDT 2004


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

Modified Files:
	symlink-v24.c 
Log Message:
Revert to a pre-2.6 kernel version (v1.12) for 2.4 kernel builds

Index: symlink-v24.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/symlink-v24.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- symlink-v24.c	13 Jul 2004 09:00:26 -0000	1.13
+++ symlink-v24.c	6 Aug 2004 18:09:29 -0000	1.14
@@ -15,31 +15,43 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/fs.h>
-#include <linux/namei.h>
 #include "nodelist.h"
 
-static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
-static void jffs2_put_link(struct dentry *dentry, struct nameidata *nd);
+int jffs2_readlink(struct dentry *dentry, char *buffer, int buflen);
+int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd);
 
 struct inode_operations jffs2_symlink_inode_operations =
 {	
-	.readlink =	generic_readlink,
+	.readlink =	jffs2_readlink,
 	.follow_link =	jffs2_follow_link,
-	.put_link =	jffs2_put_link,
 	.setattr =	jffs2_setattr
 };
 
-static int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
+int jffs2_readlink(struct dentry *dentry, char *buffer, int buflen)
 {
-	unsigned char *buf;
-	buf = jffs2_getlink(JFFS2_SB_INFO(dentry->d_inode->i_sb), JFFS2_INODE_INFO(dentry->d_inode));
-	nd_set_link(nd, buf);
-	return 0;
+	unsigned char *kbuf;
+	int ret;
+
+	kbuf = jffs2_getlink(JFFS2_SB_INFO(dentry->d_inode->i_sb), JFFS2_INODE_INFO(dentry->d_inode));
+	if (IS_ERR(kbuf))
+		return PTR_ERR(kbuf);
+
+	ret = vfs_readlink(dentry, buffer, buflen, kbuf);
+	kfree(kbuf);
+	return ret;
 }
 
-static void jffs2_put_link(struct dentry *dentry, struct nameidata *nd)
+int jffs2_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
-	char *s = nd_get_link(nd);
-	if (!IS_ERR(s))
-		kfree(s);
+	unsigned char *buf;
+	int ret;
+
+	buf = jffs2_getlink(JFFS2_SB_INFO(dentry->d_inode->i_sb), JFFS2_INODE_INFO(dentry->d_inode));
+
+	if (IS_ERR(buf))
+		return PTR_ERR(buf);
+
+	ret = vfs_follow_link(nd, buf);
+	kfree(buf);
+	return ret;
 }





More information about the linux-mtd-cvs mailing list