diff options
Diffstat (limited to 'src/compressor/QatAccel.h')
-rw-r--r-- | src/compressor/QatAccel.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/compressor/QatAccel.h b/src/compressor/QatAccel.h new file mode 100644 index 00000000..295b180e --- /dev/null +++ b/src/compressor/QatAccel.h @@ -0,0 +1,35 @@ +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2018 Intel Corporation + * + * Author: Qiaowei Ren <qiaowei.ren@intel.com> + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#ifndef CEPH_QATACCEL_H +#define CEPH_QATACCEL_H + +#include <qatzip.h> +#include "include/buffer.h" + +class QatAccel { + QzSession_T session; + + public: + QatAccel() : session({0}) {} + ~QatAccel(); + + bool init(const std::string &alg); + + int compress(const bufferlist &in, bufferlist &out); + int decompress(const bufferlist &in, bufferlist &out); + int decompress(bufferlist::const_iterator &p, size_t compressed_len, bufferlist &dst); +}; + +#endif |