lkml.org 
[lkml]   [1999]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: le32_to_cpu() help...
On Wed, Nov 03, 1999 at 02:47:08AM +0800, dony wrote:
> I know this. I just don't know what data is in little endian and what data is
> in big endian. say the following code ....
>
> struct ext2_super_block * es;
> struct super_block * sb;
> ..............................
> es->smtime=cpu_to_le32(CURRENT_TIME); //why here use cpu_to_le32?
> sb->u.ext2_sb.s_mount_state=le32_to_cpu(es->state); //why use le32_to_cpu here?

ext2's data structures are defined to be kept in little endian form.
It enables the exchange of filesystems between machines with differing
endianness.

--
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.035 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site