From: Charles Manning Date: Mon, 6 Aug 2018 21:48:11 +0000 (+1200) Subject: Clean up some version dependencies X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=055b040da24e492d9987054c944f44fb3d15aefa;hp=c1422c27f5f17c68acf261209292c7489085df6b Clean up some version dependencies Signed-off-by: Charles Manning --- diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index acb0c4a..e2f002e 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -250,11 +250,10 @@ MODULE_PARM(yaffs_gc_control, "i"); #include #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) #define PAGE_CACHE_SIZE PAGE_SIZE #define PAGE_CACHE_SHIFT PAGE_SHIFT #define Y_GET_DENTRY(f) ((f)->f_path.dentry) -#define page_cache_release put_page #define YAFFS_NEW_XATTR 1 #define YAFFS_NEW_GET_LINK 1 #else @@ -263,6 +262,10 @@ MODULE_PARM(yaffs_gc_control, "i"); #define YAFFS_NEW_GET_LINK 0 #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)) +#define page_cache_release put_page +#endif + #define update_dir_time(dir) do {\ (dir)->i_ctime = (dir)->i_mtime = CURRENT_TIME; \ } while (0) @@ -801,7 +804,7 @@ static int yaffs_sync_object(struct file *file, struct dentry *dentry, #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22)) static const struct file_operations yaffs_file_operations = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) .read = new_sync_read, .write = new_sync_write, #endif @@ -974,7 +977,7 @@ static int yaffs_setxattr(struct dentry *dentry, const char *name, return error; } -#ifdef YAFFS_NEW_XATTR +#if (YAFFS_NEW_XATTR > 0) static ssize_t yaffs_getxattr(struct dentry * dentry, struct inode *inode, const char *name, void *buff, size_t size) {