Commit 8b5e9340 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 81605d48
......@@ -28,6 +28,9 @@ using namespace golang;
template<typename Key, typename Value>
using dict = std::unordered_map<Key, Value>;
#include <vector>
using std::vector;
#include <stdint.h>
typedef uint64_t Tid; // XXX ok?
......@@ -40,6 +43,7 @@ struct IContext {
struct Conn;
struct _File;
struct _Mapping;
struct WatchLink;
struct SrvReq;
......@@ -72,10 +76,21 @@ private:
//
// XXX doc
struct _File {
// XXX
Conn *wconn;
Oid foid; // hex of ZBigFile root object ID
// .blksize block size of this file
// .headf file object of head/file
// .headfsize head/file size is known to be at least headfsize (size ↑=)
dict<int64_t, Tid> pinned; // {} blk -> rev that wcfs already sent us for this file
vector<_Mapping*> mmaps; // []_Mapping ↑blk_start mappings of this file
};
// XXX struct Mapping
// _Mapping represents one mapping of _File.
struct _Mapping {
_File *file;
int blk_start; // offset of this mapping in file
// .mem mmaped memory
};
// XXX struct WatchLink
......@@ -150,5 +165,7 @@ void Conn::_pin1(SrvReq *req) {
_File *f = _->second;
// XXX relock wconn -> f ?
wconn->_filemu.unlock();
}
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