Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / osd / RadosModel.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 // vim: ts=8 sw=2 smarttab
3 #include "include/interval_set.h"
4 #include "include/buffer.h"
5 #include <list>
6 #include <map>
7 #include <set>
8 #include "include/rados/librados.h"
9 #include "RadosModel.h"
10 #include "TestOpStat.h"
11
12
13 void TestOp::begin()
14 {
15   _begin();
16 }
17
18 void TestOp::finish(TestOp::CallbackInfo *info)
19 {
20   _finish(info);
21 }
22
23 void read_callback(librados::completion_t comp, void *arg) {
24   TestOp* op = static_cast<TestOp*>(arg);
25   op->finish(NULL);
26 }
27
28 void write_callback(librados::completion_t comp, void *arg) {
29   std::pair<TestOp*, TestOp::CallbackInfo*> *args =
30     static_cast<std::pair<TestOp*, TestOp::CallbackInfo*> *>(arg);
31   TestOp* op = args->first;
32   TestOp::CallbackInfo *info = args->second;
33   op->finish(info);
34   delete args;
35   delete info;
36 }