mtd/fs/jffs2 nodelist.h,1.116,1.117
David Woodhouse
dwmw2 at infradead.org
Wed May 5 07:58:25 EDT 2004
- Previous message: mtd/util compr_rtime.c,NONE,1.1 Makefile,1.35,1.36
doc_loadbios.c,1.7,1.8 einfo.c,1.4,1.5 erase.c,1.10,1.11
eraseall.c,1.12,1.13 fcp.c,1.2,1.3 ftl_check.c,1.2,1.3
ftl_format.c,1.6,1.7 jffs2dump.c,1.2,1.3 lock.c,1.2,1.3
mkfs.ffs2.c,1.3,1.4 mkfs.jffs2.c,1.40,1.41 mtd_debug.c,1.4,1.5
nanddump.c,1.12,1.13 nandwrite.c,1.8,1.9 nftl_format.c,1.19,1.20
nftldump.c,1.14,1.15 unlock.c,1.2,1.3
- Next message: mtd/fs/jffs2 fs.c,1.39,1.40 os-linux.h,1.41,1.42
super-v24.c,1.76,1.77 super.c,1.92,1.93
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv1889/fs/jffs2
Modified Files:
nodelist.h
Log Message:
Clean up includes of kernel headers -- pass 1
Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -r1.116 -r1.117
--- nodelist.h 8 Mar 2004 15:29:09 -0000 1.116
+++ nodelist.h 5 May 2004 11:57:52 -0000 1.117
@@ -44,6 +44,39 @@
#define D2(x)
#endif
+#define JFFS2_NATIVE_ENDIAN
+
+/* Note we handle mode bits conversion from JFFS2 (i.e. Linux) to/from
+ whatever OS we're actually running on here too. */
+
+#if defined(JFFS2_NATIVE_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){x})
+#define cpu_to_je32(x) ((jint32_t){x})
+#define cpu_to_jemode(x) ((jmode_t){os_to_jffs2_mode(x)})
+
+#define je16_to_cpu(x) ((x).v16)
+#define je32_to_cpu(x) ((x).v32)
+#define jemode_to_cpu(x) (jffs2_to_os_mode((x).m))
+#elif defined(JFFS2_BIG_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){cpu_to_be16(x)})
+#define cpu_to_je32(x) ((jint32_t){cpu_to_be32(x)})
+#define cpu_to_jemode(x) ((jmode_t){cpu_to_be32(os_to_jffs2_mode(x))})
+
+#define je16_to_cpu(x) (be16_to_cpu(x.v16))
+#define je32_to_cpu(x) (be32_to_cpu(x.v32))
+#define jemode_to_cpu(x) (be32_to_cpu(jffs2_to_os_mode((x).m)))
+#elif defined(JFFS2_LITTLE_ENDIAN)
+#define cpu_to_je16(x) ((jint16_t){cpu_to_le16(x)})
+#define cpu_to_je32(x) ((jint32_t){cpu_to_le32(x)})
+#define cpu_to_jemode(x) ((jmode_t){cpu_to_le32(os_to_jffs2_mode(x))})
+
+#define je16_to_cpu(x) (le16_to_cpu(x.v16))
+#define je32_to_cpu(x) (le32_to_cpu(x.v32))
+#define jemode_to_cpu(x) (le32_to_cpu(jffs2_to_os_mode((x).m)))
+#else
+#error wibble
+#endif
+
/*
This is all we need to keep in-core for each raw node during normal
operation. As and when we do read_inode on a particular inode, we can
- Previous message: mtd/util compr_rtime.c,NONE,1.1 Makefile,1.35,1.36
doc_loadbios.c,1.7,1.8 einfo.c,1.4,1.5 erase.c,1.10,1.11
eraseall.c,1.12,1.13 fcp.c,1.2,1.3 ftl_check.c,1.2,1.3
ftl_format.c,1.6,1.7 jffs2dump.c,1.2,1.3 lock.c,1.2,1.3
mkfs.ffs2.c,1.3,1.4 mkfs.jffs2.c,1.40,1.41 mtd_debug.c,1.4,1.5
nanddump.c,1.12,1.13 nandwrite.c,1.8,1.9 nftl_format.c,1.19,1.20
nftldump.c,1.14,1.15 unlock.c,1.2,1.3
- Next message: mtd/fs/jffs2 fs.c,1.39,1.40 os-linux.h,1.41,1.42
super-v24.c,1.76,1.77 super.c,1.92,1.93
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list