diff --git a/src/add-ons/kernel/file_systems/ext2/Inode.cpp b/src/add-ons/kernel/file_systems/ext2/Inode.cpp index 71b9d3e6cc..7bc9a34ae4 100644 --- a/src/add-ons/kernel/file_systems/ext2/Inode.cpp +++ b/src/add-ons/kernel/file_systems/ext2/Inode.cpp @@ -101,12 +101,12 @@ Inode::FindBlock(off_t offset, uint32& block) if (index < EXT2_DIRECT_BLOCKS) { // direct blocks - block = B_LENDIAN_TO_HOST_INT32(Node().stream.direct[index]); + block = B_LENDIAN_TO_HOST_INT32(Node().u.stream.direct[index]); } else if ((index -= EXT2_DIRECT_BLOCKS) < perBlock) { // indirect blocks CachedBlock cached(fVolume); uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - Node().stream.indirect)); + Node().u.stream.indirect)); if (indirectBlocks == NULL) return B_IO_ERROR; @@ -115,7 +115,7 @@ Inode::FindBlock(off_t offset, uint32& block) // double indirect blocks CachedBlock cached(fVolume); uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - Node().stream.double_indirect)); + Node().u.stream.double_indirect)); if (indirectBlocks == NULL) return B_IO_ERROR; @@ -129,7 +129,7 @@ Inode::FindBlock(off_t offset, uint32& block) // triple indirect blocks CachedBlock cached(fVolume); uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32( - Node().stream.triple_indirect)); + Node().u.stream.triple_indirect)); if (indirectBlocks == NULL) return B_IO_ERROR; diff --git a/src/add-ons/kernel/file_systems/ext2/ext2.h b/src/add-ons/kernel/file_systems/ext2/ext2.h index fde4d3155a..a0f240c859 100644 --- a/src/add-ons/kernel/file_systems/ext2/ext2.h +++ b/src/add-ons/kernel/file_systems/ext2/ext2.h @@ -159,7 +159,7 @@ struct ext2_inode { uint32 triple_indirect; } stream; char symlink[EXT2_SHORT_SYMLINK_LENGTH]; - }; + } u; uint32 generation; uint32 file_access_control; union { diff --git a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp index d46b98b996..298dd2ff30 100644 --- a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include #include @@ -414,7 +414,7 @@ ext2_read_link(fs_volume *_volume, fs_vnode *_node, char *buffer, if (inode->Size() > EXT2_SHORT_SYMLINK_LENGTH) return inode->ReadAt(0, (uint8 *)buffer, _bufferSize); - memcpy(buffer, inode->Node().symlink, *_bufferSize); + memcpy(buffer, inode->Node().u.symlink, *_bufferSize); return B_OK; }