in = diri;
pdn = in->get_parent_dn();
}
+ bt.old_pools.reserve(get_inode()->old_pools.size());
for (auto &p : get_inode()->old_pools) {
// don't add our own pool id to old_pools to avoid looping (e.g. setlayout 0, 1, 0)
if (p != pool)
- bt.old_pools.insert(p);
+ bt.old_pools.push_back(p);
}
}
inodeno_t ino = 0;
uint64_t size = 0;
file_layout_t layout;
- compact_set<int64_t> old_pools;
+ std::vector<int64_t> old_pools;
SnapContext snapc;
fragtree_t fragtree;
private:
item.size = to;
item.layout = pi->layout;
- item.old_pools.clear();
- for (const auto &p : pi->old_pools)
- item.old_pools.insert(p);
+ item.old_pools.reserve(pi->old_pools.size());
+ for (const auto &p : pi->old_pools) {
+ if (p != pi->layout.pool_id)
+ item.old_pools.push_back(p);
+ }
item.snapc = *snapc;
}
ls.back()->ancestors.back().dname = "bar";
ls.back()->ancestors.back().version = 456;
ls.back()->pool = 0;
- ls.back()->old_pools.insert(10);
- ls.back()->old_pools.insert(7);
+ ls.back()->old_pools.push_back(10);
+ ls.back()->old_pools.push_back(7);
}
int inode_backtrace_t::compare(const inode_backtrace_t& other,
inodeno_t ino; // my ino
std::vector<inode_backpointer_t> ancestors;
int64_t pool = -1;
- // we use a set for old_pools to avoid duplicate entries, e.g. setlayout 0, 1, 0
- std::set<int64_t> old_pools;
+ std::vector<int64_t> old_pools;
};
WRITE_CLASS_ENCODER(inode_backtrace_t)
foo.ino = 1234;
foo.pool = 12;
- foo.old_pools.insert(10);
- foo.old_pools.insert(5);
+ foo.old_pools.push_back(10);
+ foo.old_pools.push_back(5);
inode_backpointer_t foop;
foop.dirino = 3;
foo.ino = 1234;
foo.pool = 12;
- foo.old_pools.insert(10);
- foo.old_pools.insert(5);
+ foo.old_pools.push_back(10);
+ foo.old_pools.push_back(5);
bar.ino = 1234;
bar.pool = 12;
- bar.old_pools.insert(10);
+ bar.old_pools.push_back(10);
inode_backpointer_t foop;
foop.dirino = 3;
foo.ino = 1234;
foo.pool = 12;
- foo.old_pools.insert(10);
- foo.old_pools.insert(5);
+ foo.old_pools.push_back(10);
+ foo.old_pools.push_back(5);
bar.ino = 1234;
bar.pool = 12;
- bar.old_pools.insert(10);
+ bar.old_pools.push_back(10);
inode_backpointer_t foop;
foop.dirino = 3;