Commit 115ee9b1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6d7e1b2c
...@@ -20,3 +20,60 @@ ...@@ -20,3 +20,60 @@
// wcfs_virtmem provides wcfs client integrated with user-spce virtmem layer. // wcfs_virtmem provides wcfs client integrated with user-spce virtmem layer.
// //
// XXX provides isolated view. // XXX provides isolated view.
#include <golang/libgolang.h>
using namespace golang;
#include <unordered_map>
template<typename Key, typename Value>
using dict = std::unordered_map<Key, Value>;
#include <stdint.h>
typedef uint64_t Tid; // XXX ok?
struct Conn;
struct _File;
// XXX doc
struct WCFS {
Conn *connect(Tid at);
};
// XXX doc
struct Conn {
WCFS *_wc;
Tid at;
// _wlink
sync::Mutex _filemu;
dict<Tid, _File*> _filetab; // {} foid -> _file
};
// XXX doc
struct _File {
// XXX
};
// XXX struct Mapping
Conn *WCFS::connect(Tid at) {
WCFS *wc = this;
Conn *wconn = new Conn();
// TODO support !isolated mode
wconn->_wc = wc;
wconn->at = at;
// wconn._wlink = WatchLink(wc) XXX
// XXX reenable
#if 0
pinCtx, wconn._pinCancel = context.with_cancel(context.background())
wconn._pinWG = sync.WorkGroup(pinCtx)
wconn._pinWG.go(wconn._pinner)
#endif
return wconn;
}
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