Commit 889ea1a2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 16b19477
...@@ -233,18 +233,18 @@ tuple<Conn*, error> WCFS::connect(Tid at) { ...@@ -233,18 +233,18 @@ tuple<Conn*, error> WCFS::connect(Tid at) {
// _pinner receives pin messages from wcfs and adjusts wconn mappings. // _pinner receives pin messages from wcfs and adjusts wconn mappings.
void Conn::_pinner(IContext *ctx) { void Conn::_pinner(IContext *ctx) {
Conn *wconn = this; Conn &wconn = *this;
// XXX panic/exc -> log.CRITICAL // XXX panic/exc -> log.CRITICAL
while (1) { while (1) {
// XXX -> recv inplace into on-stack req ? // XXX -> recv inplace into on-stack req ?
SrvReq *req = wconn->_wlink->recvReq(ctx); SrvReq *req = wconn._wlink->recvReq(ctx);
if (req == NULL) if (req == NULL)
return // XXX ok? (EOF - when wcfs closes wlink) return // XXX ok? (EOF - when wcfs closes wlink)
// we received request to pin/unpin file block. handle it // we received request to pin/unpin file block. handle it
wconn->_pin1(req); wconn._pin1(req);
// XXX free req? // XXX free req?
} }
...@@ -252,22 +252,20 @@ void Conn::_pinner(IContext *ctx) { ...@@ -252,22 +252,20 @@ void Conn::_pinner(IContext *ctx) {
// pin1 handles one pin request received from wcfs. // pin1 handles one pin request received from wcfs.
void Conn::_pin1(SrvReq *req) { void Conn::_pin1(SrvReq *req) {
Conn *wconn = this; Conn &wconn = *this;
// XXX defer: reply either ack or nak on error // XXX defer: reply either ack or nak on error
// XXX return error? // XXX return error?
_File *f; _File *f;
bool ok; bool ok;
wconn->_filemu.lock(); wconn._filemu.lock();
tie(f, ok) = wconn->_filetab.get(req->foid); tie(f, ok) = wconn._filetab.get(req->foid);
//if (has(wconn->_filetab, req->foid)) {
if (!ok) { if (!ok) {
wconn->_filemu.unlock(); wconn._filemu.unlock();
// XXX err = we are not watching the file - why wcfs sent us this update? // XXX err = we are not watching the file - why wcfs sent us this update?
} }
//_File *f = _->second;
// XXX relock wconn -> f // XXX relock wconn -> f
...@@ -296,7 +294,7 @@ void Conn::_pin1(SrvReq *req) { ...@@ -296,7 +294,7 @@ void Conn::_pin1(SrvReq *req) {
f->pinned[req->blk] = req->at; f->pinned[req->blk] = req->at;
} }
wconn->_filemu.unlock(); wconn._filemu.unlock();
} }
// _remmapblk remmaps mapping memory for file[blk] to be viewing database as of @at state. // _remmapblk remmaps mapping memory for file[blk] to be viewing database as of @at state.
......
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