Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / journal / 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 "journal/Utils.h"
5 #include "include/Context.h"
6 #include "include/stringify.h"
7
8 namespace journal {
9 namespace utils {
10
11 std::string get_object_name(const std::string &prefix, uint64_t number) {
12   return prefix + stringify(number);
13 }
14
15 std::string unique_lock_name(const std::string &name, void *address) {
16   return name + " (" + stringify(address) + ")";
17 }
18
19 void rados_ctx_callback(rados_completion_t c, void *arg) {
20   Context *comp = reinterpret_cast<Context *>(arg);
21   comp->complete(rados_aio_get_return_value(c));
22 }
23
24 } // namespace utils
25 } // namespace journal