]> git.proxmox.com Git - ceph.git/blob - ceph/src/common/FixedCDC.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / FixedCDC.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma once
5
6 #include "CDC.h"
7
8 class FixedCDC : public CDC {
9 private:
10 size_t chunk_size;
11
12 public:
13 FixedCDC(int target = 18, int window_bits = 0) {
14 set_target_bits(target, window_bits);
15 };
16
17 void set_target_bits(int target, int window_bits) override {
18 chunk_size = 1ul << target;
19 }
20 void calc_chunks(
21 const bufferlist& bl,
22 std::vector<std::pair<uint64_t, uint64_t>> *chunks) const override;
23 };