~akopytov/percona-xtrabackup/bug1168513

« back to all changes in this revision

Viewing changes to src/ds_compress.c

MergedĀ lp:~gl-az/percona-xtrabackup/BT-23557-2.1-encrypted_stream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "common.h"
26
26
#include "datasink.h"
27
27
 
28
 
#define COMPRESS_CHUNK_SIZE (64 * 1024UL)
 
28
#define COMPRESS_CHUNK_SIZE ((size_t) (xtrabackup_compress_chunk_size))
29
29
#define MY_QLZ_COMPRESS_OVERHEAD 400
30
30
 
31
31
typedef struct {
57
57
        size_t                  bytes_processed;
58
58
} ds_compress_file_t;
59
59
 
60
 
extern uint     xtrabackup_compress_threads;
 
60
/* Compression options */
 
61
extern char             *xtrabackup_compress_alg;
 
62
extern uint             xtrabackup_compress_threads;
 
63
extern ulonglong        xtrabackup_compress_chunk_size;
61
64
 
62
65
static ds_ctxt_t *compress_init(const char *root);
63
66
static ds_file_t *compress_open(ds_ctxt_t *ctxt, const char *path,
122
125
        ds_file_t               *file;
123
126
        ds_compress_file_t      *comp_file;
124
127
 
125
 
        xb_a(ctxt->pipe_ctxt != NULL);
 
128
        xb_ad(ctxt->pipe_ctxt != NULL);
126
129
        dest_ctxt = ctxt->pipe_ctxt;
127
130
 
128
131
        comp_ctxt = (ds_compress_ctxt_t *) ctxt->ptr;
294
297
{
295
298
        ds_compress_ctxt_t      *comp_ctxt;
296
299
 
297
 
        xb_a(ctxt->pipe_ctxt != NULL);
 
300
        xb_ad(ctxt->pipe_ctxt != NULL);
298
301
 
299
302
        comp_ctxt = (ds_compress_ctxt_t *) ctxt->ptr;;
300
303
 
301
304
        destroy_worker_threads(comp_ctxt->threads, comp_ctxt->nthreads);
302
305
 
303
 
        ds_destroy(ctxt->pipe_ctxt);
304
 
 
305
306
        MY_FREE(ctxt->root);
306
307
        MY_FREE(ctxt);
307
308
}