rem: isCD = (geometry.device_type == B_CD);
context: disk_scanner_get_nth_session_info(int deviceFD, int32 index,								  session_info *sessionInfo,								  session_module_info **_sessionModule){	status_t error = B_OK;	session_module_info *sessionModule		= (_sessionModule ? *_sessionModule : NULL);	bool isCD = false;	int32 blockSize = 0;	off_t deviceSize = 0;	device_geometry geometry;	// get the media status	if (ioctl(deviceFD, B_GET_MEDIA_STATUS, &error) != 0)		error = errno;	// get the device geometry	TRACE(("disk_scanner: get_nth_session_info(%d, %ld)\n", deviceFD, index));	if (error == B_OK) {		if (ioctl(deviceFD, B_GET_GEOMETRY, &geometry) == 0) {			isCD = (geometry.device_type == B_CD);			blockSize = geometry.bytes_per_sector;			deviceSize = (off_t)blockSize * geometry.sectors_per_track				* geometry.cylinder_count * geometry.head_count;		} else			error = errno;	}TRACE(("disk_scanner:   check: %s\n", strerror(error)));	// get a session module, if the device is a CD, otherwise return a	// virtual session	if (error == B_OK) {		if (isCD) {			// get the session module			if (!sessionModule) {				error = disk_scanner_get_session_module(deviceFD, deviceSize,														blockSize,														&sessionModule);TRACE(("disk_scanner:     check: %s\n", strerror(error)));			}			// get the info			if (error == B_OK) {				error = sessionModule->get_nth_info(deviceFD, index,													deviceSize, blockSize,													sessionInfo);TRACE(("disk_scanner:     check: %s\n", strerror(error)));			}		} else if (index == 0) {			// no CD -- virtual session			sessionInfo->offset = 0;			sessionInfo->size = deviceSize;			sessionInfo->logical_block_size = blockSize;			sessionInfo->index = 0;			sessionInfo->flags = B_VIRTUAL_SESSION;		} else	// no CD, fail after the first session			error = B_ENTRY_NOT_FOUND;	}TRACE(("disk_scanner:   check: %s\n", strerror(error)));	// cleanup / set results	if (_sessionModule)		*_sessionModule = sessionModule;	else if (sessionModule)		put_module(sessionModule->module.name);	TRACE(("disk_scanner: get_nth_session_info() done: %s\n",		   strerror(error)));	return error;}