changeset 219:472c51d85ef1

Fix compilation on Linux 2.6.26, fix compilation warnings
author charles
date Wed, 23 Jul 2008 04:35:12 +0100
parents a3531aef506e
children b1f3b3c7e308
files yaffs_fs.c yaffs_mtdif1.c yaffs_mtdif1.h yaffs_mtdif2.c yaffs_mtdif2.h
diffstat 5 files changed, 21 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/yaffs_fs.c
+++ b/yaffs_fs.c
@@ -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_blo
 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_sup
 #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(struc
 
 }
 
+
+#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
 	   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;
 
--- a/yaffs_mtdif1.c
+++ b/yaffs_mtdif1.c
@@ -323,7 +323,7 @@ static int nandmtd1_TestPrerequists(stru
  * 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;
--- a/yaffs_mtdif1.h
+++ b/yaffs_mtdif1.h
@@ -23,6 +23,6 @@ int nandmtd1_ReadChunkWithTagsFromNAND(y
 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
--- a/yaffs_mtdif2.c
+++ b/yaffs_mtdif2.c
@@ -204,7 +204,7 @@ int nandmtd2_MarkNANDBlockBad(struct yaf
 }
 
 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;
--- a/yaffs_mtdif2.h
+++ b/yaffs_mtdif2.h
@@ -24,6 +24,6 @@ int nandmtd2_ReadChunkWithTagsFromNAND(y
 				       __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