Thread (45 messages) 45 messages, 3 authors, 2024-11-26
STALE596d
Revisions (2)
  1. v3 current
  2. v4 [diff vs current]

[PATCH v3 3/9] reftable/stack: add accessor for the hash ID

From: Patrick Steinhardt <hidden>
Date: 2024-11-25 07:38:44
Subsystem: the rest · Maintainer: Linus Torvalds

Add an accessor function that allows callers to access the hash ID of a
reftable stack. This function will be used in a subsequent commit.

Signed-off-by: Patrick Steinhardt <redacted>
---
 reftable/reftable-stack.h | 3 +++
 reftable/stack.c          | 5 +++++
 2 files changed, 8 insertions(+)
diff --git a/reftable/reftable-stack.h b/reftable/reftable-stack.h
index 54787f2ef530406a7970db058c3a0cf456897978..ae14270ea74108cd4c314ec38e7d5c9a4e731481 100644
--- a/reftable/reftable-stack.h
+++ b/reftable/reftable-stack.h
@@ -149,4 +149,7 @@ struct reftable_compaction_stats {
 struct reftable_compaction_stats *
 reftable_stack_compaction_stats(struct reftable_stack *st);
 
+/* Return the hash of the stack. */
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st);
+
 #endif
diff --git a/reftable/stack.c b/reftable/stack.c
index 1fffd75630266c0d3d1e4a2d037b5cf90455529d..d97b64a40d4ad05cfd9e6f33e8ba1e713281ef6d 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -1791,3 +1791,8 @@ int reftable_stack_clean(struct reftable_stack *st)
 	reftable_addition_destroy(add);
 	return err;
 }
+
+enum reftable_hash reftable_stack_hash_id(struct reftable_stack *st)
+{
+	return reftable_merged_table_hash_id(st->merged);
+}
-- 
2.47.0.274.g962d0b743d.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help