Fixed File::ReadAt() (it didn't return the actual length read, just B_OK).
Visually simplified Volume::ToBlock(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5109 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -47,7 +47,11 @@ File::InitCheck()
|
|||||||
ssize_t
|
ssize_t
|
||||||
File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
|
File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
|
||||||
{
|
{
|
||||||
return fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize);
|
status_t status = fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize);
|
||||||
|
if (status < B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
return bufferSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class Volume {
|
|||||||
|
|
||||||
off_t ToOffset(block_run run) const { return ToBlock(run) << BlockShift(); }
|
off_t ToOffset(block_run run) const { return ToBlock(run) << BlockShift(); }
|
||||||
off_t ToOffset(off_t block) const { return block << BlockShift(); }
|
off_t ToOffset(off_t block) const { return block << BlockShift(); }
|
||||||
off_t ToBlock(block_run run) const { return ((((off_t)run.AllocationGroup()) << AllocationGroupShift()) | (off_t)run.Start()); }
|
off_t ToBlock(block_run run) const { return ((off_t)run.AllocationGroup() << AllocationGroupShift()) | (uint32)run.Start(); }
|
||||||
block_run ToBlockRun(off_t block) const;
|
block_run ToBlockRun(off_t block) const;
|
||||||
status_t ValidateBlockRun(block_run run);
|
status_t ValidateBlockRun(block_run run);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user