Fix compilation on Linux 2.6.26, fix compilation warnings
authorcharles <charles>
Wed, 23 Jul 2008 03:35:12 +0000 (03:35 +0000)
committercharles <charles>
Wed, 23 Jul 2008 03:35:12 +0000 (03:35 +0000)
yaffs_fs.c
yaffs_mtdif1.c
yaffs_mtdif1.h
yaffs_mtdif2.c
yaffs_mtdif2.h

index b8f2575e7e52a77e702969b986626e58d144ab4f..2d0f8a068ef0755038db472a9068e4aee4944f9a 100644 (file)
@@ -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 <linux/version.h>
@@ -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;
 
index 2b33c2cfea6f19cb441a9d1ee3687231ef6e90e1..2aad44ef1541f35c6defcbf7f4050c54efcfaa9d 100644 (file)
@@ -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;
index c4f6197d68ab7c9af90c202afd6790bbfae936d6..5fa056c449b25d7e6f0d726092651031924752c5 100644 (file)
@@ -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
index 3768b9b079652a979841cecd31c85a87e2e5faa3..0b3c921ada0ae99ca9a56883dea4b5d3897a1f0f 100644 (file)
@@ -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;
index b67ba52aa42771448a3b3120dc7d947e034338be..19f63b3368049b7de50792870733af9bfd72522e 100644 (file)
@@ -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