]>
Commit | Line | Data |
---|---|---|
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 |
9 | SET_SUBSYS(osd); |
10 | ||
20effc67 TL |
11 | namespace crimson::osd { |
12 | ||
13 | IOInterruptCondition::IOInterruptCondition(Ref<PG>& pg) | |
14 | : pg(pg), e(pg->get_osdmap_epoch()) {} | |
15 | ||
16 | IOInterruptCondition::~IOInterruptCondition() { | |
17 | // for the sake of forward declaring PG (which is a detivate of | |
18 | // intrusive_ref_counter<...>) | |
19 | } | |
20 | ||
21 | bool 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 | ||
31 | bool 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 | ||
39 | bool IOInterruptCondition::is_primary() { | |
40 | return pg->is_primary(); | |
41 | } | |
42 | ||
43 | } // namespace crimson::osd |