1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #include "librbd/journal/StandardPolicy.h"
5 #include "common/WorkQueue.h"
6 #include "librbd/ImageCtx.h"
7 #include "librbd/Journal.h"
9 #define dout_subsys ceph_subsys_rbd
11 #define dout_prefix *_dout << "librbd::journal::StandardPolicy: "
17 void StandardPolicy<I>::allocate_tag_on_lock(Context *on_finish) {
18 assert(m_image_ctx->journal != nullptr);
20 if (!m_image_ctx->journal->is_tag_owner()) {
21 lderr(m_image_ctx->cct) << "local image not promoted" << dendl;
22 m_image_ctx->op_work_queue->queue(on_finish, -EPERM);
26 m_image_ctx->journal->allocate_local_tag(on_finish);
29 } // namespace journal
32 template class librbd::journal::StandardPolicy<librbd::ImageCtx>;