Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
3d12e2ca
Commit
3d12e2ca
authored
Oct 29, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
5e6cbc63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+9
-10
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
3d12e2ca
...
...
@@ -90,7 +90,7 @@ struct Conn;
struct
_File
;
struct
_Mapping
;
struct
WatchLink
;
struct
Srv
Req
;
struct
Pin
Req
;
// WCFS represents filesystem-level connection to wcfs server.
// XXX doc
...
...
@@ -117,7 +117,7 @@ struct Conn {
private:
void
_pinner
(
IContext
*
ctx
);
void
_pin1
(
Srv
Req
*
req
);
void
_pin1
(
Pin
Req
*
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
,
Srv
Req
*
rx_into
);
error
recvReq
(
IContext
*
ctx
,
Pin
Req
*
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 *
Srv
Req
*
req
=
wconn
.
_wlink
->
recvReq
(
ctx
);
Pin
Req
*
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
(
Srv
Req
*
req
)
{
void
Conn
::
_pin1
(
Pin
Req
*
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
,
Srv
Req
*
rx
)
{
error
WatchLink
::
recvReq
(
IContext
*
ctx
,
Pin
Req
*
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
Srv
Req
(
wlink
,
stream
,
msg
)
return
Pin
Req
(
wlink
,
stream
,
msg
)
}
// _parsePinReq parses message into PinReq according to wcfs invalidation protocol.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment