[ostree/wip/delta2] wip/delta: Remove fetch opcode, add fallback array to superblock
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree/wip/delta2] wip/delta: Remove fetch opcode, add fallback array to superblock
- Date: Sat, 19 Apr 2014 22:02:27 +0000 (UTC)
commit 02855f6664d4888dbd505861b996bc95ad18229c
Author: Colin Walters <walters verbum org>
Date: Sat Apr 19 18:02:19 2014 -0400
wip/delta: Remove fetch opcode, add fallback array to superblock
src/libostree/ostree-repo-static-delta-private.h | 33 +++++++++++++++----
.../ostree-repo-static-delta-processing.c | 13 --------
2 files changed, 26 insertions(+), 20 deletions(-)
---
diff --git a/src/libostree/ostree-repo-static-delta-private.h
b/src/libostree/ostree-repo-static-delta-private.h
index facc25b..3329b3e 100644
--- a/src/libostree/ostree-repo-static-delta-private.h
+++ b/src/libostree/ostree-repo-static-delta-private.h
@@ -53,6 +53,19 @@ G_BEGIN_DECLS
#define OSTREE_STATIC_DELTA_META_ENTRY_FORMAT "(ayttay)"
+
+/**
+ * OSTREE_STATIC_DELTA_FALLBACK_FORMAT:
+ *
+ * y: objtype
+ * ay: checksum
+ * t: compressed size
+ * t: uncompressed size
+ *
+ * Object to fetch invididually; includes compressed/uncompressed size.
+ */
+#define OSTREE_STATIC_DELTA_FALLBACK_FORMAT "(yaytt)"
+
/**
* OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT:
*
@@ -64,6 +77,7 @@ G_BEGIN_DECLS
* timestamp: guint64
* ARRAY[(csum from, csum to)]: ay
* ARRAY[delta-meta-entry]
+ * array[fallback]
*
* The metadata would include things like a version number, as well as
* extended verification data like a GPG signature.
@@ -72,8 +86,14 @@ G_BEGIN_DECLS
* fetched and applied before this one. This is a fairly generic
* recursion mechanism that would potentially allow saving significant
* storage space on the server.
+ *
+ * The heart of the static delta: the array of delta parts.
+ *
+ * Finally, we have the fallback array, which is the set of objects to
+ * fetch individually - the compiler determined it wasn't worth
+ * duplicating the space.
*/
-#define OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT "(a{sv}taya" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT ")"
+#define OSTREE_STATIC_DELTA_SUPERBLOCK_FORMAT "(a{sv}taya" OSTREE_STATIC_DELTA_META_ENTRY_FORMAT "a"
OSTREE_STATIC_DELTA_FALLBACK_FORMAT ")"
gboolean _ostree_static_delta_part_validate (OstreeRepo *repo,
GFile *part_path,
@@ -106,12 +126,11 @@ gboolean _ostree_static_delta_part_execute_finish (OstreeRepo *repo,
GError **error);
typedef enum {
- OSTREE_STATIC_DELTA_OP_FETCH = 1,
- OSTREE_STATIC_DELTA_OP_WRITE = 2,
- OSTREE_STATIC_DELTA_OP_GUNZIP = 3,
- OSTREE_STATIC_DELTA_OP_CLOSE = 4,
- OSTREE_STATIC_DELTA_OP_READOBJECT = 5,
- OSTREE_STATIC_DELTA_OP_READPAYLOAD = 6
+ OSTREE_STATIC_DELTA_OP_WRITE = 1,
+ OSTREE_STATIC_DELTA_OP_GUNZIP = 2,
+ OSTREE_STATIC_DELTA_OP_CLOSE = 3,
+ OSTREE_STATIC_DELTA_OP_READOBJECT = 4,
+ OSTREE_STATIC_DELTA_OP_READPAYLOAD = 5
} OstreeStaticDeltaOpCode;
gboolean
diff --git a/src/libostree/ostree-repo-static-delta-processing.c
b/src/libostree/ostree-repo-static-delta-processing.c
index 3c5eec6..01dbd1b 100644
--- a/src/libostree/ostree-repo-static-delta-processing.c
+++ b/src/libostree/ostree-repo-static-delta-processing.c
@@ -64,14 +64,12 @@ typedef struct {
GCancellable *cancellable, \
GError **error);
-OPPROTO(fetch)
OPPROTO(write)
OPPROTO(gunzip)
OPPROTO(close)
#undef OPPROTO
static OstreeStaticDeltaOperation op_dispatch_table[] = {
- { "fetch", dispatch_fetch },
{ "write", dispatch_write },
{ "gunzip", dispatch_gunzip },
{ "close", dispatch_close },
@@ -365,17 +363,6 @@ _ostree_static_delta_part_execute_finish (OstreeRepo *repo,
}
static gboolean
-dispatch_fetch (OstreeRepo *repo,
- StaticDeltaExecutionState *state,
- GCancellable *cancellable,
- GError **error)
-{
- g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- "Static delta fetch opcode is not implemented in this version");
- return FALSE;
-}
-
-static gboolean
read_varuint64 (StaticDeltaExecutionState *state,
guint64 *out_value,
GError **error)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]