[ostree/wip/delta2] delta: Print size of fallback object
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/delta2] delta: Print size of fallback object
- Date: Sun, 27 Apr 2014 20:49:08 +0000 (UTC)
commit 4db756156e7542ba3d6506fbec4790157fbf3c5b
Author: Colin Walters <walters verbum org>
Date: Sun Apr 27 16:48:44 2014 -0400
delta: Print size of fallback object
I was curious just how large they were.
.../ostree-repo-static-delta-compilation.c | 29 +++++---------------
1 files changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-compilation.c
b/src/libostree/ostree-repo-static-delta-compilation.c
index cf5d7a1..7f98e64 100644
--- a/src/libostree/ostree-repo-static-delta-compilation.c
+++ b/src/libostree/ostree-repo-static-delta-compilation.c
@@ -273,38 +273,23 @@ generate_delta_lowlatency (OstreeRepo *repo,
GVariant *serialized_key = key;
const char *checksum;
OstreeObjectType objtype;
- guint64 compressed_size;
guint64 uncompressed_size;
gboolean fallback = FALSE;
ostree_object_name_deserialize (serialized_key, &checksum, &objtype);
- /* First, do a cheap stat() on the *compressed* size - if that's
- * larger than the max uncompressed size of a delta part, then
- * clearly uncompressed will be larger.
- */
- if (!ostree_repo_query_object_storage_size (repo, objtype, checksum,
- &compressed_size,
- cancellable, error))
+ if (!ostree_repo_load_object_stream (repo, objtype, checksum,
+ NULL, &uncompressed_size,
+ cancellable, error))
goto out;
-
- if (compressed_size > builder->max_usize_bytes)
+ if (uncompressed_size > builder->max_usize_bytes)
fallback = TRUE;
- else
- {
- /* Now query the uncompressed size. */
- if (!ostree_repo_load_object_stream (repo, objtype, checksum,
- NULL, &uncompressed_size,
- cancellable, error))
- goto out;
- if (uncompressed_size > builder->max_usize_bytes)
- fallback = TRUE;
- }
if (fallback)
{
- g_printerr ("fallback for %s\n",
- ostree_object_to_string (checksum, objtype));
+ gs_free char *size = g_format_size (uncompressed_size);
+ g_printerr ("fallback for %s (%s)\n",
+ ostree_object_to_string (checksum, objtype), size);
g_ptr_array_add (builder->fallback_objects,
g_variant_ref (serialized_key));
g_hash_table_iter_remove (&hashiter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]