public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Peter Grayson <pgrayson@realmsys.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH] jffs2, symlink, and 2.6.13
Date: Fri, 30 Sep 2005 18:17:26 -0600	[thread overview]
Message-ID: <1128125846.6926.120.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

The function prototype for follow_link() in struct inode_operations
changed in linux 2.6.13. Instead of returning int, it now expects
returning void*.

I have attached a patch that fixes up the jffs2 code to accommodate the
new prototype. No functional changes were made to the jffs2 code.

For those on earlier kernel versions, this change will yield compiler
warnings. I am not sure what the policy is for maintaining compatibility
with older kernel versions, so I did not include any changes to
compatmac.h. Do we want to reproduce the struct inode_operations
declaration in compatmac.h just so that latest mtd does not yield
compiler warnings on older kernels?

Pete


[-- Attachment #2: jffs2-symlink.patch --]
[-- Type: text/x-patch, Size: 1764 bytes --]

[jffs2] Fixup symlink.c for linux 2.6.13
[From: Peter Grayson <pgrayson@realmsys.com>]
diff -uNr mtd/fs/jffs2/symlink.c mtd-jffs2-symlink/fs/jffs2/symlink.c
--- mtd/fs/jffs2/symlink.c	2005-08-30 15:47:52.000000000 -0600
+++ mtd-jffs2-symlink/fs/jffs2/symlink.c	2005-09-30 17:41:48.164336152 -0600
@@ -18,19 +18,19 @@
 #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 =
-{	
+{
 	.readlink =	generic_readlink,
 	.follow_link =	jffs2_follow_link,
 	.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);
-	
+
 	/*
 	 * We don't acquire the f->sem mutex here since the only data we
 	 * use is f->target.
@@ -43,20 +43,20 @@
 	 * stopped using our f->target string which we provide by means of
 	 * nd_set_link() call.
 	 */
-	
+
 	if (!f->target) {
-		printk(KERN_ERR "jffs2_follow_link(): can't find symlink taerget\n");
-		return -EIO;
+		printk(KERN_ERR "jffs2_follow_link(): can't find symlink target\n");
+		return 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);
-	
+
 	/*
 	 * 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;
 }
 

             reply	other threads:[~2005-10-01  0:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-01  0:17 Peter Grayson [this message]
2005-10-04 11:16 ` [PATCH] jffs2, symlink, and 2.6.13 Artem B. Bityutskiy
2005-10-04 13:02   ` Josh Boyer
2005-10-04 13:14     ` Artem B. Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1128125846.6926.120.camel@localhost.localdomain \
    --to=pgrayson@realmsys.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox