Commit 6c998ca4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ffbaed36
......@@ -116,6 +116,7 @@ public:
private:
error _pinner(context::Context ctx);
void _pin1(PinReq *req);
error __pin1(PinReq *req);
};
// FileH represent isolated file view under Conn.
......
......@@ -177,24 +177,20 @@ error _Conn::_pinner(context::Context ctx) { // XXX error -> where?
}
// pin1 handles one pin request received from wcfs.
// XXX return error?
void _Conn::_pin1(PinReq *req) {
_Conn& wconn = *this;
error err = wconn.__pin1(req);
// XXX return error?
// XXX defer: reply either ack or nak on error
// reply either ack or nak on error
#if 0
defer([&]() {
ack = "ack"
exc = sys.exc_info()[1]
if exc is not None:
ack = "nak: %s" % exc
//req.reply(ack)
ctx = context.background() // XXX ok?
wconn._wlink.replyReq(ctx, req, ack)
});
#endif
string ack = "ack";
if (err != nil)
ack = fmt::sprintf("nak: %s", err->Error().c_str());
wconn._wlink->replyReq(context::background(), req, ack); // XXX ctx ok?
}
error _Conn::__pin1(PinReq *req) {
_Conn& wconn = *this;
FileH f;
bool ok;
......@@ -203,6 +199,7 @@ void _Conn::_pin1(PinReq *req) {
if (!ok) {
wconn._filehmu.unlock();
// XXX err = we are not watching the file - why wcfs sent us this update?
return fmt::errorf("err TODO");
}
......@@ -244,6 +241,7 @@ void _Conn::_pin1(PinReq *req) {
}
wconn._filehmu.unlock();
return nil;
}
// open opens FileH corresponding to ZBigFile foid.
......
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