aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jffs2/dir.c20
-rw-r--r--fs/jffs2/file.c5
-rw-r--r--fs/jffs2/fs.c5
-rw-r--r--fs/jffs2/os-linux.h38
4 files changed, 8 insertions, 60 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c
index 6421be874ce3..3ca0d25eef1d 100644
--- a/fs/jffs2/dir.c
+++ b/fs/jffs2/dir.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: dir.c,v 1.85 2005/03/01 10:34:03 dedekind Exp $ 10 * $Id: dir.c,v 1.86 2005/07/06 12:13:09 dwmw2 Exp $
11 * 11 *
12 */ 12 */
13 13
@@ -22,16 +22,6 @@
22#include <linux/time.h> 22#include <linux/time.h>
23#include "nodelist.h" 23#include "nodelist.h"
24 24
25/* Urgh. Please tell me there's a nicer way of doing these. */
26#include <linux/version.h>
27#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)
28typedef int mknod_arg_t;
29#define NAMEI_COMPAT(x) ((void *)x)
30#else
31typedef dev_t mknod_arg_t;
32#define NAMEI_COMPAT(x) (x)
33#endif
34
35static int jffs2_readdir (struct file *, void *, filldir_t); 25static int jffs2_readdir (struct file *, void *, filldir_t);
36 26
37static int jffs2_create (struct inode *,struct dentry *,int, 27static int jffs2_create (struct inode *,struct dentry *,int,
@@ -43,7 +33,7 @@ static int jffs2_unlink (struct inode *,struct dentry *);
43static int jffs2_symlink (struct inode *,struct dentry *,const char *); 33static int jffs2_symlink (struct inode *,struct dentry *,const char *);
44static int jffs2_mkdir (struct inode *,struct dentry *,int); 34static int jffs2_mkdir (struct inode *,struct dentry *,int);
45static int jffs2_rmdir (struct inode *,struct dentry *); 35static int jffs2_rmdir (struct inode *,struct dentry *);
46static int jffs2_mknod (struct inode *,struct dentry *,int,mknod_arg_t); 36static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t);
47static int jffs2_rename (struct inode *, struct dentry *, 37static int jffs2_rename (struct inode *, struct dentry *,
48 struct inode *, struct dentry *); 38 struct inode *, struct dentry *);
49 39
@@ -58,8 +48,8 @@ struct file_operations jffs2_dir_operations =
58 48
59struct inode_operations jffs2_dir_inode_operations = 49struct inode_operations jffs2_dir_inode_operations =
60{ 50{
61 .create = NAMEI_COMPAT(jffs2_create), 51 .create = jffs2_create,
62 .lookup = NAMEI_COMPAT(jffs2_lookup), 52 .lookup = jffs2_lookup,
63 .link = jffs2_link, 53 .link = jffs2_link,
64 .unlink = jffs2_unlink, 54 .unlink = jffs2_unlink,
65 .symlink = jffs2_symlink, 55 .symlink = jffs2_symlink,
@@ -578,7 +568,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry)
578 return ret; 568 return ret;
579} 569}
580 570
581static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, mknod_arg_t rdev) 571static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, dev_t rdev)
582{ 572{
583 struct jffs2_inode_info *f, *dir_f; 573 struct jffs2_inode_info *f, *dir_f;
584 struct jffs2_sb_info *c; 574 struct jffs2_sb_info *c;
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 771a554701d6..bd9ed9b0247b 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -7,11 +7,10 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: file.c,v 1.99 2004/11/16 20:36:11 dwmw2 Exp $ 10 * $Id: file.c,v 1.102 2005/07/06 12:13:09 dwmw2 Exp $
11 * 11 *
12 */ 12 */
13 13
14#include <linux/version.h>
15#include <linux/kernel.h> 14#include <linux/kernel.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
17#include <linux/fs.h> 16#include <linux/fs.h>
@@ -51,9 +50,7 @@ struct file_operations jffs2_file_operations =
51 .ioctl = jffs2_ioctl, 50 .ioctl = jffs2_ioctl,
52 .mmap = generic_file_readonly_mmap, 51 .mmap = generic_file_readonly_mmap,
53 .fsync = jffs2_fsync, 52 .fsync = jffs2_fsync,
54#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,29)
55 .sendfile = generic_file_sendfile 53 .sendfile = generic_file_sendfile
56#endif
57}; 54};
58 55
59/* jffs2_file_inode_operations */ 56/* jffs2_file_inode_operations */
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index c91c66e5e869..5687c3f42002 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -7,11 +7,10 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: fs.c,v 1.53 2005/02/09 09:23:53 pavlov Exp $ 10 * $Id: fs.c,v 1.56 2005/07/06 12:13:09 dwmw2 Exp $
11 * 11 *
12 */ 12 */
13 13
14#include <linux/version.h>
15#include <linux/config.h> 14#include <linux/config.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/sched.h> 16#include <linux/sched.h>
@@ -526,9 +525,7 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent)
526 if (!sb->s_root) 525 if (!sb->s_root)
527 goto out_root_i; 526 goto out_root_i;
528 527
529#if LINUX_VERSION_CODE >= 0x20403
530 sb->s_maxbytes = 0xFFFFFFFF; 528 sb->s_maxbytes = 0xFFFFFFFF;
531#endif
532 sb->s_blocksize = PAGE_CACHE_SIZE; 529 sb->s_blocksize = PAGE_CACHE_SIZE;
533 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 530 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
534 sb->s_magic = JFFS2_SUPER_MAGIC; 531 sb->s_magic = JFFS2_SUPER_MAGIC;
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 5a2d2ee4f641..7bf72e012c94 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -7,41 +7,24 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: os-linux.h,v 1.56 2005/05/03 15:19:00 dedekind Exp $ 10 * $Id: os-linux.h,v 1.57 2005/07/06 12:13:09 dwmw2 Exp $
11 * 11 *
12 */ 12 */
13 13
14#ifndef __JFFS2_OS_LINUX_H__ 14#ifndef __JFFS2_OS_LINUX_H__
15#define __JFFS2_OS_LINUX_H__ 15#define __JFFS2_OS_LINUX_H__
16#include <linux/version.h>
17 16
18/* JFFS2 uses Linux mode bits natively -- no need for conversion */ 17/* JFFS2 uses Linux mode bits natively -- no need for conversion */
19#define os_to_jffs2_mode(x) (x) 18#define os_to_jffs2_mode(x) (x)
20#define jffs2_to_os_mode(x) (x) 19#define jffs2_to_os_mode(x) (x)
21 20
22#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,73)
23#define kstatfs statfs
24#endif
25
26struct kstatfs; 21struct kstatfs;
27struct kvec; 22struct kvec;
28 23
29#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
30#define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode)) 24#define JFFS2_INODE_INFO(i) (list_entry(i, struct jffs2_inode_info, vfs_inode))
31#define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode) 25#define OFNI_EDONI_2SFFJ(f) (&(f)->vfs_inode)
32#define JFFS2_SB_INFO(sb) (sb->s_fs_info) 26#define JFFS2_SB_INFO(sb) (sb->s_fs_info)
33#define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv) 27#define OFNI_BS_2SFFJ(c) ((struct super_block *)c->os_priv)
34#elif defined(JFFS2_OUT_OF_KERNEL)
35#define JFFS2_INODE_INFO(i) ((struct jffs2_inode_info *) &(i)->u)
36#define OFNI_EDONI_2SFFJ(f) ((struct inode *) ( ((char *)f) - ((char *)(&((struct inode *)NULL)->u)) ) )
37#define JFFS2_SB_INFO(sb) ((struct jffs2_sb_info *) &(sb)->u)
38#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->u)) ) )
39#else
40#define JFFS2_INODE_INFO(i) (&i->u.jffs2_i)
41#define OFNI_EDONI_2SFFJ(f) ((struct inode *) ( ((char *)f) - ((char *)(&((struct inode *)NULL)->u)) ) )
42#define JFFS2_SB_INFO(sb) (&sb->u.jffs2_sb)
43#define OFNI_BS_2SFFJ(c) ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->u)) ) )
44#endif
45 28
46 29
47#define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size) 30#define JFFS2_F_I_SIZE(f) (OFNI_EDONI_2SFFJ(f)->i_size)
@@ -49,28 +32,14 @@ struct kvec;
49#define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid) 32#define JFFS2_F_I_UID(f) (OFNI_EDONI_2SFFJ(f)->i_uid)
50#define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid) 33#define JFFS2_F_I_GID(f) (OFNI_EDONI_2SFFJ(f)->i_gid)
51 34
52#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,1)
53#define JFFS2_F_I_RDEV_MIN(f) (iminor(OFNI_EDONI_2SFFJ(f))) 35#define JFFS2_F_I_RDEV_MIN(f) (iminor(OFNI_EDONI_2SFFJ(f)))
54#define JFFS2_F_I_RDEV_MAJ(f) (imajor(OFNI_EDONI_2SFFJ(f))) 36#define JFFS2_F_I_RDEV_MAJ(f) (imajor(OFNI_EDONI_2SFFJ(f)))
55#else
56#define JFFS2_F_I_RDEV_MIN(f) (MINOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
57#define JFFS2_F_I_RDEV_MAJ(f) (MAJOR(to_kdev_t(OFNI_EDONI_2SFFJ(f)->i_rdev)))
58#endif
59 37
60/* Urgh. The things we do to keep the 2.4 build working */
61#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,47)
62#define ITIME(sec) ((struct timespec){sec, 0}) 38#define ITIME(sec) ((struct timespec){sec, 0})
63#define I_SEC(tv) ((tv).tv_sec) 39#define I_SEC(tv) ((tv).tv_sec)
64#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec) 40#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec)
65#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec) 41#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec)
66#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime.tv_sec) 42#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime.tv_sec)
67#else
68#define ITIME(x) (x)
69#define I_SEC(x) (x)
70#define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime)
71#define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime)
72#define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime)
73#endif
74 43
75#define sleep_on_spinunlock(wq, s) \ 44#define sleep_on_spinunlock(wq, s) \
76 do { \ 45 do { \
@@ -84,17 +53,12 @@ struct kvec;
84 53
85static inline void jffs2_init_inode_info(struct jffs2_inode_info *f) 54static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
86{ 55{
87#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,2)
88 f->highest_version = 0; 56 f->highest_version = 0;
89 f->fragtree = RB_ROOT; 57 f->fragtree = RB_ROOT;
90 f->metadata = NULL; 58 f->metadata = NULL;
91 f->dents = NULL; 59 f->dents = NULL;
92 f->flags = 0; 60 f->flags = 0;
93 f->usercompr = 0; 61 f->usercompr = 0;
94#else
95 memset(f, 0, sizeof(*f));
96 init_MUTEX_LOCKED(&f->sem);
97#endif
98} 62}
99 63
100 64