[Yaffs] [PATCH] follow_link prototype change in 2.6.14

Top Page
Attachments:
Message as email
+ (text/plain)
+ yaffs_follow_link.patch (text/plain)
Delete this message
Reply to this message
Author: Andre Renaud
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] follow_link prototype change in 2.6.14
follow_link in inode_operations now has the following prototype
        void * (*follow_link) (struct dentry *, struct nameidata *);


Attached is a patch to fix this up in yaffs_fs.c

--
Bluewater Systems Ltd - ARM Technology Solutions Centre

       Andre Renaud                             Bluewater Systems Ltd
Phone: +64 3 3779127 (Aus 1 800 148 751)        Level 17, 119 Armagh St
Fax:   +64 3 3779135                            PO Box 13889
Email:                  Christchurch
Web:   http://www.bluewatersys.com              New Zealand

--- /home/andre/snapper//yaffs2/yaffs_fs.c    2005-10-28 11:24:04.000000000 +1300
+++ yaffs_fs.c    2005-11-14 14:28:42.000000000 +1300
@@ -152,7 +152,11 @@


 static int yaffs_readlink(struct dentry *dentry, char __user * buffer,
               int buflen);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
+static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
+#else
 static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd);
+#endif


 static struct address_space_operations yaffs_file_address_operations = {
     .readpage = yaffs_readpage,
@@ -243,7 +247,11 @@
     return ret;
 }


+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
+static void *yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
+#else
 static int yaffs_follow_link(struct dentry *dentry, struct nameidata *nd)
+#endif
 {
     unsigned char *alias;
     int ret;
@@ -256,11 +264,19 @@
     yaffs_GrossUnlock(dev);


     if (!alias)
-        return -ENOMEM;
+        {
+        ret = -ENOMEM;
+        goto out;
+        }


     ret = vfs_follow_link(nd, alias);
     kfree(alias);
+out:
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
+    return ERR_PTR (ret);
+#else
     return ret;
+#endif
 }


struct inode *yaffs_get_inode(struct super_block *sb, int mode, int dev,