summaryrefslogtreecommitdiffstats
path: root/src/crimson/osd/pg_activation_blocker.h
blob: fff8219d11354552ade0ac1c19ed2398f5aa11e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 smarttab expandtab

#pragma once

#include <seastar/core/future.hh>
#include <seastar/core/shared_future.hh>

#include "crimson/common/operation.h"
#include "crimson/osd/osd_operation.h"

namespace crimson::osd {

class PG;

class PGActivationBlocker : public crimson::BlockerT<PGActivationBlocker> {
  PG *pg;

  const spg_t pgid;
  seastar::shared_promise<> p;

protected:
  void dump_detail(Formatter *f) const;

public:
  static constexpr const char *type_name = "PGActivationBlocker";
  using Blocker = PGActivationBlocker;

  PGActivationBlocker(PG *pg) : pg(pg) {}
  void unblock();
  seastar::future<> wait(PGActivationBlocker::BlockingEvent::TriggerI&&);
  seastar::future<> stop();
};

} // namespace crimson::osd