Hi Ratheendran,
I have attached the patch I used for building under linux 3.4.7 -- I got similar
build errors as you, so hopefully it will help.
I also have a patch to fix the 'inband tags' option on linux, but I am waiting
for feedback (see previous mail) before releasing.
Cheers,
Angus
On 12/06/2012 04:48 AM, Ratheendran R wrote:
> Hi All,
>
> I recently changed the kernel for my arm9 based system from linux 2.6.21
> to linux 3.6.8. I then applied the patch as suggested in the Readme
> document.
>
> now, when I select the YAFFS2 package with the kernel configuration and
> compile I get the error message and I am not able to do any thing further.
>
>
> site used to download yaffs2...
> *it clone git://www.aleph1.co.uk/yaffs2 <http://www.aleph1.co.uk/yaffs2>*
>
> messages capturing the compilation error.
>
>
> esslsdk@esslsdk-desktop:~/linux_kernel/linux-3.6.8_newyffs$ make
> scripts/kconfig/conf --silentoldconfig Kconfig
> CHK include/linux/version.h
> CHK include/generated/utsrelease.h
> make[1]: `include/generated/mach-types.h' is up to date.
> CALL scripts/checksyscalls.sh
> CHK include/generated/compile.h
> CHK kernel/config_data.h
> CC fs/yaffs2/yaffs_ecc.o
> CC fs/yaffs2/yaffs_vfs.o
> fs/yaffs2/yaffs_vfs.c:438: warning: initialization from incompatible
> pointer type
> fs/yaffs2/yaffs_vfs.c:439: warning: initialization from incompatible
> pointer type
> fs/yaffs2/yaffs_vfs.c:443: warning: initialization from incompatible
> pointer type
> fs/yaffs2/yaffs_vfs.c:445: warning: initialization from incompatible
> pointer type
> fs/yaffs2/yaffs_vfs.c:478: error: unknown field 'write_super' specified
> in initializer
> fs/yaffs2/yaffs_vfs.c:478: warning: initialization from incompatible
> pointer type
> fs/yaffs2/yaffs_vfs.c: In function 'yaffs_evict_inode':
> fs/yaffs2/yaffs_vfs.c:873: error: implicit declaration of function
> 'end_writeback'
> fs/yaffs2/yaffs_vfs.c: In function 'yaffs_do_sync_fs':
> fs/yaffs2/yaffs_vfs.c:2203: error: 'struct super_block' has no member
> named 's_dirt'
> fs/yaffs2/yaffs_vfs.c:2214: error: 'struct super_block' has no member
> named 's_dirt'
> fs/yaffs2/yaffs_vfs.c:2216: error: 'struct super_block' has no member
> named 's_dirt'
> fs/yaffs2/yaffs_vfs.c: In function 'yaffs_put_super':
> fs/yaffs2/yaffs_vfs.c:2506: error: 'struct mtd_info' has no member named
> 'sync'
> fs/yaffs2/yaffs_vfs.c:2507: error: 'struct mtd_info' has no member named
> 'sync'
> fs/yaffs2/yaffs_vfs.c: In function 'yaffs_touch_super':
> fs/yaffs2/yaffs_vfs.c:2523: error: 'struct super_block' has no member
> named 's_dirt'
> fs/yaffs2/yaffs_vfs.c: In function 'yaffs_internal_read_super':
> fs/yaffs2/yaffs_vfs.c:2699: error: 'struct mtd_info' has no member named
> 'erase'
> fs/yaffs2/yaffs_vfs.c:2700: error: 'struct mtd_info' has no member named
> 'read'
> fs/yaffs2/yaffs_vfs.c:2701: error: 'struct mtd_info' has no member named
> 'write'
> fs/yaffs2/yaffs_vfs.c:2702: error: 'struct mtd_info' has no member named
> 'read_oob'
> fs/yaffs2/yaffs_vfs.c:2703: error: 'struct mtd_info' has no member named
> 'write_oob'
> fs/yaffs2/yaffs_vfs.c:2704: error: 'struct mtd_info' has no member named
> 'block_isbad'
> fs/yaffs2/yaffs_vfs.c:2705: error: 'struct mtd_info' has no member named
> 'block_markbad'
> fs/yaffs2/yaffs_vfs.c:2729: error: 'struct mtd_info' has no member named
> 'erase'
> fs/yaffs2/yaffs_vfs.c:2730: error: 'struct mtd_info' has no member named
> 'block_isbad'
> fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named
> 'block_markbad'
> fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named
> 'read'
> fs/yaffs2/yaffs_vfs.c:2731: error: 'struct mtd_info' has no member named
> 'write'
> fs/yaffs2/yaffs_vfs.c:2733: error: 'struct mtd_info' has no member named
> 'read_oob'
> fs/yaffs2/yaffs_vfs.c:2733: error: 'struct mtd_info' has no member named
> 'write_oob'
> fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named
> 'erase'
> fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named
> 'read'
> fs/yaffs2/yaffs_vfs.c:2754: error: 'struct mtd_info' has no member named
> 'write'
> fs/yaffs2/yaffs_vfs.c:2756: error: 'struct mtd_info' has no member named
> 'read_oob'
> fs/yaffs2/yaffs_vfs.c:2756: error: 'struct mtd_info' has no member named
> 'write_oob'
> fs/yaffs2/yaffs_vfs.c:2946: error: implicit declaration of function
> 'd_alloc_root'
> fs/yaffs2/yaffs_vfs.c:2946: warning: assignment makes pointer from
> integer without a cast
> fs/yaffs2/yaffs_vfs.c:2955: error: 'struct super_block' has no member
> named 's_dirt'
> make[2]: *** [fs/yaffs2/yaffs_vfs.o] Error 1
> make[1]: *** [fs/yaffs2] Error 2
> make: *** [fs] Error 2
>
>
> Kindly let me know the workaround for this problem.I appreciate if any
> one can help me in fixing the problem.
>
> Ratheendran
>
>
>
>
> _______________________________________________
> yaffs mailing list
> yaffs@lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
Subject: [PATCH (linux-stm)] yaffs: fix build errors for linux 3.4.7
This patch fixes some yafss errors when building under linux 3.4.7 (probably due
to kernel API changes).
---
fs/yaffs2/yaffs_mtdif.c | 12 +++++-----
fs/yaffs2/yaffs_vfs.c | 48 +++++++++++++++++++++++++---------------------
2 files changed, 32 insertions(+), 28 deletions(-)
diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c
index e61699d..0e05897 100644
--- a/fs/yaffs2/yaffs_mtdif.c
+++ b/fs/yaffs2/yaffs_mtdif.c
@@ -50,7 +50,7 @@ int nandmtd_erase_block(struct yaffs_dev *dev, int block_no)
ei.callback = NULL;
ei.priv = (u_long) dev;
- retval = mtd->erase(mtd, &ei);
+ retval = mtd_erase(mtd, &ei);
if (retval == 0)
return YAFFS_OK;
@@ -76,7 +76,7 @@ static int yaffs_mtd_write(struct yaffs_dev *dev, int nand_chunk,
ops.datbuf = (u8 *)data;
ops.oobbuf = (u8 *)oob;
- retval = mtd->write_oob(mtd, addr, &ops);
+ retval = mtd_write_oob(mtd, addr, &ops);
if (retval) {
yaffs_trace(YAFFS_TRACE_MTD,
"write_oob failed, chunk %d, mtd error %d",
@@ -112,7 +112,7 @@ static int yaffs_mtd_read(struct yaffs_dev *dev, int nand_chunk,
/* Read page and oob using MTD.
* Check status and determine ECC result.
*/
- retval = mtd->read_oob(mtd, addr, &ops);
+ retval = mtd_read_oob(mtd, addr, &ops);
if (retval)
yaffs_trace(YAFFS_TRACE_MTD,
"read_oob failed, chunk %d, mtd error %d",
@@ -165,7 +165,7 @@ static int yaffs_mtd_erase(struct yaffs_dev *dev, int block_no)
ei.callback = NULL;
ei.priv = (u_long) dev;
- retval = mtd->erase(mtd, &ei);
+ retval = mtd_erase(mtd, &ei);
if (retval == 0)
return YAFFS_OK;
@@ -181,7 +181,7 @@ static int yaffs_mtd_mark_bad(struct yaffs_dev *dev, int block_no)
yaffs_trace(YAFFS_TRACE_BAD_BLOCKS, "marking block %d bad", block_no);
- retval = mtd->block_markbad(mtd, (loff_t) blocksize * block_no);
+ retval = mtd_block_markbad(mtd, (loff_t) blocksize * block_no);
return (retval) ? YAFFS_FAIL : YAFFS_OK;
}
@@ -193,7 +193,7 @@ static int yaffs_mtd_check_bad(struct yaffs_dev *dev, int block_no)
yaffs_trace(YAFFS_TRACE_BAD_BLOCKS, "checking block %d bad", block_no);
- retval = mtd->block_isbad(mtd, (loff_t) blocksize * block_no);
+ retval = mtd_block_isbad(mtd, (loff_t) blocksize * block_no);
return (retval) ? YAFFS_FAIL : YAFFS_OK;
}
diff --git a/fs/yaffs2/yaffs_vfs.c b/fs/yaffs2/yaffs_vfs.c
index 3cf6dde..ecaa347 100644
--- a/fs/yaffs2/yaffs_vfs.c
+++ b/fs/yaffs2/yaffs_vfs.c
@@ -255,7 +255,7 @@ static int yaffs_sync_object(struct file *file, struct dentry *dentry,
static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
-static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode,
+static int yaffs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
struct nameidata *n);
static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry,
struct nameidata *n);
@@ -268,10 +268,10 @@ static int yaffs_link(struct dentry *old_dentry, struct inode *dir,
static int yaffs_unlink(struct inode *dir, struct dentry *dentry);
static int yaffs_symlink(struct inode *dir, struct dentry *dentry,
const char *symname);
-static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode);
+static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
-static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
+static int yaffs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
dev_t dev);
#else
static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
@@ -1617,7 +1617,7 @@ out:
#endif
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
-static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
+static int yaffs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
dev_t rdev)
#else
static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
@@ -1707,7 +1707,7 @@ static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode,
return error;
}
-static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
{
int ret_val;
yaffs_trace(YAFFS_TRACE_OS, "yaffs_mkdir");
@@ -1716,7 +1716,11 @@ static int yaffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
-static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode,
+/*
+static int yaffs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
+ struct nameidata *n)
+*/
+static int yaffs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
struct nameidata *n)
#else
static int yaffs_create(struct inode *dir, struct dentry *dentry, int mode)
@@ -2503,8 +2507,8 @@ static void yaffs_put_super(struct super_block *sb)
kfree(dev);
- if (mtd && mtd->sync)
- mtd->sync(mtd);
+ if (mtd && mtd->_sync)
+ mtd_sync(mtd);
if(mtd)
put_mtd_device(mtd);
@@ -2696,13 +2700,13 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
return NULL;
}
- yaffs_trace(YAFFS_TRACE_OS, " erase %p", mtd->erase);
- yaffs_trace(YAFFS_TRACE_OS, " read %p", mtd->read);
- yaffs_trace(YAFFS_TRACE_OS, " write %p", mtd->write);
- yaffs_trace(YAFFS_TRACE_OS, " readoob %p", mtd->read_oob);
- yaffs_trace(YAFFS_TRACE_OS, " writeoob %p", mtd->write_oob);
- yaffs_trace(YAFFS_TRACE_OS, " block_isbad %p", mtd->block_isbad);
- yaffs_trace(YAFFS_TRACE_OS, " block_markbad %p", mtd->block_markbad);
+ yaffs_trace(YAFFS_TRACE_OS, " erase %p", mtd->_erase);
+ yaffs_trace(YAFFS_TRACE_OS, " read %p", mtd->_read);
+ yaffs_trace(YAFFS_TRACE_OS, " write %p", mtd->_write);
+ yaffs_trace(YAFFS_TRACE_OS, " readoob %p", mtd->_read_oob);
+ yaffs_trace(YAFFS_TRACE_OS, " writeoob %p", mtd->_write_oob);
+ yaffs_trace(YAFFS_TRACE_OS, " block_isbad %p", mtd->_block_isbad);
+ yaffs_trace(YAFFS_TRACE_OS, " block_markbad %p", mtd->_block_markbad);
yaffs_trace(YAFFS_TRACE_OS, " %s %d", WRITE_SIZE_STR, WRITE_SIZE(mtd));
yaffs_trace(YAFFS_TRACE_OS, " oobsize %d", mtd->oobsize);
yaffs_trace(YAFFS_TRACE_OS, " erasesize %d", mtd->erasesize);
@@ -2726,11 +2730,11 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
if (yaffs_version == 2) {
/* Check for version 2 style functions */
- if (!mtd->erase ||
- !mtd->block_isbad ||
- !mtd->block_markbad || !mtd->read || !mtd->write ||
+ if (!mtd->_erase ||
+ !mtd->_block_isbad ||
+ !mtd->_block_markbad || !mtd->_read || !mtd->_write ||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
- !mtd->read_oob || !mtd->write_oob) {
+ !mtd->_read_oob || !mtd->_write_oob) {
#else
!mtd->write_ecc ||
!mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
@@ -2751,9 +2755,9 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
}
} else {
/* Check for V1 style functions */
- if (!mtd->erase || !mtd->read || !mtd->write ||
+ if (!mtd->_erase || !mtd->_read || !mtd->_write ||
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
- !mtd->read_oob || !mtd->write_oob) {
+ !mtd->_read_oob || !mtd->_write_oob) {
#else
!mtd->write_ecc ||
!mtd->read_ecc || !mtd->read_oob || !mtd->write_oob) {
@@ -2943,7 +2947,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
yaffs_trace(YAFFS_TRACE_OS, "yaffs_read_super: got root inode");
- root = d_alloc_root(inode);
+ root = d_make_root(inode);
yaffs_trace(YAFFS_TRACE_OS, "yaffs_read_super: d_alloc_root done");
--
1.7.7