0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 19:28:52 +02:00

ircd::db: Use our fs::size() for file sizing env callback.

This commit is contained in:
Jason Volk 2018-08-23 04:20:42 -07:00
parent 29d4ec71d5
commit bbcddbcf5b

View file

@ -2106,17 +2106,30 @@ noexcept
}
rocksdb::Status
ircd::db::database::env::GetFileSize(const std::string& name,
uint64_t* s)
noexcept
ircd::db::database::env::GetFileSize(const std::string &name,
uint64_t *const s)
noexcept try
{
#ifdef RB_DEBUG_DB_ENV
log.debug("'%s': get file size '%s'",
d.name,
name);
log::debug
{
log, "'%s': get file size '%s'",
d.name,
name
};
#endif
return defaults.GetFileSize(name, s);
assert(s);
*s = fs::size(name);
return Status::OK();
}
catch(const fs::error &e)
{
return error_to_status{e};
}
catch(const std::exception &e)
{
return error_to_status{e};
}
rocksdb::Status