Beispiel #1
0
// _HandleRequest
status_t
KernelRequestHandler::_HandleRequest(FileCacheCreateRequest* request)
{
	// check and execute the request
	Volume* volume = NULL;
	status_t result = _GetVolume(request->nsid, &volume);
	VolumePutter _(volume);

	if (result == B_OK)
		result = volume->CreateFileCache(request->vnid, request->size);

	// prepare the reply
	RequestAllocator allocator(fPort->GetPort());
	FileCacheCreateReply* reply;
	status_t error = AllocateRequest(allocator, &reply);
	if (error != B_OK)
		return error;
	reply->error = result;

	// send the reply
	return fPort->SendRequest(&allocator);
}