On Wed, 5 December 2007 14:21:02 -0800, Linus Torvalds wrote:
> 
> No, no, what I meant about not having any #ifdef __LITTLE_ENDIAN was to do 
> the code do the same thing *regardless* of endianness. In other words, a 
> simple:
> 
>       struct cramfs_inode {
>               __le32 mode_uid;        /* CRAMFS_MODE_WIDTH:CRAMFS_UID_WIDTH */
>               __le32 size_gid;        /* CRAMFS_SIZE_WIDTH:CRAMFS_GID_WIDTH */
>               __le32 namelen_offset;  /* 
> CRAMFS_NAMELEN_WIDTH:CRAMFS_OFFSET_WIDTH */
>       };

Mode and uid are both 16bit.  So maybe we can change the structure:

        struct cramfs_inode {
                __le16 uid;
                __le16 mode;
                __le32 size_gid;        /* CRAMFS_SIZE_WIDTH:CRAMFS_GID_WIDTH */
                __le32 namelen_offset;  /* 
CRAMFS_NAMELEN_WIDTH:CRAMFS_OFFSET_WIDTH */
        };

That way masks and shifts are only needed for the remaining two shared
variables.

> (No, the above is not tested in any way, shape, or form, and no, I didn't 
> double-check that I actually extracted the right bits, but you get the 
> idea).

Same warning applies to my code as well.

Jörn

-- 
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
-- M.A. Jackson
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to