]> git.proxmox.com Git - ceph.git/blame - ceph/src/crimson/osd/pg_interval_interrupt_condition.cc
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / crimson / osd / pg_interval_interrupt_condition.cc
CommitLineData
20effc67
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#include "pg_interval_interrupt_condition.h"
5#include "pg.h"
6
7#include "crimson/common/log.h"
8
1e59de90
TL
9SET_SUBSYS(osd);
10
20effc67
TL
11namespace crimson::osd {
12
13IOInterruptCondition::IOInterruptCondition(Ref<PG>& pg)
14 : pg(pg), e(pg->get_osdmap_epoch()) {}
15
16IOInterruptCondition::~IOInterruptCondition() {
17 // for the sake of forward declaring PG (which is a detivate of
18 // intrusive_ref_counter<...>)
19}
20
21bool IOInterruptCondition::new_interval_created() {
1e59de90
TL
22 LOG_PREFIX(IOInterruptCondition::new_interval_created);
23 const epoch_t interval_start = pg->get_interval_start_epoch();
24 bool ret = e < interval_start;
25 if (ret) {
26 DEBUGDPP("stored interval e{} < interval_start e{}", *pg, e, interval_start);
27 }
20effc67
TL
28 return ret;
29}
30
31bool IOInterruptCondition::is_stopping() {
1e59de90
TL
32 LOG_PREFIX(IOInterruptCondition::is_stopping);
33 if (pg->stopping) {
34 DEBUGDPP("pg stopping", *pg);
35 }
20effc67
TL
36 return pg->stopping;
37}
38
39bool IOInterruptCondition::is_primary() {
40 return pg->is_primary();
41}
42
43} // namespace crimson::osd