From: charles Date: Wed, 23 Jul 2008 03:35:12 +0000 (+0000) Subject: Fix compilation on Linux 2.6.26, fix compilation warnings X-Git-Tag: pre-name-change~275 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=d8ff7698762028c417be5dbc102fe882be0f99c5;hp=94f402eb2a25625f34ff392efbcb8954478f5cfc Fix compilation on Linux 2.6.26, fix compilation warnings --- diff --git a/yaffs_fs.c b/yaffs_fs.c index b8f2575..2d0f8a0 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -32,7 +32,7 @@ */ const char *yaffs_fs_c_version = - "$Id: yaffs_fs.c,v 1.67 2008-07-03 20:06:05 charles Exp $"; + "$Id: yaffs_fs.c,v 1.68 2008-07-23 03:35:12 charles Exp $"; extern const char *yaffs_guts_c_version; #include @@ -77,6 +77,12 @@ extern const char *yaffs_guts_c_version; #endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)) +#define YPROC_ROOT &proc_root +#else +#define YPROC_ROOT NULL +#endif + #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,17)) #define WRITE_SIZE_STR "writesize" #define WRITE_SIZE(mtd) (mtd)->writesize @@ -196,7 +202,10 @@ static int yaffs_statfs(struct super_block *sb, struct kstatfs *buf); static int yaffs_statfs(struct super_block *sb, struct statfs *buf); #endif +#ifdef YAFFS_HAS_PUT_INODE static void yaffs_put_inode(struct inode *inode); +#endif + static void yaffs_delete_inode(struct inode *); static void yaffs_clear_inode(struct inode *); @@ -301,7 +310,9 @@ static struct super_operations yaffs_super_ops = { #ifndef YAFFS_USE_OWN_IGET .read_inode = yaffs_read_inode, #endif +#ifdef YAFFS_HAS_PUT_INODE .put_inode = yaffs_put_inode, +#endif .put_super = yaffs_put_super, .delete_inode = yaffs_delete_inode, .clear_inode = yaffs_clear_inode, @@ -445,6 +456,9 @@ static struct dentry *yaffs_lookup(struct inode *dir, struct dentry *dentry) } + +#ifdef YAFFS_HAS_PUT_INODE + /* For now put inode is just for debugging * Put inode is called when the inode **structure** is put. */ @@ -455,6 +469,7 @@ static void yaffs_put_inode(struct inode *inode) atomic_read(&inode->i_count))); } +#endif /* clear is called to tell the fs to release any per-inode data it holds */ static void yaffs_clear_inode(struct inode *inode) @@ -2304,7 +2319,7 @@ static int __init init_yaffs_fs(void) /* Install the proc_fs entry */ my_proc_entry = create_proc_entry("yaffs", S_IRUGO | S_IFREG, - &proc_root); + YPROC_ROOT); if (my_proc_entry) { my_proc_entry->write_proc = yaffs_proc_write; @@ -2350,7 +2365,7 @@ static void __exit exit_yaffs_fs(void) T(YAFFS_TRACE_ALWAYS, ("yaffs " __DATE__ " " __TIME__ " removing. \n")); - remove_proc_entry("yaffs", &proc_root); + remove_proc_entry("yaffs", YPROC_ROOT); fsinst = fs_to_install; diff --git a/yaffs_mtdif1.c b/yaffs_mtdif1.c index 2b33c2c..2aad44e 100644 --- a/yaffs_mtdif1.c +++ b/yaffs_mtdif1.c @@ -36,7 +36,7 @@ /* Don't compile this module if we don't have MTD's mtd_oob_ops interface */ #if (MTD_VERSION_CODE > MTD_VERSION(2,6,17)) -const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.7 2007-12-13 15:35:18 wookey Exp $"; +const char *yaffs_mtdif1_c_version = "$Id: yaffs_mtdif1.c,v 1.8 2008-07-23 03:35:12 charles Exp $"; #ifndef CONFIG_YAFFS_9BYTE_TAGS # define YTAG1_SIZE 8 @@ -323,7 +323,7 @@ static int nandmtd1_TestPrerequists(struct mtd_info * mtd) * Always returns YAFFS_OK. */ int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo, - yaffs_BlockState * pState, int *pSequenceNumber) + yaffs_BlockState * pState, __u32 *pSequenceNumber) { struct mtd_info * mtd = dev->genericDevice; int chunkNo = blockNo * dev->nChunksPerBlock; diff --git a/yaffs_mtdif1.h b/yaffs_mtdif1.h index c4f6197..5fa056c 100644 --- a/yaffs_mtdif1.h +++ b/yaffs_mtdif1.h @@ -23,6 +23,6 @@ int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device * dev, int chunkInNAND, int nandmtd1_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo); int nandmtd1_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo, - yaffs_BlockState * state, int *sequenceNumber); + yaffs_BlockState * state, __u32 *sequenceNumber); #endif diff --git a/yaffs_mtdif2.c b/yaffs_mtdif2.c index 3768b9b..0b3c921 100644 --- a/yaffs_mtdif2.c +++ b/yaffs_mtdif2.c @@ -14,7 +14,7 @@ /* mtd interface for YAFFS2 */ const char *yaffs_mtdif2_c_version = - "$Id: yaffs_mtdif2.c,v 1.20 2008-05-05 07:58:58 charles Exp $"; + "$Id: yaffs_mtdif2.c,v 1.21 2008-07-23 03:35:12 charles Exp $"; #include "yportenv.h" @@ -204,7 +204,7 @@ int nandmtd2_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo) } int nandmtd2_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo, - yaffs_BlockState * state, int *sequenceNumber) + yaffs_BlockState * state, __u32 *sequenceNumber) { struct mtd_info *mtd = (struct mtd_info *)(dev->genericDevice); int retval; diff --git a/yaffs_mtdif2.h b/yaffs_mtdif2.h index b67ba52..19f63b3 100644 --- a/yaffs_mtdif2.h +++ b/yaffs_mtdif2.h @@ -24,6 +24,6 @@ int nandmtd2_ReadChunkWithTagsFromNAND(yaffs_Device * dev, int chunkInNAND, __u8 * data, yaffs_ExtendedTags * tags); int nandmtd2_MarkNANDBlockBad(struct yaffs_DeviceStruct *dev, int blockNo); int nandmtd2_QueryNANDBlock(struct yaffs_DeviceStruct *dev, int blockNo, - yaffs_BlockState * state, int *sequenceNumber); + yaffs_BlockState * state, __u32 *sequenceNumber); #endif