From: "H. Peter Anvin" <hpa@zytor.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Andi Drebes <lists-receive@programmierforen.de>,
Tomas M <tomas@slax.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: cramfs in big endian
Date: Fri, 09 Nov 2007 17:03:01 -0800 [thread overview]
Message-ID: <47350345.4010108@zytor.com> (raw)
In-Reply-To: <20071107224936.GA8517@infradead.org>
Christoph Hellwig wrote:
> On Wed, Nov 07, 2007 at 09:51:48PM +0100, Andi Drebes wrote:
>> Hi!
>>
>>> I would suggest you to use squashfs instead of cramfs.
>>> First, it's newer, it's better, it's actively developed, it doesn't have any
>>> limits like the bad cramfs.
>> I'm developing a new linux based firmware for my router which uses cramfs.
>> Switching to squashfs still needs some time. Meanwhile, I have to work with
>> cramfs. As the router uses the big endian format and as my machine works with
>> the little endian format, I'm unable to mount the router's filesystem images.
>
> Making cramfs endianess-independent shouldn't be much work. Take a look
> at the helpers in fs/ufs/swab.h and use them for every ondisk access in
> cramfs. Drop me a not if you need some help.
And it would suck. Hard.
Endian-independent code is slower than wrong-endian code, because of the
necessary conditionals. Thus, you DO NOT WANT this(*).
The only way to not make it totally suck is to compile the code twice
and do switching at a VERY high level -- in effect, creating two
separate filesystem drivers.
-hpa
(*) Readonly filesystems like iso9660 have attempted to be
*both*-endian, by having its datastructures in both forms at all times.
That is inefficient with space, but would be CPU-efficient in
theory. Unfortunately it causes output validation problems; apparently
many iso9660 mastering programs output invalid bigendian information as
it is never tested; consequently, many bigendian platforms read the
littleendian information anyway.
next prev parent reply other threads:[~2007-11-10 1:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-06 21:16 cramfs in big endian Andi Drebes
2007-11-07 13:52 ` Tomas M
2007-11-07 20:51 ` Andi Drebes
2007-11-07 22:49 ` Christoph Hellwig
2007-11-08 18:10 ` Andi Drebes
2007-11-10 1:03 ` H. Peter Anvin [this message]
2007-11-10 15:13 ` Christoph Hellwig
2007-11-10 20:19 ` H. Peter Anvin
2007-11-10 20:26 ` Andi Drebes
2007-11-10 20:30 ` H. Peter Anvin
2007-11-11 10:20 ` Andi Drebes
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=47350345.4010108@zytor.com \
--to=hpa@zytor.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=lists-receive@programmierforen.de \
--cc=tomas@slax.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.