rem: TRACE(("read_from_cache: ref = %p, offset = %Ld, size = %lu\n", ref, offset, bufferSize));
add: TRACE(("read_from_cache: ref = %p, offset = %Ld, size = %lu, buffer = %p, bufferSize = %lu\n", ref, offset, size, (void *)buffer, bufferSize));
context: read_from_cache(file_cache_ref *ref, off_t offset, size_t size, addr_t buffer, size_t bufferSize){	TRACE(("read_from_cache: ref = %p, offset = %Ld, size = %lu\n", ref, offset, bufferSize));	iovec vecs[MAX_IO_VECS];	int32 vecCount = 0;	// make sure "offset" is page aligned - but also remember the page offset	int32 pageOffset = offset & (B_PAGE_SIZE - 1);	size = PAGE_ALIGN(size + pageOffset);	offset -= pageOffset;	vm_page *pages[32];	int32 pageIndex = 0;	// ToDo: fix this	if (size > 32 * B_PAGE_SIZE)		panic("cannot handle large I/O - fix me!\n");	// allocate pages for the cache and mark them busy	for (size_t pos = 0; pos < size; pos += B_PAGE_SIZE) {		vm_page *page = pages[pageIndex++] = vm_page_allocate_page(PAGE_STATE_FREE);		page->state = PAGE_STATE_BUSY;		vm_cache_insert_page(ref->cache, page, offset + pos);		addr_t virtualAddress;		vm_get_physical_page(page->ppn * PAGE_SIZE, &virtualAddress, PHYSICAL_PAGE_CAN_WAIT);		add_to_iovec(vecs, vecCount, MAX_IO_VECS, virtualAddress, B_PAGE_SIZE);		// ToDo: check if the array is large enough!	}	// read file into reserved pages	status_t status = readwrite_pages(ref, offset, vecs, vecCount, &size, false);	if (status < B_OK) {		// ToDo: remove allocated pages...		panic("file_cache: remove allocated pages! read pages failed: %s\n", strerror(status));		return status;	}	// copy the pages and unmap them again	for (int32 i = 0; i < vecCount; i++) {		addr_t base = (addr_t)vecs[i].iov_base;		size_t size = vecs[i].iov_len;		// copy to user buffer if necessary		if (bufferSize != 0) {			size_t bytes = min_c(bufferSize, size - pageOffset);			user_memcpy((void *)buffer, (void *)(base + pageOffset), bytes);			buffer += bytes;			bufferSize -= bytes;		}		for (size_t pos = 0; pos < size; pos += B_PAGE_SIZE, base += B_PAGE_SIZE)			vm_put_physical_page(base);	}	// make the pages accessible in the cache	for (int32 i = pageIndex; i-- > 0;)		pages[i]->state = PAGE_STATE_ACTIVE;	return B_OK;}