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

.

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