-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathroot_block.cc
33 lines (29 loc) · 978 Bytes
/
root_block.cc
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
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#include "crimson/os/seastore/root_block.h"
#include "crimson/os/seastore/lba_manager/btree/lba_btree_node.h"
#include "crimson/os/seastore/backref/backref_tree_node.h"
namespace crimson::os::seastore {
void RootBlock::on_replace_prior() {
if (!lba_root_node) {
auto &prior = static_cast<RootBlock&>(*get_prior_instance());
if (prior.lba_root_node) {
RootBlockRef this_ref = this;
link_phy_tree_root_node(
this_ref,
static_cast<lba_manager::btree::LBANode*>(prior.lba_root_node)
);
}
}
if (!backref_root_node) {
auto &prior = static_cast<RootBlock&>(*get_prior_instance());
if (prior.backref_root_node) {
RootBlockRef this_ref = this;
link_phy_tree_root_node(
this_ref,
static_cast<backref::BackrefNode*>(prior.backref_root_node)
);
}
}
}
} // namespace crimson::os::seastore