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

.

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