Removed some debug info. Changes due to the removal of the extended_partition_info::partition_code field.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2751 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -494,8 +494,6 @@ BDiskDeviceRoster::StopWatching(BMessenger target)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_time(const char *format, bigtime_t &time);
|
|
||||||
|
|
||||||
// _GetObjectWithID
|
// _GetObjectWithID
|
||||||
/*! \brief Returns a BDiskDevice for a given device, session or partition ID.
|
/*! \brief Returns a BDiskDevice for a given device, session or partition ID.
|
||||||
|
|
||||||
@@ -517,18 +515,15 @@ status_t
|
|||||||
BDiskDeviceRoster::_GetObjectWithID(const char *fieldName, int32 id,
|
BDiskDeviceRoster::_GetObjectWithID(const char *fieldName, int32 id,
|
||||||
BDiskDevice *device) const
|
BDiskDevice *device) const
|
||||||
{
|
{
|
||||||
bigtime_t time = system_time();
|
|
||||||
status_t error = (device ? B_OK : B_BAD_VALUE);
|
status_t error = (device ? B_OK : B_BAD_VALUE);
|
||||||
// compose request message
|
// compose request message
|
||||||
BMessage request(B_REG_GET_DISK_DEVICE);
|
BMessage request(B_REG_GET_DISK_DEVICE);
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = request.AddInt32(fieldName, id);
|
error = request.AddInt32(fieldName, id);
|
||||||
print_time("composing request message", time);
|
|
||||||
// send request
|
// send request
|
||||||
BMessage reply;
|
BMessage reply;
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = fManager.SendMessage(&request, &reply);
|
error = fManager.SendMessage(&request, &reply);
|
||||||
print_time("sending request", time);
|
|
||||||
// analyze reply
|
// analyze reply
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
// result
|
// result
|
||||||
@@ -540,10 +535,8 @@ print_time("sending request", time);
|
|||||||
BMessage archive;
|
BMessage archive;
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = reply.FindMessage("device", &archive);
|
error = reply.FindMessage("device", &archive);
|
||||||
print_time("extracting archived device", time);
|
|
||||||
if (error == B_OK)
|
if (error == B_OK)
|
||||||
error = device->_Unarchive(&archive);
|
error = device->_Unarchive(&archive);
|
||||||
print_time("unarchiving device", time);
|
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,7 @@ public:
|
|||||||
|
|
||||||
int32 ID() const { return fID; }
|
int32 ID() const { return fID; }
|
||||||
int32 ChangeCounter() const { return fChangeCounter.Count(); }
|
int32 ChangeCounter() const { return fChangeCounter.Count(); }
|
||||||
// void Changed() { fChangeCounter.Increment(); }
|
void Changed() { fChangeCounter.Increment(); }
|
||||||
void Changed() { if (fChangeCounter.Increment()) PRINT(("RDiskDevice::Changed()\n")); }
|
|
||||||
|
|
||||||
void SetTouched(bool touched) { fTouched = touched; }
|
void SetTouched(bool touched) { fTouched = touched; }
|
||||||
bool Touched() const { return fTouched; }
|
bool Touched() const { return fTouched; }
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ RPartition::Update(const extended_partition_info *partitionInfo)
|
|||||||
|| strcmp(partitionInfo->file_system_long_name,
|
|| strcmp(partitionInfo->file_system_long_name,
|
||||||
fInfo.file_system_long_name)
|
fInfo.file_system_long_name)
|
||||||
|| strcmp(partitionInfo->volume_name, fInfo.volume_name)
|
|| strcmp(partitionInfo->volume_name, fInfo.volume_name)
|
||||||
|| partitionInfo->partition_code != fInfo.partition_code
|
|
||||||
|| partitionInfo->file_system_flags != fInfo.file_system_flags) {
|
|| partitionInfo->file_system_flags != fInfo.file_system_flags) {
|
||||||
fInfo = *partitionInfo;
|
fInfo = *partitionInfo;
|
||||||
PartitionChanged();
|
PartitionChanged();
|
||||||
@@ -179,7 +178,6 @@ print_partition_info(const char *prefix, const extended_partition_info &info)
|
|||||||
printf("%spartition ID: %ld\n", prefix, info.info.partition);
|
printf("%spartition ID: %ld\n", prefix, info.info.partition);
|
||||||
printf("%sdevice: `%s'\n", prefix, info.info.device);
|
printf("%sdevice: `%s'\n", prefix, info.info.device);
|
||||||
printf("%sflags: %lx\n", prefix, info.flags);
|
printf("%sflags: %lx\n", prefix, info.flags);
|
||||||
printf("%spartition code: 0x%lx\n", prefix, info.partition_code);
|
|
||||||
printf("%spartition name: `%s'\n", prefix, info.partition_name);
|
printf("%spartition name: `%s'\n", prefix, info.partition_name);
|
||||||
printf("%spartition type: `%s'\n", prefix, info.partition_type);
|
printf("%spartition type: `%s'\n", prefix, info.partition_type);
|
||||||
printf("%sFS short name: `%s'\n", prefix, info.file_system_short_name);
|
printf("%sFS short name: `%s'\n", prefix, info.file_system_short_name);
|
||||||
|
|||||||
@@ -37,13 +37,11 @@ print_partition_info(const char *prefix, const extended_partition_info &info)
|
|||||||
printf("%spartition ID: %ld\n", prefix, info.info.partition);
|
printf("%spartition ID: %ld\n", prefix, info.info.partition);
|
||||||
printf("%sdevice: `%s'\n", prefix, info.info.device);
|
printf("%sdevice: `%s'\n", prefix, info.info.device);
|
||||||
printf("%sflags: %lx\n", prefix, info.flags);
|
printf("%sflags: %lx\n", prefix, info.flags);
|
||||||
printf("%spartition code: 0x%lx\n", prefix, info.partition_code);
|
|
||||||
printf("%spartition name: `%s'\n", prefix, info.partition_name);
|
printf("%spartition name: `%s'\n", prefix, info.partition_name);
|
||||||
printf("%spartition type: `%s'\n", prefix, info.partition_type);
|
printf("%spartition type: `%s'\n", prefix, info.partition_type);
|
||||||
printf("%sFS short name: `%s'\n", prefix, info.file_system_short_name);
|
printf("%sFS short name: `%s'\n", prefix, info.file_system_short_name);
|
||||||
printf("%sFS long name: `%s'\n", prefix, info.file_system_long_name);
|
printf("%sFS long name: `%s'\n", prefix, info.file_system_long_name);
|
||||||
printf("%svolume name: `%s'\n", prefix, info.volume_name);
|
printf("%svolume name: `%s'\n", prefix, info.volume_name);
|
||||||
// printf("%smounted at: `%s'\n", prefix, info.mounted_at);
|
|
||||||
printf("%sFS flags: 0x%lx\n", prefix, info.file_system_flags);
|
printf("%sFS flags: 0x%lx\n", prefix, info.file_system_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -286,23 +286,18 @@ printf("TestApp::MessageReceived(%.4s)\n", (char*)&message->what);
|
|||||||
// MediaChanged
|
// MediaChanged
|
||||||
void MediaChanged(BMessage *message)
|
void MediaChanged(BMessage *message)
|
||||||
{
|
{
|
||||||
bigtime_t time = system_time();
|
|
||||||
printf("TestApp::MediaChanged()\n");
|
printf("TestApp::MediaChanged()\n");
|
||||||
PrintDeviceInfo(message);
|
PrintDeviceInfo(message);
|
||||||
print_time("PrintDeviceInfo()", time);
|
|
||||||
int32 id;
|
int32 id;
|
||||||
if (message->FindInt32("device_id", &id) == B_OK) {
|
if (message->FindInt32("device_id", &id) == B_OK) {
|
||||||
for (int32 i = 0; BDiskDevice *device = fDevices.ItemAt(i); i++) {
|
for (int32 i = 0; BDiskDevice *device = fDevices.ItemAt(i); i++) {
|
||||||
if (device->UniqueID() == id) {
|
if (device->UniqueID() == id) {
|
||||||
bool updated;
|
bool updated;
|
||||||
print_time("finding device", time);
|
|
||||||
status_t error = device->Update(&updated);
|
status_t error = device->Update(&updated);
|
||||||
print_time("updating device", time);
|
|
||||||
printf("updated: %d\n", updated);
|
printf("updated: %d\n", updated);
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
DumpVisitor visitor;
|
DumpVisitor visitor;
|
||||||
device->Traverse(&visitor);
|
device->Traverse(&visitor);
|
||||||
print_time("dumping device", time);
|
|
||||||
} else {
|
} else {
|
||||||
printf("device->Update() failed: %s\n",
|
printf("device->Update() failed: %s\n",
|
||||||
strerror(error));
|
strerror(error));
|
||||||
@@ -366,19 +361,12 @@ print_time("dumping device", time);
|
|||||||
// PrintDeviceInfo
|
// PrintDeviceInfo
|
||||||
void PrintDeviceInfo(BMessage *message)
|
void PrintDeviceInfo(BMessage *message)
|
||||||
{
|
{
|
||||||
bigtime_t time = system_time();
|
|
||||||
int32 deviceID;
|
int32 deviceID;
|
||||||
if (message->FindInt32("device_id", &deviceID) == B_OK) {
|
if (message->FindInt32("device_id", &deviceID) == B_OK) {
|
||||||
print_time("finding device_id", time);
|
|
||||||
BDiskDeviceRoster roster;
|
BDiskDeviceRoster roster;
|
||||||
print_time("creating roster", time);
|
|
||||||
BDiskDevice device;
|
BDiskDevice device;
|
||||||
if (roster.GetDeviceWithID(deviceID, &device) == B_OK)
|
if (roster.GetDeviceWithID(deviceID, &device) == B_OK)
|
||||||
{
|
|
||||||
print_time("getting device", time);
|
|
||||||
DumpVisitor().Visit(&device);
|
DumpVisitor().Visit(&device);
|
||||||
print_time("dumping device", time);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user