summaryrefslogtreecommitdiffstats
path: root/src/crimson/os/seastore/onode_manager/staged-fltree/super.cc
blob: 5a28f5097c2a44892d3be00b4cad7e59d018a9a2 (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
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 smarttab

#include "super.h"
#include "node.h"

namespace crimson::os::seastore::onode {

Ref<Node> RootNodeTrackerIsolated::get_root(Transaction& t) const {
  auto iter = tracked_supers.find(&t);
  if (iter == tracked_supers.end()) {
    return nullptr;
  } else {
    return iter->second->get_p_root();
  }
}

Ref<Node> RootNodeTrackerShared::get_root(Transaction&) const {
  if (is_clean()) {
    return nullptr;
  } else {
    return tracked_super->get_p_root();
  }
}

}