Commit 3d12e2ca authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 5e6cbc63
......@@ -90,7 +90,7 @@ struct Conn;
struct _File;
struct _Mapping;
struct WatchLink;
struct SrvReq;
struct PinReq;
// WCFS represents filesystem-level connection to wcfs server.
// XXX doc
......@@ -117,7 +117,7 @@ struct Conn {
private:
void _pinner(IContext *ctx);
void _pin1(SrvReq *req);
void _pin1(PinReq *req);
};
// _File represent isolated file view under Conn.
......@@ -207,7 +207,7 @@ class WatchLink {
public:
friend tuple<WatchLink*, error> WCFS::_openwatch();
error close();
error recvReq(IContext *ctx, SrvReq *rx_into);
error recvReq(IContext *ctx, PinReq *rx_into);
tuple<string, error> sendReq(IContext *ctx, const string &req);
private:
......@@ -219,9 +219,8 @@ private:
tuple<chan<rxPkt>, error> _sendReq(IContext *ctx, const string &req);
};
// SrvReq represents 1 server-initiated wcfs request received over /head/watch link.
// XXX -> PinReq?
struct SrvReq {
// PinReq represents 1 server-initiated wcfs pin request received over /head/watch link.
struct PinReq {
StreamID stream; // request was received with this stream ID
Oid foid; // request is about this file
int64_t blk; // ----//---- about this block
......@@ -293,7 +292,7 @@ void Conn::_pinner(IContext *ctx) {
while (1) {
// XXX -> recv inplace into on-stack req ?
// XXX -> err, handle EOF, abort on *
SrvReq *req = wconn._wlink->recvReq(ctx);
PinReq *req = wconn._wlink->recvReq(ctx);
if (req == NULL)
return // XXX ok? (EOF - when wcfs closes wlink)
......@@ -305,7 +304,7 @@ void Conn::_pinner(IContext *ctx) {
}
// pin1 handles one pin request received from wcfs.
void Conn::_pin1(SrvReq *req) {
void Conn::_pin1(PinReq *req) {
Conn &wconn = *this;
// XXX defer: reply either ack or nak on error
......@@ -663,7 +662,7 @@ tuple</*rxq*/chan<rxPkt>, error> WatchLink::_sendReq(IContext *ctx, const string
}
// recvReq receives client <- server request.
error WatchLink::recvReq(IContext *ctx, SrvReq *rx) {
error WatchLink::recvReq(IContext *ctx, PinReq *rx) {
WatchLink& wlink = *this;
rxPkt pkt;
......@@ -681,7 +680,7 @@ error WatchLink::recvReq(IContext *ctx, SrvReq *rx) {
rx.stream = pkt.stream;
pkt.to_sting();
stream, msg = rx
return SrvReq(wlink, stream, msg)
return PinReq(wlink, stream, msg)
}
// _parsePinReq parses message into PinReq according to wcfs invalidation protocol.
......
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