]>
git.proxmox.com Git - ceph.git/blob - ceph/src/compressor/QatAccel.h
2 * Ceph - scalable distributed file system
4 * Copyright (C) 2018 Intel Corporation
6 * Author: Qiaowei Ren <qiaowei.ren@intel.com>
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.
15 #ifndef CEPH_QATACCEL_H
16 #define CEPH_QATACCEL_H
18 #include <condition_variable>
24 #include "include/buffer.h"
26 extern "C" struct QzSession_S
; // typedef struct QzSession_S QzSession_T;
28 struct QzSessionDeleter
{
29 void operator() (struct QzSession_S
*session
);
34 using session_ptr
= std::unique_ptr
<struct QzSession_S
, QzSessionDeleter
>;
38 bool init(const std::string
&alg
);
40 int compress(const bufferlist
&in
, bufferlist
&out
, std::optional
<int32_t> &compressor_message
);
41 int decompress(const bufferlist
&in
, bufferlist
&out
, std::optional
<int32_t> compressor_message
);
42 int decompress(bufferlist::const_iterator
&p
, size_t compressed_len
, bufferlist
&dst
, std::optional
<int32_t> compressor_message
);
45 // get a session from the pool or create a new one. returns null if session init fails
46 session_ptr
get_session();
48 friend struct cached_session_t
;
49 std::vector
<session_ptr
> sessions
;