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_OPERATION_METADATA_SET_REQUEST_H
5 #define CEPH_LIBRBD_OPERATION_METADATA_SET_REQUEST_H
7 #include "librbd/operation/Request.h"
8 #include "include/buffer.h"
20 template <typename ImageCtxT = ImageCtx>
21 class MetadataSetRequest : public Request<ImageCtxT> {
23 MetadataSetRequest(ImageCtxT &image_ctx, Context *on_finish,
24 const std::string &key, const std::string &value);
27 void send_op() override;
28 bool should_complete(int r) override;
30 journal::Event create_event(uint64_t op_tid) const override {
31 return journal::MetadataSetEvent(op_tid, m_key, m_value);
37 std::map<std::string, bufferlist> m_data;
39 void send_metadata_set();
42 } // namespace operation
45 extern template class librbd::operation::MetadataSetRequest<librbd::ImageCtx>;
47 #endif // CEPH_LIBRBD_OPERATION_METADATA_SET_REQUEST_H