X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_vfs_multi.c;h=b8e51243051a27fc7a17c3b79dbbfd72555699b1;hp=966df484835990673eb43167ea4b4338113512ad;hb=a7b5dcf904ba6f7890e4b77ce1f56388b855d0f6;hpb=ffb9a41a909210075adf0c529becca54109b2d80 diff --git a/yaffs_vfs_multi.c b/yaffs_vfs_multi.c index 966df48..b8e5124 100644 --- a/yaffs_vfs_multi.c +++ b/yaffs_vfs_multi.c @@ -72,7 +72,9 @@ #include #include #include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39)) #include +#endif #include #include #include @@ -237,7 +239,9 @@ static int yaffs_file_flush(struct file *file, fl_owner_t id); static int yaffs_file_flush(struct file *file); #endif -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) +static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync); +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)) static int yaffs_sync_object(struct file *file, int datasync); #else static int yaffs_sync_object(struct file *file, struct dentry *dentry, @@ -1826,7 +1830,9 @@ static int yaffs_symlink(struct inode *dir, struct dentry *dentry, return -ENOMEM; } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) +static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync) +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)) static int yaffs_sync_object(struct file *file, int datasync) #else static int yaffs_sync_object(struct file *file, struct dentry *dentry, @@ -2973,7 +2979,13 @@ static int yaffs_internal_read_super_mtd(struct super_block *sb, void *data, return yaffs_internal_read_super(1, sb, data, silent) ? 0 : -EINVAL; } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) +static struct dentry *yaffs_mount(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) +{ + return mount_bdev(fs_type, flags, dev_name, data, yaffs_internal_read_super_mtd); +} +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) static int yaffs_read_super(struct file_system_type *fs, int flags, const char *dev_name, void *data, struct vfsmount *mnt) @@ -2996,8 +3008,12 @@ static struct super_block *yaffs_read_super(struct file_system_type *fs, static struct file_system_type yaffs_fs_type = { .owner = THIS_MODULE, .name = "yaffs", - .get_sb = yaffs_read_super, - .kill_sb = kill_block_super, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) + .mount = yaffs_mount, +#else + .get_sb = yaffs_read_super, +#endif + .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV, }; #else @@ -3019,7 +3035,13 @@ static int yaffs2_internal_read_super_mtd(struct super_block *sb, void *data, return yaffs_internal_read_super(2, sb, data, silent) ? 0 : -EINVAL; } -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) +static struct dentry *yaffs2_mount(struct file_system_type *fs_type, int flags, + const char *dev_name, void *data) +{ + return mount_bdev(fs_type, flags, dev_name, data, yaffs2_internal_read_super_mtd); +} +#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) static int yaffs2_read_super(struct file_system_type *fs, int flags, const char *dev_name, void *data, struct vfsmount *mnt) @@ -3041,8 +3063,12 @@ static struct super_block *yaffs2_read_super(struct file_system_type *fs, static struct file_system_type yaffs2_fs_type = { .owner = THIS_MODULE, .name = "yaffs2", - .get_sb = yaffs2_read_super, - .kill_sb = kill_block_super, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) + .mount = yaffs2_mount, +#else + .get_sb = yaffs2_read_super, +#endif + .kill_sb = kill_block_super, .fs_flags = FS_REQUIRES_DEV, }; #else @@ -3112,8 +3138,8 @@ static char *yaffs_dump_dev_part1(char *buf, struct yaffs_dev *dev) dev->oldest_dirty_gc_count); buf += sprintf(buf, "n_gc_blocks.......... %u\n", dev->n_gc_blocks); buf += sprintf(buf, "bg_gcs............... %u\n", dev->bg_gcs); - buf += sprintf(buf, "n_retired_writes..... %u\n", - dev->n_retired_writes); + buf += sprintf(buf, "n_retried_writes..... %u\n", + dev->n_retried_writes); buf += sprintf(buf, "n_retired_blocks..... %u\n", dev->n_retired_blocks); buf += sprintf(buf, "n_ecc_fixed.......... %u\n", dev->n_ecc_fixed);