]> git.proxmox.com Git - ceph.git/blob - ceph/src/compressor/QatAccel.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / compressor / QatAccel.h
1 /*
2 * Ceph - scalable distributed file system
3 *
4 * Copyright (C) 2018 Intel Corporation
5 *
6 * Author: Qiaowei Ren <qiaowei.ren@intel.com>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15 #ifndef CEPH_QATACCEL_H
16 #define CEPH_QATACCEL_H
17
18 #include <qatzip.h>
19 #include <boost/optional.hpp>
20 #include "include/buffer.h"
21
22 class QatAccel {
23 QzSession_T session;
24
25 public:
26 QatAccel() : session({0}) {}
27 ~QatAccel();
28
29 bool init(const std::string &alg);
30
31 int compress(const bufferlist &in, bufferlist &out, boost::optional<int32_t> &compressor_message);
32 int decompress(const bufferlist &in, bufferlist &out, boost::optional<int32_t> compressor_message);
33 int decompress(bufferlist::const_iterator &p, size_t compressed_len, bufferlist &dst, boost::optional<int32_t> compressor_message);
34 };
35
36 #endif