From cc685506700dffafc8ccc49ddb279e22ea48f0cb Mon Sep 17 00:00:00 2001 From: Moinak Ghosh Date: Sat, 25 Oct 2014 22:57:31 +0530 Subject: [PATCH] Add metadata stream flag for archive. Change flag bit to not collide with checksum id. Handle '-T' option properly. --- archive/pc_archive.c | 2 +- pcompress.c | 3 +++ pcompress.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/archive/pc_archive.c b/archive/pc_archive.c index 21cb58a..57644e8 100644 --- a/archive/pc_archive.c +++ b/archive/pc_archive.c @@ -304,7 +304,7 @@ extract_read_callback(struct archive *arc, void *ctx, const void **buf) if (archive_request_is_metadata(arc) && pctx->meta_stream) { int rv; size_t len; - + /* * Send the buf pointer over to the metadata thread. */ diff --git a/pcompress.c b/pcompress.c index 9ab84f9..44ea705 100644 --- a/pcompress.c +++ b/pcompress.c @@ -2522,6 +2522,8 @@ start_compress(pc_ctx_t *pctx, const char *filename, uint64_t chunksize, int lev COMP_BAIL; } flags |= FLAG_ARCHIVE; + if (pctx->meta_stream) + flags |= FLAG_META_STREAM; } /* @@ -3244,6 +3246,7 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[]) case 'T': pctx->meta_stream = -1; + break; case '?': default: diff --git a/pcompress.h b/pcompress.h index c4683e1..6c5eb4f 100644 --- a/pcompress.h +++ b/pcompress.h @@ -45,7 +45,7 @@ extern "C" { #define FLAG_DEDUP 1 #define FLAG_DEDUP_FIXED 2 #define FLAG_SINGLE_CHUNK 4 -#define FLAG_META_STREAM 256 +#define FLAG_META_STREAM 4096 #define FLAG_ARCHIVE 2048 #define UTILITY_VERSION "3.1" #define MASK_CRYPTO_ALG 0x30