1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_LIBRBD_JOURNAL_UTILS_H
5 #define CEPH_LIBRBD_JOURNAL_UTILS_H
7 #include "include/int_types.h"
8 #include "include/Context.h"
9 #include "cls/journal/cls_journal_types.h"
22 struct C_DecodeTag : public Context {
29 cls::journal::Tag tag;
31 C_DecodeTag(CephContext *cct, Mutex *lock, uint64_t *tag_tid,
32 TagData *tag_data, Context *on_finish)
33 : cct(cct), lock(lock), tag_tid(tag_tid), tag_data(tag_data),
34 on_finish(on_finish) {
37 void complete(int r) override {
38 on_finish->complete(process(r));
41 void finish(int r) override {
46 static int decode(bufferlist::iterator *it, TagData *tag_data);
50 struct C_DecodeTags : public Context {
51 typedef std::list<cls::journal::Tag> Tags;
61 C_DecodeTags(CephContext *cct, Mutex *lock, uint64_t *tag_tid,
62 TagData *tag_data, Context *on_finish)
63 : cct(cct), lock(lock), tag_tid(tag_tid), tag_data(tag_data),
64 on_finish(on_finish) {
67 void complete(int r) override {
68 on_finish->complete(process(r));
71 void finish(int r) override {
78 } // namespace journal
81 #endif // CEPH_LIBRBD_JOURNAL_UTILS_H