Added KFileDiskDevice to the build again. Fixed compile errors. It won't work yet, though.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9566 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2004-10-28 16:05:22 +00:00
parent 4303e367b2
commit da87ac8c9a
3 changed files with 8 additions and 13 deletions

View File

@ -22,7 +22,7 @@ KernelMergeObject kernel_disk_device_manager.o :
KDiskDeviceJobGenerator.cpp
KDiskDeviceJobQueue.cpp
KDiskDeviceManager.cpp
# KFileDiskDevice.cpp
KFileDiskDevice.cpp
KDiskSystem.cpp
KFileSystem.cpp
KPartition.cpp

View File

@ -313,8 +313,6 @@ KDiskDeviceManager::FindDevice(partition_id id, bool deviceOnly)
return NULL;
}
//#include "AutoDeleter.h"
// FindPartition
KPartition *
KDiskDeviceManager::FindPartition(const char *path, bool noShadow)
@ -354,8 +352,6 @@ KDiskDeviceManager::FindPartition(partition_id id, bool noShadow)
KFileDiskDevice *
KDiskDeviceManager::FindFileDevice(const char *filePath)
{
// ToDo: this solution makes use of dynamic_cast!
#if 0
for (int32 cookie = 0; KDiskDevice *device = NextDevice(&cookie); ) {
KFileDiskDevice *fileDevice = dynamic_cast<KFileDiskDevice*>(device);
if (fileDevice && fileDevice->FilePath()
@ -363,7 +359,6 @@ KDiskDeviceManager::FindFileDevice(const char *filePath)
return fileDevice;
}
}
#endif
return NULL;
}
@ -595,8 +590,6 @@ KDiskDeviceManager::DeleteFileDevice(const char *filePath)
status_t
KDiskDeviceManager::DeleteFileDevice(partition_id id)
{
// ToDo: there is no dynamic_cast in the kernel!
#if 0
if (KDiskDevice *device = RegisterDevice(id)) {
PartitionRegistrar _(device, true);
if (!dynamic_cast<KFileDiskDevice*>(device) || id != device->ID())
@ -606,7 +599,6 @@ KDiskDeviceManager::DeleteFileDevice(partition_id id)
return B_OK;
}
}
#endif
return B_ERROR;
}

View File

@ -75,7 +75,7 @@ KFileDiskDevice::SetTo(const char *filePath, const char *devicePath)
return errno;
}
// make the directory
status_t error = _GetDirectoryPath(ID(), tmpDevicePath);
status_t error = _GetDirectoryPath(ID(), &tmpDevicePath);
if (error != B_OK)
return error;
if (mkdir(tmpDevicePath.Path(), 0777) != 0)
@ -85,7 +85,7 @@ KFileDiskDevice::SetTo(const char *filePath, const char *devicePath)
return B_BUFFER_OVERFLOW;
devicePath = tmpDevicePath.Path();
// register the file as virtual drive
status_t error = _RegisterDevice(filePath, devicePath);
error = _RegisterDevice(filePath, devicePath);
if (error != B_OK)
return error;
}
@ -176,6 +176,8 @@ KFileDiskDevice::_RegisterDevice(const char *file, const char *device)
status_t
KFileDiskDevice::_UnregisterDevice(const char *_device)
{
return B_ERROR;
#if 0
// read the symlink to get the path of the virtualdrive device
char device[B_PATH_NAME_LENGTH];
ssize_t bytesRead = readlink(_device, device, sizeof(device) - 1);
@ -198,6 +200,7 @@ KFileDiskDevice::_UnregisterDevice(const char *_device)
error = errno;
}
return error;
#endif
}
// _GetDirectoryPath
@ -206,9 +209,9 @@ KFileDiskDevice::_GetDirectoryPath(partition_id id, KPath *path)
{
if (!path || path->InitCheck() != B_OK)
return path->InitCheck();
status_t error = path->SetString(kFileDevicesDir);
status_t error = path->SetPath(kFileDevicesDir);
if (error == B_OK) {
char idBuffer[12]
char idBuffer[12];
sprintf(idBuffer, "%ld", id);
error = path->Append(idBuffer);
}