[thinp_*] Make mtree_ref_counter derive from ref_counter.
Slight performance hit, but I'd rather everything was derived from ref_counter. Also implement it! Not sure why this wasn't done before.
This commit is contained in:
parent
ed22bfcdda
commit
0098803345
@ -70,13 +70,21 @@ namespace thin_provisioning {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mtree_ref_counter::inc(block_address b)
|
mtree_ref_counter::set(block_address const &b, uint32_t rc)
|
||||||
{
|
{
|
||||||
|
tm_.get_sm()->set_count(b, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mtree_ref_counter::dec(block_address b)
|
mtree_ref_counter::inc(block_address const &b)
|
||||||
{
|
{
|
||||||
|
tm_.get_sm()->inc(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
mtree_ref_counter::dec(block_address const &b)
|
||||||
|
{
|
||||||
|
tm_.get_sm()->dec(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------
|
//--------------------------------
|
||||||
|
@ -43,12 +43,13 @@ namespace thin_provisioning {
|
|||||||
static void pack(value_type const &value, disk_type &disk);
|
static void pack(value_type const &value, disk_type &disk);
|
||||||
};
|
};
|
||||||
|
|
||||||
class mtree_ref_counter {
|
class mtree_ref_counter final : public ref_counter<block_address> {
|
||||||
public:
|
public:
|
||||||
mtree_ref_counter(transaction_manager &tm);
|
mtree_ref_counter(transaction_manager &tm);
|
||||||
|
|
||||||
void inc(block_address b);
|
void set(block_address const &b, uint32_t rc);
|
||||||
void dec(block_address b);
|
void inc(block_address const &b);
|
||||||
|
void dec(block_address const &b);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
transaction_manager &tm_;
|
transaction_manager &tm_;
|
||||||
|
Loading…
Reference in New Issue
Block a user