mtd/fs/jffs2/ecos/src jffs2port.h,1.11,1.12 os-ecos.h,1.14,1.15

David Woodhouse dwmw2 at infradead.org
Wed Nov 26 09:29:10 EST 2003


Update of /home/cvs/mtd/fs/jffs2/ecos/src
In directory phoenix.infradead.org:/tmp/cvs-serv6658

Modified Files:
	jffs2port.h os-ecos.h 
Log Message:
More header cleanup

Index: jffs2port.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/jffs2port.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- jffs2port.h	26 Nov 2003 13:28:10 -0000	1.11
+++ jffs2port.h	26 Nov 2003 14:29:07 -0000	1.12
@@ -37,79 +37,23 @@
 
 // Structures used by VFS
 
-typedef unsigned short kdev_t;
-
 struct qstr {
 	const unsigned char * name;
 	unsigned int len;
 	unsigned int hash;
 };
 
-#define DNAME_INLINE_LEN 16
-
 struct _inode;
 struct super_block;
-struct ffile;
-
-struct ddfile {
-	struct dentry		*f_dentry;
-	unsigned int 		f_flags;
-	mode_t			    f_mode;
-	loff_t			    f_pos;
-	unsigned long 		f_reada, f_ramax, f_raend, f_ralen, f_rawin;
-};
-
-#define ATTR_MODE	1
-#define ATTR_UID	2
-#define ATTR_GID	4
-#define ATTR_SIZE	8
-#define ATTR_ATIME	16
-#define ATTR_MTIME	32
-#define ATTR_CTIME	64
-#define ATTR_ATIME_SET	128
-#define ATTR_MTIME_SET	256
-#define ATTR_FORCE	512	/* Not a change, but a change it */
-#define ATTR_ATTR_FLAG	1024
-
-typedef unsigned short umode_t;
 
+//struct jffs2_sb_info;
+//struct jffs2_eraseblock;
 
 struct iovec {
         void *iov_base;
         ssize_t iov_len; 
 };
 
-
-// called by JFFS2
-
-#define to_kdev_t(rdev) (rdev)
-#define MAJOR(rdev) (rdev)>>8
-#define MINOR(rdev) (rdev)
-
-struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino);
-void jffs2_iput(struct _inode * i);
-
-struct jffs2_sb_info;
-struct jffs2_eraseblock;
-
-cyg_bool jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset, const size_t size, size_t * return_size, char * write_buffer);
-cyg_bool jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset, const size_t size, size_t * return_size, char * read_buffer);
-int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs, unsigned long count, loff_t to, size_t *retlen);
-cyg_bool jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
-
-
-// calls to JFFS2
-
-// dir-ecos.c
-struct _inode *jffs2_lookup(struct _inode *dir_i, struct qstr *name);
-int jffs2_readdir (struct _inode *d_inode, unsigned long f_pos, char *nbuf, int nlen);
-int jffs2_create(struct _inode *dir_i, struct qstr *d_name, int mode, struct _inode **new_i);
-int jffs2_mkdir (struct _inode *dir_i, struct qstr *d_name, int mode);
-int jffs2_link (struct _inode *old_d_inode, struct _inode *dir_i, struct qstr *d_name);
-int jffs2_unlink(struct _inode *dir_i, struct _inode *d_inode, struct qstr *d_name);
-int jffs2_rmdir (struct _inode *dir_i, struct _inode *d_inode, struct qstr *d_name);
-int jffs2_rename (struct _inode *old_dir_i, struct _inode *d_inode, struct qstr *old_d_name,
-                        struct _inode *new_dir_i, struct qstr *new_d_name);
 
 #define init_name_hash()		0
 static inline unsigned long partial_name_hash(unsigned long c, unsigned long prevhash)

Index: os-ecos.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/os-ecos.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- os-ecos.h	26 Nov 2003 13:23:30 -0000	1.14
+++ os-ecos.h	26 Nov 2003 14:29:07 -0000	1.15
@@ -22,10 +22,6 @@
 #include <linux/compiler.h>
 #include "jffs2port.h"
 
-/* erase.c */
-static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)
-{
-}
 
 #ifndef CONFIG_JFFS2_FS_DEBUG
 # define CONFIG_JFFS2_FS_DEBUG 0
@@ -131,8 +127,8 @@
 #define JFFS2_F_I_ATIME(f) (OFNI_EDONI_2SFFJ(f)->i_atime)
 
 /* FIXME: eCos doesn't hav a concept of device major/minor numbers */
-#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)))
+#define JFFS2_F_I_RDEV_MIN(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)&0xff)
+#define JFFS2_F_I_RDEV_MAJ(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)>>8)
 
 #define get_seconds cyg_timestamp
 
@@ -147,11 +143,11 @@
 	time_t			i_atime;
 	time_t			i_mtime;
 	time_t			i_ctime;
-	// union {
-	kdev_t			i_rdev; // For devices only
-        struct _inode *		i_parent; // For directories only
-	off_t			i_size; // For files only
-	// };
+//	union {
+		unsigned short	i_rdev; // For devices only
+		struct _inode *	i_parent; // For directories only
+		off_t		i_size; // For files only
+//	};
 	struct super_block *	i_sb;
 
 	struct jffs2_inode_info	jffs2_i;
@@ -164,10 +160,10 @@
 #define OFNI_BS_2SFFJ(c)  ((struct super_block *) ( ((char *)c) - ((char *)(&((struct super_block *)NULL)->jffs2_sb)) ) )
 
 struct super_block {
-	struct jffs2_sb_info jffs2_sb;
-	struct _inode *s_root;
-        unsigned long s_mount_count;
-	cyg_io_handle_t s_dev;
+	struct jffs2_sb_info	jffs2_sb;
+	struct _inode *		s_root;
+        unsigned long		s_mount_count;
+	cyg_io_handle_t		s_dev;
 };
 
 #define sleep_on_spinunlock(wq, sl) do { ; } while(0)
@@ -179,20 +175,39 @@
 	/* We don't have a GC thread in eCos (yet) */
 }
 
-/* fs.c */
-void jffs2_gc_release_inode(struct jffs2_sb_info *c,
-			    struct jffs2_inode_info *f);
-struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c,
-					      int inum, int nlink);
-
-unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, 
-				   struct jffs2_inode_info *f, 
-				   unsigned long offset,
-				   unsigned long *priv);
-void jffs2_gc_release_page(struct jffs2_sb_info *c,
-			   unsigned char *pg,
-			   unsigned long *priv);
-     
+/* fs-ecos.c */
+struct _inode *jffs2_new_inode (struct _inode *dir_i, int mode, struct jffs2_raw_inode *ri);
+struct _inode *jffs2_iget(struct super_block *sb, cyg_uint32 ino);
+void jffs2_iput(struct _inode * i);
+void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f);
+struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, int inum, int nlink);
+unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, 
+				   unsigned long offset, unsigned long *priv);
+void jffs2_gc_release_page(struct jffs2_sb_info *c, unsigned char *pg, unsigned long *priv);
+
+
+/* flashio.c */
+cyg_bool jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset,
+			  const size_t size, size_t * return_size, char * write_buffer);
+cyg_bool jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset,
+			   const size_t size, size_t * return_size, char * read_buffer);
+int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs,
+			      unsigned long count, loff_t to, size_t *retlen);
+cyg_bool jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
+
+// dir-ecos.c
+struct _inode *jffs2_lookup(struct _inode *dir_i, struct qstr *name);
+int jffs2_create(struct _inode *dir_i, struct qstr *d_name, int mode, struct _inode **new_i);
+int jffs2_mkdir (struct _inode *dir_i, struct qstr *d_name, int mode);
+int jffs2_link (struct _inode *old_d_inode, struct _inode *dir_i, struct qstr *d_name);
+int jffs2_unlink(struct _inode *dir_i, struct _inode *d_inode, struct qstr *d_name);
+int jffs2_rmdir (struct _inode *dir_i, struct _inode *d_inode, struct qstr *d_name);
+int jffs2_rename (struct _inode *old_dir_i, struct _inode *d_inode, struct qstr *old_d_name,
+		  struct _inode *new_dir_i, struct qstr *new_d_name);
+
+/* erase.c */
+static inline void jffs2_erase_pending_trigger(struct jffs2_sb_info *c)
+{ }
 
 #ifndef CONFIG_JFFS2_FS_NAND
 #define jffs2_can_mark_obsolete(c) (1)
@@ -213,9 +228,8 @@
 #error no nand yet
 #endif
 
-
-struct _inode *jffs2_new_inode (struct _inode *dir_i, int mode, struct jffs2_raw_inode *ri);
-
+#ifndef BUG_ON
 #define BUG_ON(x) do { if (unlikely(x)) BUG(); } while(0)
+#endif
 
 #endif /* __JFFS2_OS_ECOS_H__ */




More information about the linux-mtd-cvs mailing list