rem: if (error != B_OK)
add: if (error == B_OK) generator.DetachJobQueue(); else
context: _kern_commit_disk_device_modifications(partition_id deviceID, port_id port,									   int32 token, bool completeProgress){	KDiskDeviceManager *manager = KDiskDeviceManager::Default();	// get the device	if (KDiskDevice *device = manager->RegisterDevice(deviceID, true)) {		PartitionRegistrar _(device, true);		if (DeviceWriteLocker locker = device) {			if (device->ShadowOwner() != get_current_team())				return B_BAD_VALUE;			// generate the jobs			KDiskDeviceJobGenerator generator(manager->JobFactory(), device);			status_t error = generator.GenerateJobs();			if (error != B_OK)				return error;			// add the jobs to the manager			if (ManagerLocker locker2 = manager) {				error = manager->AddJobQueue(generator.JobQueue());				if (error != B_OK)					return error;			} else				return B_ERROR;			// TODO: notification stuff			return device->DeleteShadowDevice();		}	}	return B_ENTRY_NOT_FOUND;}