Skip to contentSkip to conversation

U64 Ordering in File System Code of Btrfs

DISCUSSION nick 2 participants 3 messages Aug 28, 2014

lore
Share & tools
lore

nick

author
#0 lore raw

Hey Guys,
Thanks for the help so far. I am wondering after reading the btrfs code for certain functions there seem to be a lot of u64 variable and function returns of this type. Is this common in file system due to the disk being in a certain format and depending on the CPU being big or small endian that this needed to not reorder the disk parts that are being read into main memory and preserve the data's ordering? Cheers Nick

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Thu, 28 Aug 2014 00:54:47 -0400]: "nick" (nick):

,----[ nick ]

| Hey Guys,
| Thanks for the help so far. I am wondering after reading the btrfs
| code for certain functions there seem to
| be a lot of u64 variable and function returns of this type. Is this
| common in file system due to the disk
| being in a certain format and depending on the CPU being big or small
| endian that this needed to not reorder
| the disk parts that are being read into main memory and preserve the data's ordering?
| Cheers Nick 

`----
on disk format is little-endian.

have a look at https://btrfs.wiki.kernel.org/index.php/Main_Page for more information.

kind regards
anupam

author
#2 lore raw
Quoted 11 lines · anupam kapoor
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Thu, 28 Aug 2014 00:54:47 -0400]: "nick" (nick):

,----[ nick ]

| Hey Guys,
| Thanks for the help so far. I am wondering after reading the btrfs
| code for certain functions there seem to
| be a lot of u64 variable and function returns of this type. Is this
| common in file system due to the disk
| being in a certain format and depending on the CPU being big or small
| endian that this needed to not reorder
| the disk parts that are being read into main memory and preserve the data's ordering?
| Cheers Nick 
Quoted 9 lines

`----
on disk format is little-endian.

have a look at https://btrfs.wiki.kernel.org/index.php/Main_Page for more information.

kind regards
anupam

Forget to check the wiki and found what I was looking for. In addition, the code docs for the kernel are some of the best I am ever seen, the only three that even compare are the Yocto Project, Arch Wiki and Red Hat docs. Now I understand why you guys state to read the docs first :). Cheers Nick