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

.

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