Commit c4013452 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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