Merge pull request #134 from Arusekk/issue-12

Fix compilation with uClibc
This commit is contained in:
Joe Thornber 2020-03-25 15:00:28 +00:00 committed by GitHub
commit ed44a1128f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 18 deletions

View File

@ -24,12 +24,12 @@ command::die(string const &msg)
exit(1); exit(1);
} }
uint64_t ::uint64_t
command::parse_uint64(string const &str, string const &desc) command::parse_uint64(string const &str, string const &desc)
{ {
try { try {
// FIXME: check trailing garbage is handled // FIXME: check trailing garbage is handled
return lexical_cast<uint64_t>(str); return lexical_cast<::uint64_t>(str);
} catch (...) { } catch (...) {
ostringstream out; ostringstream out;

View File

@ -193,10 +193,10 @@ namespace {
if (call_count++ % 128) if (call_count++ % 128)
return; return;
uint64_t scanned = stats_.blocks_scanned * 100 / cache_blocks_; ::uint64_t scanned = stats_.blocks_scanned * 100 / cache_blocks_;
uint64_t copied = safe_div<block_address>(stats_.blocks_completed * 100, ::uint64_t copied = safe_div<block_address>(stats_.blocks_completed * 100,
stats_.blocks_needed, 100ull); stats_.blocks_needed, 100ull);
uint64_t percent = min<uint64_t>(scanned, copied); ::uint64_t percent = min<::uint64_t>(scanned, copied);
monitor_.update_percent(percent); monitor_.update_percent(percent);
} }

View File

@ -232,8 +232,8 @@ namespace {
block_address b; block_address b;
unsigned values; unsigned values;
uint64_t key_low; ::uint64_t key_low;
uint64_t key_high; ::uint64_t key_high;
//set<uint32_t> devices; //set<uint32_t> devices;
uint32_t age; uint32_t age;
map<uint32_t, uint32_t> time_counts; map<uint32_t, uint32_t> time_counts;
@ -477,7 +477,7 @@ namespace {
// values refer to blocks, so we should have infos for them. // values refer to blocks, so we should have infos for them.
auto n = to_node<block_traits>(rr); auto n = to_node<block_traits>(rr);
uint64_t key_low = 0; ::uint64_t key_low = 0;
unsigned values = 0; unsigned values = 0;
for (unsigned i = 0; i < n.get_nr_entries(); i++) { for (unsigned i = 0; i < n.get_nr_entries(); i++) {
@ -541,7 +541,7 @@ namespace {
info.nr_mappings += n.value_at(i).mapped_blocks_; info.nr_mappings += n.value_at(i).mapped_blocks_;
} }
} else if (vsize == sizeof(uint64_t)) { } else if (vsize == sizeof(::uint64_t)) {
auto n = to_node<uint64_traits>(rr); auto n = to_node<uint64_traits>(rr);
if (n.get_nr_entries()) { if (n.get_nr_entries()) {
@ -658,7 +658,7 @@ namespace {
} }
private: private:
void start_mapping(uint64_t origin_block, block_time const &bt) { void start_mapping(::uint64_t origin_block, block_time const &bt) {
origin_start_ = origin_block; origin_start_ = origin_block;
dest_start_ = bt.block_; dest_start_ = bt.block_;
time_ = bt.time_; time_ = bt.time_;
@ -677,7 +677,7 @@ namespace {
} }
} }
void add_mapping(uint64_t origin_block, block_time const &bt) { void add_mapping(::uint64_t origin_block, block_time const &bt) {
if (!in_range_) if (!in_range_)
start_mapping(origin_block, bt); start_mapping(origin_block, bt);
@ -748,7 +748,7 @@ namespace {
} }
private: private:
void emit_mappings(uint64_t dev_id, block_address subtree_root) { void emit_mappings(::uint64_t dev_id, block_address subtree_root) {
mapping_emit_visitor me(e_); mapping_emit_visitor me(e_);
// Since we're not mutating the btrees we don't need a real space map // Since we're not mutating the btrees we don't need a real space map
@ -918,7 +918,7 @@ thin_provisioning::metadata_repair(block_manager<>::ptr bm, emitter::ptr e, over
//---------------------------------------------------------------- //----------------------------------------------------------------
void void
thin_provisioning::metadata_dump_subtree(metadata::ptr md, emitter::ptr e, bool repair, uint64_t subtree_root) { thin_provisioning::metadata_dump_subtree(metadata::ptr md, emitter::ptr e, bool repair, ::uint64_t subtree_root) {
mapping_emit_visitor me(e); mapping_emit_visitor me(e);
single_mapping_tree tree(*md->tm_, subtree_root, single_mapping_tree tree(*md->tm_, subtree_root,
mapping_tree_detail::block_time_ref_counter(md->data_sm_)); mapping_tree_detail::block_time_ref_counter(md->data_sm_));

View File

@ -145,7 +145,7 @@ thin_dump_cmd::run(int argc, char **argv)
const char shortopts[] = "hm::o:f:rV"; const char shortopts[] = "hm::o:f:rV";
char *end_ptr; char *end_ptr;
block_address metadata_snap = 0; block_address metadata_snap = 0;
uint64_t dev_id; ::uint64_t dev_id;
struct flags flags; struct flags flags;
const struct option longopts[] = { const struct option longopts[] = {

View File

@ -236,9 +236,9 @@ namespace {
} }
}; };
void pass1(metadata::ptr md, mapping_set &mappings, uint64_t dev_id) { void pass1(metadata::ptr md, mapping_set &mappings, ::uint64_t dev_id) {
dev_tree::key k = {dev_id}; dev_tree::key k = {dev_id};
optional<uint64_t> dev_root = md->mappings_top_level_->lookup(k); optional<::uint64_t> dev_root = md->mappings_top_level_->lookup(k);
if (!dev_root) if (!dev_root)
throw runtime_error("couldn't find mapping tree root"); throw runtime_error("couldn't find mapping tree root");
@ -252,9 +252,9 @@ namespace {
} }
block_address count_exclusives(metadata::ptr md, mapping_set const &mappings, uint64_t dev_id) { block_address count_exclusives(metadata::ptr md, mapping_set const &mappings, ::uint64_t dev_id) {
dev_tree::key k = {dev_id}; dev_tree::key k = {dev_id};
optional<uint64_t> dev_root = md->mappings_top_level_->lookup(k); optional<::uint64_t> dev_root = md->mappings_top_level_->lookup(k);
if (!dev_root) if (!dev_root)
throw runtime_error("couldn't find mapping tree root"); throw runtime_error("couldn't find mapping tree root");