]> git.proxmox.com Git - ceph.git/blob - ceph/src/common/FixedCDC.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / FixedCDC.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #pragma
5
6 #include "FixedCDC.h"
7
8 void FixedCDC::calc_chunks(
9 const bufferlist& bl,
10 std::vector<std::pair<uint64_t, uint64_t>> *chunks) const
11 {
12 size_t len = bl.length();
13 if (!len) {
14 return;
15 }
16 for (size_t pos = 0; pos < len; pos += chunk_size) {
17 chunks->push_back(std::pair<uint64_t,uint64_t>(pos, std::min(chunk_size,
18 len - pos)));
19 }
20 }