summaryrefslogtreecommitdiffstats
path: root/src/test/crimson/seastore/test_block.cc
blob: f3d6531bd92d93825adb39caa838333f97cc4a62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#include "test/crimson/seastore/test_block.h"

namespace crimson::os::seastore {


ceph::bufferlist TestBlock::get_delta() {
  ceph::bufferlist bl;
  encode(delta, bl);
  return bl;
}


void TestBlock::apply_delta(const ceph::bufferlist &bl) {
  auto biter = bl.begin();
  decltype(delta) deltas;
  decode(deltas, biter);
  for (auto &&d : deltas) {
    set_contents(d.val, d.offset, d.len);
  }
}

}