Fixed build. The tests actually reveal a problem in the IORequest
implementation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29998 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
093e00573f
commit
53cce89bf5
@ -189,26 +189,11 @@ do_io(void* data, IOOperation* operation)
|
||||
const iovec& vec = operation->Vecs()[i];
|
||||
addr_t base = (addr_t)vec.iov_base;
|
||||
size_t length = vec.iov_len;
|
||||
size_t pageOffset = base % B_PAGE_SIZE;
|
||||
|
||||
while (length > 0) {
|
||||
size_t toCopy = min_c(length, B_PAGE_SIZE - pageOffset);
|
||||
|
||||
uint8* virtualAddress;
|
||||
vm_get_physical_page(base - pageOffset, (addr_t*)&virtualAddress,
|
||||
PHYSICAL_PAGE_NO_WAIT);
|
||||
|
||||
if (operation->IsWrite())
|
||||
memcpy(disk + offset, virtualAddress + pageOffset, toCopy);
|
||||
else
|
||||
memcpy(virtualAddress + pageOffset, disk + offset, toCopy);
|
||||
|
||||
vm_put_physical_page((addr_t)virtualAddress);
|
||||
|
||||
length -= toCopy;
|
||||
offset += toCopy;
|
||||
pageOffset = 0;
|
||||
}
|
||||
if (operation->IsWrite())
|
||||
vm_memcpy_from_physical(disk + offset, base, length, false);
|
||||
else
|
||||
vm_memcpy_to_physical(base, disk + offset, length, false);
|
||||
}
|
||||
|
||||
if (sIOScheduler != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user