Signed-off-by: Sage Weil <sage@redhat.com>
alloc[id]->release(to_release);
}
-uint64_t BlueFS::get_fs_usage()
+uint64_t BlueFS::get_used()
{
std::lock_guard<std::mutex> l(lock);
- uint64_t total_bytes = 0;
- for (auto& p : file_map) {
- total_bytes += p.second->fnode.get_allocated();
+ uint64_t used = 0;
+ for (unsigned id = 0; id < MAX_BDEV; ++id) {
+ if (alloc[id]) {
+ used += block_all[id].size() - alloc[id]->get_free();
+ }
}
- return total_bytes;
+ return used;
}
uint64_t BlueFS::get_total(unsigned id)
void get_devices(set<string> *ls);
int fsck();
- uint64_t get_fs_usage();
+ uint64_t get_used();
uint64_t get_total(unsigned id);
uint64_t get_free(unsigned id);
void get_usage(vector<pair<uint64_t,uint64_t>> *usage); // [<free,total> ...]