summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2009-04-21 11:53:19 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2009-04-21 11:53:19 +0200
commit4fc367117b20eea5e7f8f05c0d59de4976d37c49 (patch)
tree8bbcf8a0cd4fd3d2764281546f6511c0c8268a4f
parent46dc48d2235c5916179bacf58f800132cd7a7257 (diff)
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.
-rw-r--r--libhal-storage/libhal-storage.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index f3fe9898..0e381b69 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