* [PATCH] jffs2, symlink, and 2.6.13
@ 2005-10-01 0:17 Peter Grayson
2005-10-04 11:16 ` Artem B. Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Peter Grayson @ 2005-10-01 0:17 UTC (permalink / raw)
To: linux-mtd
[-- 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;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] jffs2, symlink, and 2.6.13
2005-10-01 0:17 [PATCH] jffs2, symlink, and 2.6.13 Peter Grayson
@ 2005-10-04 11:16 ` Artem B. Bityutskiy
2005-10-04 13:02 ` Josh Boyer
0 siblings, 1 reply; 4+ messages in thread
From: Artem B. Bityutskiy @ 2005-10-04 11:16 UTC (permalink / raw)
To: Peter Grayson; +Cc: linux-mtd
Peter Grayson wrote:
> 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?
The patch looks OK. Not sure how to support compatimility, I would just
let gcc print warnings in older kernels. And it looks like it is
harmless. Anyone, comments?
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] jffs2, symlink, and 2.6.13
2005-10-04 11:16 ` Artem B. Bityutskiy
@ 2005-10-04 13:02 ` Josh Boyer
2005-10-04 13:14 ` Artem B. Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Josh Boyer @ 2005-10-04 13:02 UTC (permalink / raw)
To: Artem B. Bityutskiy; +Cc: linux-mtd
On Tue, 2005-10-04 at 15:16 +0400, Artem B. Bityutskiy wrote:
> Peter Grayson wrote:
> > 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?
>
> The patch looks OK. Not sure how to support compatimility, I would just
> let gcc print warnings in older kernels. And it looks like it is
> harmless. Anyone, comments?
I'd rather it be added to compatmac.h. We have things in there that
support older 2.6 kernels already, so adding another wouldn't hurt.
There's even a section for kernels older than 2.6.13 already.
josh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] jffs2, symlink, and 2.6.13
2005-10-04 13:02 ` Josh Boyer
@ 2005-10-04 13:14 ` Artem B. Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem B. Bityutskiy @ 2005-10-04 13:14 UTC (permalink / raw)
To: Josh Boyer; +Cc: Artem B. Bityutskiy, linux-mtd
On Tue, 2005-10-04 at 08:02 -0500, Josh Boyer wrote:
> On Tue, 2005-10-04 at 15:16 +0400, Artem B. Bityutskiy wrote:
> > Peter Grayson wrote:
> > > 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?
> >
> > The patch looks OK. Not sure how to support compatimility, I would just
> > let gcc print warnings in older kernels. And it looks like it is
> > harmless. Anyone, comments?
>
> I'd rather it be added to compatmac.h. We have things in there that
> support older 2.6 kernels already, so adding another wouldn't hurt.
> There's even a section for kernels older than 2.6.13 already.
Yes, it is better, providing one do it it elegantly and without
introducing any crap to symlink.c.
--
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-10-04 13:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-01 0:17 [PATCH] jffs2, symlink, and 2.6.13 Peter Grayson
2005-10-04 11:16 ` Artem B. Bityutskiy
2005-10-04 13:02 ` Josh Boyer
2005-10-04 13:14 ` Artem B. Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox