hal: Branch 'master'
Martin Pitt
martin at kemper.freedesktop.org
Tue Apr 21 02:55:55 PDT 2009
libhal-storage/libhal-storage.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 4fc367117b20eea5e7f8f05c0d59de4976d37c49
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date: Tue Apr 21 11:53:19 2009 +0200
fix volume.num_blocks data type in libhal-storage
commit f7d7779d0fd2438479c9de4b8dd76f986941f0a4 changed volume.num_blocks from
int to uint64, to accomodate large block sizes. Do the corresponding change in
libhal-storage's LibHalVolume internal struct as well.
Conveniently, libhal_volume_get_size() was already declared to return a
dbus_uint64_t, so this does not change external library ABI.
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index f3fe989..0e381b6 100644
--- a/libhal-storage/libhal-storage.c
+++ b/libhal-storage/libhal-storage.c
@@ -769,7 +769,7 @@ struct LibHalVolume_s {
dbus_bool_t disc_is_rewritable;
unsigned int block_size;
- unsigned int num_blocks;
+ dbus_uint64_t num_blocks;
char *desired_mount_point;
char *mount_filesystem;
@@ -1177,7 +1177,7 @@ libhal_volume_from_udi (LibHalContext *hal_ctx, const char *udi)
LIBHAL_PROP_EXTRACT_STRING ("volume.crypto_luks.clear.backing_volume", vol->crypto_backing_volume);
LIBHAL_PROP_EXTRACT_INT ("volume.block_size", vol->block_size);
- LIBHAL_PROP_EXTRACT_INT ("volume.num_blocks", vol->num_blocks);
+ LIBHAL_PROP_EXTRACT_UINT64 ("volume.num_blocks", vol->num_blocks);
LIBHAL_PROP_EXTRACT_UINT64 ("volume.size", vol->volume_size);
LIBHAL_PROP_EXTRACT_STRING ("volume.label", vol->volume_label);
LIBHAL_PROP_EXTRACT_STRING ("volume.mount_point", vol->mount_point);
@@ -1504,7 +1504,7 @@ libhal_volume_get_size (LibHalVolume *volume)
if (volume->volume_size > 0)
return volume->volume_size;
else
- return ((dbus_uint64_t)volume->block_size) * ((dbus_uint64_t)volume->num_blocks);
+ return ((dbus_uint64_t)volume->block_size) * volume->num_blocks;
}
dbus_uint64_t
More information about the hal-commit
mailing list