From: Charles Manning Date: Tue, 21 Sep 2010 01:44:16 +0000 (+1200) Subject: yaffs Sort out some Linux multi-version compilation issues X-Git-Tag: pre-name-change~10 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=5d36331d84025fe263395a341cba3369b4ba5fed yaffs Sort out some Linux multi-version compilation issues Fix problems where some versions were not compiling. Signed-off-by: Charles Manning --- diff --git a/yaffs_fs.c b/yaffs_fs.c index ecf2bbe..dc00bd5 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -35,6 +35,9 @@ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10)) #define YAFFS_COMPILE_BACKGROUND +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6, 23)) +#define YAFFS_COMPILE_FREEZER +#endif #endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)) @@ -83,6 +86,8 @@ #ifdef YAFFS_COMPILE_BACKGROUND #include #include +#endif +#ifdef YAFFS_COMPILE_FREEZER #include #endif @@ -492,7 +497,8 @@ static int yaffs_vfs_setsize(struct inode *inode, loff_t newsize) truncate_setsize(inode,newsize); return 0; #else - return simple_setsize(inode, newsize); + truncate_inode_pages(&inode->i_data,newsize); + return 0; #endif } @@ -2319,8 +2325,9 @@ static int yaffs_BackgroundThread(void *data) (TSTR("yaffs_background starting for dev %p\n"), (void *)dev)); +#ifdef YAFFS_COMPILE_FREEZER set_freezable(); - +#endif while(context->bgRunning){ T(YAFFS_TRACE_BACKGROUND, (TSTR("yaffs_background\n"))); @@ -2328,9 +2335,10 @@ static int yaffs_BackgroundThread(void *data) if(kthread_should_stop()) break; +#ifdef YAFFS_COMPILE_FREEZER if(try_to_freeze()) continue; - +#endif yaffs_GrossLock(dev); now = jiffies;