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:
Axel Dörfler 2003-10-21 05:27:24 +00:00
parent 3a8a05a459
commit a47544320d
2 changed files with 6 additions and 2 deletions

View File

@ -47,7 +47,11 @@ File::InitCheck()
ssize_t
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;
}

View File

@ -47,7 +47,7 @@ class Volume {
off_t ToOffset(block_run run) const { return ToBlock(run) << 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;
status_t ValidateBlockRun(block_run run);