Commit 2eb9c369 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent e19d6686
...@@ -152,19 +152,18 @@ class WatchLink { ...@@ -152,19 +152,18 @@ class WatchLink {
chan<structZ> _rxeof; // becomes ready when wcfs closes its tx side chan<structZ> _rxeof; // becomes ready when wcfs closes its tx side
// inv.protocol message IO // inv.protocol message IO
_acceptq = chan() // (stream, msg) server originated messages go here chan<(stream,msg)> _acceptq; // server originated messages go here
sync::Mutex _rxmu; sync::Mutex _rxmu;
dict<stream, chan<XXX>> _rxtab; // {} stream -> rxq server replies go via here dict<stream, chan<XXX>> _rxtab; // {} stream -> rxq server replies go via here
set<stream> _accepted; // streams we accepted but did not replied yet set<stream> _accepted; // streams we accepted but did not replied yet
XXXint _req_next = 1; // stream ID for next client-originated request XXX -> atomic XXXint _req_next = 1; // stream ID for next client-originated request XXX -> atomic
sync::Mutex _txmu // serializes writes sync::Mutex _txmu // serializes writes
bool _txclosed; // XXX = False bool _txclosed; // XXX = False
#if 0 #if 0
serveCtx, wlink._serveCancel = context.with_cancel(context.background()) func() _serveCancel
wlink._serveWG = sync.WorkGroup(serveCtx) sync.WorkGroup *_serveWG
wlink._serveWG.go(wlink._serveRX)
#endif #endif
public: public:
...@@ -174,10 +173,10 @@ public: ...@@ -174,10 +173,10 @@ public:
// SrvReq represents 1 server-initiated wcfs request received over /head/watch link. // SrvReq represents 1 server-initiated wcfs request received over /head/watch link.
// XXX -> PinReq? // XXX -> PinReq?
struct SrvReq { struct SrvReq {
// XXX uint64_t stream // request was received with this stream ID
Oid foid; // request is about this file Oid foid; // request is about this file
int64_t blk; // ----//---- about this block int64_t blk; // ----//---- about this block
Tid at; // pin to this at XXX ffff = None = unpin Tid at; // pin to this at XXX ffff = None = unpin
}; };
...@@ -335,9 +334,18 @@ tuple<WatchLink*, error> WCFS::_openwatch() { ...@@ -335,9 +334,18 @@ tuple<WatchLink*, error> WCFS::_openwatch() {
return make_tuple(NULL, err); return make_tuple(NULL, err);
wlink = new(WatchLink); wlink = new(WatchLink);
wlink->_wc = wc; wlink->_wc = wc;
wlink->_f = f; wlink->_f = f;
wlink->rx_eof = makechan<structZ>(); wlink->_rx_eof = makechan<structZ>();
wlink->_acceptq = makechan<XXX>();
wlink->_req_next = 1;
wlink->_txclosed = false;
#if 0
serveCtx, wlink._serveCancel = context.with_cancel(context.background())
wlink->_serveWG = sync.WorkGroup(serveCtx)
wlink->_serveWG.go(wlink._serveRX)
#endif
} }
// XXX close // XXX close
......
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