public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch] mkfs.jffs2
@ 2002-08-29 19:14 Henrik Nordstrom
  0 siblings, 0 replies; only message in thread
From: Henrik Nordstrom @ 2002-08-29 19:14 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]

Noticed mkfs.jffs2 does not build in CVS due to the change in jffs2 byte 
orderered types.

Attached is a patch to allow mkfs.jffs2 to build again. It is merely an 
search-replace of the existing code to match the new types. Have not tried if 
it does what it should as I do not (yet) have a system where I can use JFFS2.

Regards
Henrik

[-- Attachment #2: mkfs.jffs2.patch --]
[-- Type: text/x-diff, Size: 2807 bytes --]

Index: util/mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.26
diff -u -r1.26 mkfs.jffs2.c
--- util/mkfs.jffs2.c	3 Jul 2002 22:20:13 -0000	1.26
+++ util/mkfs.jffs2.c	29 Aug 2002 18:54:50 -0000
@@ -142,9 +142,9 @@
 		(((uint32_t)(x) & (uint32_t)0xff000000UL) >> 24) ))
 
 #define cpu_to_target16(x) \
-	((host_endian==target_endian)?(x):(swab16(x)))
+	((jint16_t){(host_endian==target_endian)?(x):(swab16(x))})
 #define cpu_to_target32(x) \
-	((host_endian==target_endian)?(x):(swab32(x)))
+	((jint32_t){(host_endian==target_endian)?(x):(swab32(x))})
 
 
 
@@ -568,8 +568,8 @@
 
 	ri.ino = cpu_to_target32(ino);
 	ri.mode = cpu_to_target32(statbuf->st_mode);
-	ri.uid = cpu_to_target32(statbuf->st_uid);
-	ri.gid = cpu_to_target32(statbuf->st_gid);
+	ri.uid = cpu_to_target16(statbuf->st_uid);
+	ri.gid = cpu_to_target16(statbuf->st_gid);
 	ri.atime = cpu_to_target32(statbuf->st_atime);
 	ri.ctime = cpu_to_target32(statbuf->st_ctime);
 	ri.mtime = cpu_to_target32(statbuf->st_mtime);
@@ -621,7 +621,7 @@
 			offset += dsize;
 		}
 	}
-	if (!ri.version) {
+	if (!je32_to_cpu(ri.version)) {
 		/* Was empty file */
 		version++;
 		ri.version = cpu_to_target32(version);
@@ -646,7 +646,7 @@
 
 	/* FIXME:  I am using illicit insider knowledge of kernel 
 	 * major/minor representation...  */
-	unsigned short kdev;
+	jint16_t kdev;
 
 	kdev = cpu_to_target16((major(statbuf->st_rdev) << 8) +
 		minor(statbuf->st_rdev));
@@ -661,8 +661,8 @@
 
 	ri.ino = cpu_to_target32(ino);
 	ri.mode = cpu_to_target32(statbuf->st_mode);
-	ri.uid = cpu_to_target32(statbuf->st_uid);
-	ri.gid = cpu_to_target32(statbuf->st_gid);
+	ri.uid = cpu_to_target16(statbuf->st_uid);
+	ri.gid = cpu_to_target16(statbuf->st_gid);
 	ri.atime = cpu_to_target32(statbuf->st_atime);
 	ri.ctime = cpu_to_target32(statbuf->st_ctime);
 	ri.mtime = cpu_to_target32(statbuf->st_mtime);
@@ -695,8 +695,8 @@
 
 	ri.ino = cpu_to_target32(ino);
 	ri.mode = cpu_to_target32(statbuf->st_mode);
-	ri.uid = cpu_to_target32(statbuf->st_uid);
-	ri.gid = cpu_to_target32(statbuf->st_gid);
+	ri.uid = cpu_to_target16(statbuf->st_uid);
+	ri.gid = cpu_to_target16(statbuf->st_gid);
 	ri.atime = cpu_to_target32(statbuf->st_atime);
 	ri.ctime = cpu_to_target32(statbuf->st_ctime);
 	ri.mtime = cpu_to_target32(statbuf->st_mtime);
@@ -729,8 +729,8 @@
 
 	ri.ino = cpu_to_target32(ino);
 	ri.mode = cpu_to_target32(statbuf->st_mode);
-	ri.uid = cpu_to_target32(statbuf->st_uid);
-	ri.gid = cpu_to_target32(statbuf->st_gid);
+	ri.uid = cpu_to_target16(statbuf->st_uid);
+	ri.gid = cpu_to_target16(statbuf->st_gid);
 	ri.atime = cpu_to_target32(statbuf->st_atime);
 	ri.ctime = cpu_to_target32(statbuf->st_ctime);
 	ri.mtime = cpu_to_target32(statbuf->st_mtime);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-29 19:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-29 19:14 [patch] mkfs.jffs2 Henrik Nordstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox