deltas: Rework format to allow streaming

There's still some silliness here, but there is now only one opcode
open-splice-and-close, that writes a single chunk from the payload.
This is really all we need for metadata, and small content objects are
also fine with this.

We get some deduplication between content objects by creating a
dictionary for (uid,gid,mode) tuples and xattrs.

This still keeps the operation/payload code in, so we could do
rollsums in a future update easily.
This commit is contained in:
Colin Walters committed 2015-02-16 10:10:35 -05:00
1 parent 513d47a90c
commit d749932f6b
3 files changed
+366 -229

No files matched your search

@@ -34,10 +34,12 @@ G_BEGIN_DECLS
*
* y compression type (0: none, 'x': lzma)
* ---
* ay data source
* a(uuu) modes
* aa(ayay) xattrs
* ay raw data source
* ay operations
*/
#define OSTREE_STATIC_DELTA_PART_PAYLOAD_FORMAT_V0 "(ayay)"
#define OSTREE_STATIC_DELTA_PART_PAYLOAD_FORMAT_V0 "(a(uuu)aa(ayay)ayay)"
/**
* OSTREE_STATIC_DELTA_META_ENTRY_FORMAT:
@@ -130,9 +132,10 @@ gboolean _ostree_static_delta_part_execute_finish (OstreeRepo *repo,
GError **error);
typedef enum {
OSTREE_STATIC_DELTA_OP_WRITE = 1,
OSTREE_STATIC_DELTA_OP_GUNZIP = 2,
OSTREE_STATIC_DELTA_OP_CLOSE = 3
OSTREE_STATIC_DELTA_OP_OPEN_SPLICE_AND_CLOSE = 'S',
OSTREE_STATIC_DELTA_OP_OPEN = 'o',
OSTREE_STATIC_DELTA_OP_WRITE = 'w',
OSTREE_STATIC_DELTA_OP_CLOSE = 'c'
} OstreeStaticDeltaOpCode;
gboolean