* Fixed a pretty dumb copy&paste error that prevented (/double/triple) indirect
blocks from working. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26189 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -105,8 +105,9 @@ Inode::FindBlock(off_t offset, uint32& block)
|
|||||||
} else if ((index -= EXT2_DIRECT_BLOCKS) < perBlock) {
|
} else if ((index -= EXT2_DIRECT_BLOCKS) < perBlock) {
|
||||||
// indirect blocks
|
// indirect blocks
|
||||||
CachedBlock cached(fVolume);
|
CachedBlock cached(fVolume);
|
||||||
uint32* indirectBlocks = (uint32*)cached.SetTo(Node().stream.indirect);
|
uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
if (indirectBlocks != NULL)
|
Node().stream.indirect));
|
||||||
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index]);
|
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index]);
|
||||||
@@ -115,12 +116,12 @@ Inode::FindBlock(off_t offset, uint32& block)
|
|||||||
CachedBlock cached(fVolume);
|
CachedBlock cached(fVolume);
|
||||||
uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
Node().stream.double_indirect));
|
Node().stream.double_indirect));
|
||||||
if (indirectBlocks != NULL)
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
indirectBlocks[index / perBlock]));
|
indirectBlocks[index / perBlock]));
|
||||||
if (indirectBlocks != NULL)
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]);
|
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]);
|
||||||
@@ -129,17 +130,17 @@ Inode::FindBlock(off_t offset, uint32& block)
|
|||||||
CachedBlock cached(fVolume);
|
CachedBlock cached(fVolume);
|
||||||
uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
uint32* indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
Node().stream.triple_indirect));
|
Node().stream.triple_indirect));
|
||||||
if (indirectBlocks != NULL)
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
indirectBlocks[index / perIndirectBlock]));
|
indirectBlocks[index / perIndirectBlock]));
|
||||||
if (indirectBlocks != NULL)
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
indirectBlocks = (uint32*)cached.SetTo(B_LENDIAN_TO_HOST_INT32(
|
||||||
indirectBlocks[(index / perBlock) & (perBlock - 1)]));
|
indirectBlocks[(index / perBlock) & (perBlock - 1)]));
|
||||||
if (indirectBlocks != NULL)
|
if (indirectBlocks == NULL)
|
||||||
return B_IO_ERROR;
|
return B_IO_ERROR;
|
||||||
|
|
||||||
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]);
|
block = B_LENDIAN_TO_HOST_INT32(indirectBlocks[index & (perBlock - 1)]);
|
||||||
|
|||||||
Reference in New Issue
Block a user