From: Henrik Nordstrom <hno@marasystems.com>
To: linux-mtd@lists.infradead.org
Subject: [patch] mkfs.jffs2
Date: Thu, 29 Aug 2002 21:14:16 +0200 [thread overview]
Message-ID: <200208292114.16531.hno@marasystems.com> (raw)
[-- 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);
reply other threads:[~2002-08-29 19:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200208292114.16531.hno@marasystems.com \
--to=hno@marasystems.com \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox