Commit c4013452 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 115ee9b1
......@@ -31,16 +31,26 @@ using dict = std::unordered_map<Key, Value>;
#include <stdint.h>
typedef uint64_t Tid; // XXX ok?
typedef uint64_t Oid; // XXX ok?
// XXX ok?
struct IContext {
virtual chan<structZ> done() = 0;
};
struct Conn;
struct _File;
// WCFS represents filesystem-level connection to wcfs server.
// XXX doc
struct WCFS {
Conn *connect(Tid at);
};
// Conn represents logical connection that provides view of data on wcfs
// filesystem as of particular database state.
//
// XXX doc
struct Conn {
WCFS *_wc;
......@@ -48,9 +58,15 @@ struct Conn {
// _wlink
sync::Mutex _filemu;
dict<Tid, _File*> _filetab; // {} foid -> _file
dict<Oid, _File*> _filetab; // {} foid -> _file
private:
void _pinner(IContext *ctx);
};
// _File represent isolated file view under Conn.
//
// XXX doc
struct _File {
// XXX
......@@ -59,6 +75,7 @@ struct _File {
// XXX struct Mapping
// connect creates new Conn viewing WCFS state as of @at.
Conn *WCFS::connect(Tid at) {
WCFS *wc = this;
......@@ -77,3 +94,10 @@ Conn *WCFS::connect(Tid at) {
return wconn;
}
// XXX Conn::close
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
void Conn::_pinner(IContext *ctx) {
Conn *wconn = this;
}
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