Minor changes: Small fixes and some more debug output.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2667 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -82,6 +82,7 @@ DiskDeviceManager::MessageReceived(BMessage *message)
|
|||||||
void
|
void
|
||||||
DiskDeviceManager::_NextDiskDeviceRequest(BMessage *message)
|
DiskDeviceManager::_NextDiskDeviceRequest(BMessage *message)
|
||||||
{
|
{
|
||||||
|
FUNCTION_START();
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
int32 cookie = 0;
|
int32 cookie = 0;
|
||||||
BMessage reply(B_REG_RESULT);
|
BMessage reply(B_REG_RESULT);
|
||||||
@@ -90,12 +91,12 @@ DiskDeviceManager::_NextDiskDeviceRequest(BMessage *message)
|
|||||||
if (RDiskDevice *device = fDeviceList.DeviceWithID(cookie, false)) {
|
if (RDiskDevice *device = fDeviceList.DeviceWithID(cookie, false)) {
|
||||||
// archive device
|
// archive device
|
||||||
BMessage deviceArchive;
|
BMessage deviceArchive;
|
||||||
error = device->Archive(&deviceArchive);
|
SET_ERROR(error, device->Archive(&deviceArchive));
|
||||||
// add archived device and next cookie to reply message
|
// add archived device and next cookie to reply message
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = reply.AddMessage("device", &deviceArchive);
|
SET_ERROR(error, reply.AddMessage("device", &deviceArchive));
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = reply.AddInt32("cookie", device->ID() + 1);
|
SET_ERROR(error, reply.AddInt32("cookie", device->ID() + 1));
|
||||||
} else
|
} else
|
||||||
error = B_ENTRY_NOT_FOUND;
|
error = B_ENTRY_NOT_FOUND;
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ status_t
|
|||||||
RDiskDevice::SetTo(const char *path, int fd, const device_geometry *geometry,
|
RDiskDevice::SetTo(const char *path, int fd, const device_geometry *geometry,
|
||||||
status_t mediaStatus)
|
status_t mediaStatus)
|
||||||
{
|
{
|
||||||
FUNCTION_START();
|
PRINT(("RDiskDevice::SetTo()\n"));
|
||||||
Unset();
|
Unset();
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
fID = _NextID();
|
fID = _NextID();
|
||||||
@@ -66,6 +66,7 @@ FUNCTION_START();
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
error = fMediaStatus;
|
error = fMediaStatus;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
// scan the device for sessions, if we have a media
|
// scan the device for sessions, if we have a media
|
||||||
if (fMediaStatus == B_OK) {
|
if (fMediaStatus == B_OK) {
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ struct CompareIDPredicate : public UnaryPredicate<T> {
|
|||||||
{
|
{
|
||||||
int32 id = object->ID();
|
int32 id = object->ID();
|
||||||
if (fID < id)
|
if (fID < id)
|
||||||
return -1;
|
|
||||||
if (fID > id)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
if (fID > id)
|
||||||
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,18 +131,6 @@ RSession::RemovePartition(RPartition *partition)
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
// print_session_info
|
|
||||||
static
|
|
||||||
void
|
|
||||||
print_session_info(const char *prefix, const session_info &info)
|
|
||||||
{
|
|
||||||
printf("%soffset: %lld\n", prefix, info.offset);
|
|
||||||
printf("%ssize: %lld\n", prefix, info.size);
|
|
||||||
printf("%sblock size: %ld\n", prefix, info.logical_block_size);
|
|
||||||
printf("%sindex: %ld\n", prefix, info.index);
|
|
||||||
printf("%sflags: %lx\n", prefix, info.flags);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Archive
|
// Archive
|
||||||
status_t
|
status_t
|
||||||
RSession::Archive(BMessage *archive) const
|
RSession::Archive(BMessage *archive) const
|
||||||
@@ -177,6 +165,18 @@ RSession::Archive(BMessage *archive) const
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print_session_info
|
||||||
|
static
|
||||||
|
void
|
||||||
|
print_session_info(const char *prefix, const session_info &info)
|
||||||
|
{
|
||||||
|
printf("%soffset: %lld\n", prefix, info.offset);
|
||||||
|
printf("%ssize: %lld\n", prefix, info.size);
|
||||||
|
printf("%sblock size: %ld\n", prefix, info.logical_block_size);
|
||||||
|
printf("%sindex: %ld\n", prefix, info.index);
|
||||||
|
printf("%sflags: %lx\n", prefix, info.flags);
|
||||||
|
}
|
||||||
|
|
||||||
// Dump
|
// Dump
|
||||||
void
|
void
|
||||||
RSession::Dump() const
|
RSession::Dump() const
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ struct CompareIDPredicate : public UnaryPredicate<RVolume> {
|
|||||||
{
|
{
|
||||||
dev_t id = volume->ID();
|
dev_t id = volume->ID();
|
||||||
if (fID < id)
|
if (fID < id)
|
||||||
return -1;
|
|
||||||
if (fID > id)
|
|
||||||
return 1;
|
return 1;
|
||||||
|
if (fID > id)
|
||||||
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user