Skip to content

Commit

Permalink
lib/pull: Drop static delta superblocks references
Browse files Browse the repository at this point in the history
We don't need them long-lived anymore. They were just used for reporting
at this point, but we can use the new `static_delta_targets` hash table
size for that now.
  • Loading branch information
jlebon committed Sep 11, 2023
1 parent 2fe88f8 commit cd116a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/libostree/ostree-repo-pull-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ typedef struct
GHashTable *signapi_verified_commits; /* Map<checksum,verification> of commits that have been
signapi verified */
GHashTable *ref_keyring_map; /* Maps OstreeCollectionRef to keyring remote name */
GPtrArray *static_delta_superblocks;

GHashTable *static_delta_targets; /* Set<checksum> of commits fetched via static delta */

GHashTable *expected_commit_sizes; /* Maps commit checksum to known size */
Expand Down
6 changes: 1 addition & 5 deletions src/libostree/ostree-repo-pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ update_progress (gpointer user_data)
pull_data->fetched_deltapart_size, "total-delta-part-size", "t",
pull_data->total_deltapart_size, "total-delta-part-usize", "t",
pull_data->total_deltapart_usize, "total-delta-superblocks", "u",
pull_data->static_delta_superblocks->len,
g_hash_table_size (pull_data->static_delta_targets),
/* We fetch metadata before content. These allow us to report metadata fetch progress
specifically. */
"outstanding-metadata-fetches", "u", pull_data->n_outstanding_metadata_fetches,
Expand Down Expand Up @@ -2469,7 +2469,6 @@ on_superblock_fetched (GObject *src, GAsyncResult *res, gpointer data)
delta_superblock = g_variant_ref_sink (g_variant_new_from_bytes (
(GVariantType *)OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT, delta_superblock_data, FALSE));

g_ptr_array_add (pull_data->static_delta_superblocks, g_variant_ref (delta_superblock));
g_hash_table_add (pull_data->static_delta_targets, g_strdup (to_revision));
if (!process_one_static_delta (pull_data, from_revision, to_revision, delta_superblock,
fetch_data->requested_ref, pull_data->cancellable, error))
Expand Down Expand Up @@ -4052,8 +4051,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base
need_summary = TRUE;
}

pull_data->static_delta_superblocks
= g_ptr_array_new_with_free_func ((GDestroyNotify)g_variant_unref);
pull_data->static_delta_targets
= g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify)g_free, NULL);

Expand Down Expand Up @@ -4910,7 +4907,6 @@ ostree_repo_pull_with_options (OstreeRepo *self, const char *remote_name_or_base
g_clear_pointer (&pull_data->summary_data_sig, g_bytes_unref);
g_clear_pointer (&pull_data->summary_sig_etag, g_free);
g_clear_pointer (&pull_data->summary, g_variant_unref);
g_clear_pointer (&pull_data->static_delta_superblocks, g_ptr_array_unref);
g_clear_pointer (&pull_data->static_delta_targets, g_hash_table_unref);
g_clear_pointer (&pull_data->commit_to_depth, g_hash_table_unref);
g_clear_pointer (&pull_data->expected_commit_sizes, g_hash_table_unref);
Expand Down

0 comments on commit cd116a1

Please sign in to comment.