dect
/
linux-2.6
Archived
13
0
Fork 0

[JFFS2] Remove compatibilty cruft for ancient kernels

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
David Woodhouse 2005-07-06 13:13:13 +01:00 committed by Thomas Gleixner
parent 9dee7503ce
commit 265489f01d
4 changed files with 8 additions and 60 deletions

View File

@ -7,7 +7,7 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: dir.c,v 1.85 2005/03/01 10:34:03 dedekind Exp $ * $Id: dir.c,v 1.86 2005/07/06 12:13:09 dwmw2 Exp $
* *
*/ */
@ -22,16 +22,6 @@
#include <linux/time.h> #include <linux/time.h>
#include "nodelist.h" #include "nodelist.h"
/* Urgh. Please tell me there's a nicer way of doing these. */
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)
typedef int mknod_arg_t;
#define NAMEI_COMPAT(x) ((void *)x)
#else
typedef dev_t mknod_arg_t;
#define NAMEI_COMPAT(x) (x)
#endif
static int jffs2_readdir (struct file *, void *, filldir_t); static int jffs2_readdir (struct file *, void *, filldir_t);
static int jffs2_create (struct inode *,struct dentry *,int, static int jffs2_create (struct inode *,struct dentry *,int,
@ -43,7 +33,7 @@ static int jffs2_unlink (struct inode *,struct dentry *);
static int jffs2_symlink (struct inode *,struct dentry *,const char *); static int jffs2_symlink (struct inode *,struct dentry *,const char *);
static int jffs2_mkdir (struct inode *,struct dentry *,int); static int jffs2_mkdir (struct inode *,struct dentry *,int);
static int jffs2_rmdir (struct inode *,struct dentry *); static int jffs2_rmdir (struct inode *,struct dentry *);
static int jffs2_mknod (struct inode *,struct dentry *,int,mknod_arg_t); static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t);
static int jffs2_rename (struct inode *, struct dentry *, static int jffs2_rename (struct inode *, struct dentry *,
struct inode *, struct dentry *); struct inode *, struct dentry *);
@ -58,8 +48,8 @@ struct file_operations jffs2_dir_operations =
struct inode_operations jffs2_dir_inode_operations = struct inode_operations jffs2_dir_inode_operations =
{ {
.create = NAMEI_COMPAT(jffs2_create), .create = jffs2_create,
.lookup = NAMEI_COMPAT(jffs2_lookup), .lookup = jffs2_lookup,
.link = jffs2_link, .link = jffs2_link,
.unlink = jffs2_unlink, .unlink = jffs2_unlink,
.symlink = jffs2_symlink, .symlink = jffs2_symlink,
@ -578,7 +568,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
return ret; return ret;
} }
static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, mknod_arg_t rdev) static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, dev_t rdev)
{ {
struct jffs2_inode_info *f, *dir_f; struct jffs2_inode_info *f, *dir_f;
struct jffs2_sb_info *c; struct jffs2_sb_info *c;

View File

@ -7,11 +7,10 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: file.c,v 1.99 2004/11/16 20:36:11 dwmw2 Exp $ * $Id: file.c,v 1.102 2005/07/06 12:13:09 dwmw2 Exp $
* *
*/ */
#include <linux/version.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/fs.h> #include <linux/fs.h>
@ -51,9 +50,7 @@ struct file_operations jffs2_file_operations =
.ioctl = jffs2_ioctl, .ioctl = jffs2_ioctl,
.mmap = generic_file_readonly_mmap, .mmap = generic_file_readonly_mmap,
.fsync = jffs2_fsync, .fsync = jffs2_fsync,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,29)
.sendfile = generic_file_sendfile .sendfile = generic_file_sendfile
#endif
}; };
/* jffs2_file_inode_operations */ /* jffs2_file_inode_operations */

View File

@ -7,11 +7,10 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: fs.c,v 1.53 2005/02/09 09:23:53 pavlov Exp $ * $Id: fs.c,v 1.56 2005/07/06 12:13:09 dwmw2 Exp $
* *
*/ */
#include <linux/version.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
@ -526,9 +525,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
if (!sb->s_root) if (!sb->s_root)
goto out_root_i; goto out_root_i;
#if LINUX_VERSION_CODE >= 0x20403
sb->s_maxbytes = 0xFFFFFFFF; sb->s_maxbytes = 0xFFFFFFFF;
#endif
sb->s_blocksize = PAGE_CACHE_SIZE; sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT; sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
sb->s_magic = JFFS2_SUPER_MAGIC; sb->s_magic = JFFS2_SUPER_MAGIC;

View File

@ -7,41 +7,24 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: os-linux.h,v 1.56 2005/05/03 15:19:00 dedekind Exp $ * $Id: os-linux.h,v 1.57 2005/07/06 12:13:09 dwmw2 Exp $
* *
*/ */
#ifndef __JFFS2_OS_LINUX_H__ #ifndef __JFFS2_OS_LINUX_H__
#define __JFFS2_OS_LINUX_H__ #define __JFFS2_OS_LINUX_H__
#include <linux/version.h>
/* JFFS2 uses Linux mode bits natively -- no need for conversion */ /* JFFS2 uses Linux mode bits natively -- no need for conversion */
#define os_to_jffs2_mode(x) (x) #define os_to_jffs2_mode(x) (x)
#define jffs2_to_os_mode(x) (x) #define jffs2_to_os_mode(x) (x)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,73)
#define kstatfs statfs
#endif
struct kstatfs; struct kstatfs;
struct kvec; struct kvec;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
#define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode)) #define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode))
#define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode) #define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode)
#define JFFS2_SB_INFO(sb) (sb->s_fs_info) #define JFFS2_SB_INFO(sb) (sb->s_fs_info)
#define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv) #define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv)
#elif defined(JFFS2_OUT_OF_KERNEL)
#define JFFS2_INODE_INFO(i) ((struct jffs2_inode_info *) &(i)->u)
#define OFNI_EDONI_2SFFJ(f) ((struct inode *) ( ((char *)f) - ((char *)(&((struct inode *)NULL)->u)) ) )
#define JFFS2_SB_INFO(sb) ((struct jffs2_sb_info *) &(sb)->u)
#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->u)) ) )
#else
#define JFFS2_INODE_INFO(i) (&i->u.jffs2_i)
#define OFNI_EDONI_2SFFJ(f) ((struct inode *) ( ((char *)f) - ((char *)(&((struct inode *)NULL)->u)) ) )
#define JFFS2_SB_INFO(sb) (&sb->u.jffs2_sb)
#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->u)) ) )
#endif
#define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size) #define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size)
@ -49,28 +32,14 @@ struct kvec;
#define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid) #define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid)
#define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid) #define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,1)
#define JFFS2_F_I_RDEV_MIN(f) (iminor(OFNI_EDONI_2SFFJ(f))) #define JFFS2_F_I_RDEV_MIN(f) (iminor(OFNI_EDONI_2SFFJ(f)))
#define JFFS2_F_I_RDEV_MAJ(f) (imajor(OFNI_EDONI_2SFFJ(f))) #define JFFS2_F_I_RDEV_MAJ(f) (imajor(OFNI_EDONI_2SFFJ(f)))
#else
#define JFFS2_F_I_RDEV_MIN(f) (MINOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
#define JFFS2_F_I_RDEV_MAJ(f) (MAJOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
#endif
/* Urgh. The things we do to keep the 2.4 build working */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)
#define ITIME(sec) ((struct timespec){sec, 0}) #define ITIME(sec) ((struct timespec){sec, 0})
#define I_SEC(tv) ((tv).tv_sec) #define I_SEC(tv) ((tv).tv_sec)
#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec) #define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec)
#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec) #define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec)
#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime.tv_sec) #define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime.tv_sec)
#else
#define ITIME(x) (x)
#define I_SEC(x) (x)
#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime)
#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime)
#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime)
#endif
#define sleep_on_spinunlock(wq, s) \ #define sleep_on_spinunlock(wq, s) \
do { \ do { \
@ -84,17 +53,12 @@ struct kvec;
static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
{ {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
f->highest_version = 0; f->highest_version = 0;
f->fragtree = RB_ROOT; f->fragtree = RB_ROOT;
f->metadata = NULL; f->metadata = NULL;
f->dents = NULL; f->dents = NULL;
f->flags = 0; f->flags = 0;
f->usercompr = 0; f->usercompr = 0;
#else
memset(f, 0, sizeof(*f));
init_MUTEX_LOCKED(&f->sem);
#endif
} }