hal/hald/linux2/probing probe-volume.c,1.5,1.6
David Zeuthen
david at freedesktop.org
Fri Mar 11 14:42:37 PST 2005
Update of /cvs/hal/hal/hald/linux2/probing
In directory gabe:/tmp/cvs-serv7672/hald/linux2/probing
Modified Files:
probe-volume.c
Log Message:
2005-03-11 David Zeuthen <davidz at redhat.com>
* hald/linux2/probing/probe-volume.c (main): Patch from Kay
Sievers <kay.sievers at vrfy.org> I need the following to make linux
raid volumes working again. I have a test disk here, that does not
work with the new HAL.
Index: probe-volume.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-volume.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- probe-volume.c 28 Feb 2005 19:43:29 -0000 1.5
+++ probe-volume.c 11 Mar 2005 22:42:34 -0000 1.6
@@ -48,6 +48,7 @@
#include "drive_id/drive_id.h"
#include "volume_id/volume_id.h"
+#include "volume_id/logging.h"
#include "volume_id/msdos.h"
#include "linux_dvd_rw_utils.h"
@@ -296,11 +297,30 @@
}
}
+ /* block size and total size */
+ if (ioctl (fd, BLKSSZGET, &block_size) == 0) {
+ dbg ("volume.block_size = %d", block_size);
+ libhal_device_set_property_int (ctx, udi, "volume.block_size", block_size, &error);
+ }
+ if (ioctl (fd, BLKGETSIZE64, &vol_size) == 0) {
+ dbg ("volume.size = %llu", vol_size);
+ libhal_device_set_property_uint64 (ctx, udi, "volume.size", vol_size, &error);
+ } else
+ vol_size = 0;
+
if (should_probe_for_fs) {
+
+ /* Optical discs have problems reporting the exact
+ * size so we should never look for data there since
+ * it causes problems with the broken ide-cd driver
+ */
+ if (is_disc)
+ vol_size = 0;
+
/* probe for file system */
vid = volume_id_open_fd (fd);
if (vid != NULL) {
- if (volume_id_probe_all (vid, 0, 0 /* size */) == 0) {
+ if (volume_id_probe_all (vid, 0, vol_size /* size */) == 0) {
set_volume_id_values(ctx, udi, vid);
} else {
libhal_device_set_property_string (ctx, udi, "info.product", "Volume", &error);
@@ -357,16 +377,6 @@
}
}
- /* block size and total size */
- if (ioctl (fd, BLKSSZGET, &block_size) == 0) {
- dbg ("volume.block_size = %d", block_size);
- libhal_device_set_property_int (ctx, udi, "volume.block_size", block_size, &error);
- }
- if (ioctl (fd, BLKGETSIZE64, &vol_size) == 0) {
- dbg ("volume.size = %llu", vol_size);
- libhal_device_set_property_uint64 (ctx, udi, "volume.size", vol_size, &error);
- }
-
/* good so far */
ret = 0;
More information about the hal-commit
mailing list