Commit cdf82174 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b7d7b8d4
......@@ -57,6 +57,10 @@ typedef uint64_t Oid; // XXX ok?
// TidHead is invalid Tid which is larged Tid value and means @head
const Tid TidHead = -1ULL;
string h(uint64_t v); // v -> 016x hex representation
#define h_(v) (h(v).c_str())
// XXX ok?
struct IContext {
virtual chan<structZ> done() = 0;
......@@ -250,7 +254,7 @@ error _Mapping::_remmapblk(int64_t blk, Tid at) {
else {
// TODO share @rev fd until wconn is resynced?
tie(fsfile, err) = f->wconn->_wc->_open(
fmt::sprintf("@%s/bigfile/%s", h(at), h(f->foid), "rb");
fmt::sprintf("@%s/bigfile/%s", h_(at), h_(f->foid)), "rb");
if (err != nil)
return err;
defer(fsfile.close);
......@@ -290,3 +294,10 @@ tuple<os::File, error> WCFS::_open(const string &path/*, XXX mode*/) {
string path_ = wc->_path(path);
return os::open(path_/*, XXX mode*/);
}
// ---- misc ----
string h(uint64_t v) {
return fmt::sprintf("%016x", v);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment