]> git.proxmox.com Git - ceph.git/blob - ceph/src/librbd/deep_copy/Utils.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / librbd / deep_copy / Utils.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "Utils.h"
5
6 namespace librbd {
7 namespace deep_copy {
8 namespace util {
9
10 void compute_snap_map(librados::snap_t snap_id_start,
11 librados::snap_t snap_id_end,
12 const SnapSeqs &snap_seqs,
13 SnapMap *snap_map) {
14 SnapIds snap_ids;
15 for (auto &it : snap_seqs) {
16 snap_ids.insert(snap_ids.begin(), it.second);
17 if (it.first < snap_id_start) {
18 continue;
19 } else if (it.first > snap_id_end) {
20 break;
21 }
22
23 (*snap_map)[it.first] = snap_ids;
24 }
25 }
26
27 } // util
28 } // namespace deep_copy
29 } // namespace librbd