rem: file_io_vec *last = &vecs[vecCount - 1]; mapOffset += last->length; vecCount = maxVecs;
add: if (status != B_BUFFER_OVERFLOW) break;    file_io_vec *last = &vecs[vecCount - 1]; mapOffset += last->length; vecCount = maxVecs; }
context: get_file_map(file_cache_ref *ref, off_t offset, size_t size,	file_io_vec *vecs, size_t *_count){	size_t maxVecs = *_count;	if (ref->map.count == 0) {		// we don't yet have the map of this file, so let's grab it		// (ordered by offset, so that we can do a binary search on them)		size_t vecCount = maxVecs;		status_t status;		off_t mapOffset = 0;		while (true) {			status = vfs_get_file_map(ref->vnode, mapOffset, ~0UL, vecs, &vecCount);			if (status < B_OK && status != B_BUFFER_OVERFLOW)				return status;			ref->map.Add(vecs, vecCount);			if (status != B_BUFFER_OVERFLOW)				break;			// when we are here, the map has been stored in the array, and			// the array size was still too small to cover the whole file			file_io_vec *last = &vecs[vecCount - 1];			mapOffset += last->length;			vecCount = maxVecs;		}	}	// We now have cached the map of this file, we now need to	// translate it for the requested access.	uint32 index;	file_extent *fileExtent = find_file_extent(ref, offset, &index);	if (fileExtent == NULL) {		// access outside file bounds? But that's not our problem		*_count = 0;		return B_OK;	}	offset -= fileExtent->offset;	vecs[0].offset = fileExtent->disk.offset + offset;	vecs[0].length = fileExtent->disk.length - offset;	if (vecs[0].length >= size || index >= ref->map.count - 1) {		*_count = 1;		return B_OK;	}	// copy the rest of the vecs	size -= vecs[0].length;	for (index = 1; index < ref->map.count;) {		fileExtent++;		vecs[index] = fileExtent->disk;		index++;		if (index >= maxVecs) {			*_count = index;			return B_BUFFER_OVERFLOW;		}		if (size <= fileExtent->disk.length)			break;		size -= fileExtent->disk.length;	}	*_count = index;	return B_OK;}