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
f8526f45
Commit
f8526f45
authored
Oct 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c4013452
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+39
-3
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
f8526f45
...
...
@@ -40,6 +40,8 @@ struct IContext {
struct
Conn
;
struct
_File
;
struct
WatchLink
;
struct
SrvReq
;
// WCFS represents filesystem-level connection to wcfs server.
// XXX doc
...
...
@@ -53,9 +55,9 @@ struct WCFS {
//
// XXX doc
struct
Conn
{
WCFS
*
_wc
;
Tid
at
;
// _wlink
WCFS
*
_wc
;
Tid
at
;
WatchLink
*
_wlink
;
sync
::
Mutex
_filemu
;
dict
<
Oid
,
_File
*>
_filetab
;
// {} foid -> _file
...
...
@@ -63,6 +65,7 @@ struct Conn {
private:
void
_pinner
(
IContext
*
ctx
);
void
_pin1
(
SrvReq
*
req
);
};
// _File represent isolated file view under Conn.
...
...
@@ -75,6 +78,19 @@ struct _File {
// XXX struct Mapping
// XXX struct WatchLink
struct
WatchLink
{
// XXX
SrvReq
*
recvReq
(
IContext
*
ctx
);
};
// SrvReq represents 1 server-initiated wcfs request received over /head/watch link.
struct
SrvReq
{
// XXX
};
// connect creates new Conn viewing WCFS state as of @at.
Conn
*
WCFS
::
connect
(
Tid
at
)
{
WCFS
*
wc
=
this
;
...
...
@@ -100,4 +116,24 @@ Conn *WCFS::connect(Tid at) {
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
void
Conn
::
_pinner
(
IContext
*
ctx
)
{
Conn
*
wconn
=
this
;
// XXX panic/exc -> log.CRITICAL
while
(
1
)
{
SrvReq
*
req
=
wconn
->
_wlink
->
recvReq
(
ctx
);
if
(
req
==
NULL
)
return
// XXX ok? (EOF - when wcfs closes wlink)
// we received request to pin/unpin file block. handle it
wconn
->
_pin1
(
req
);
// XXX free req?
}
}
// pin1 handles one pin request received from wcfs.
void
Conn
::
_pin1
(
SrvReq
*
req
)
{
Conn
*
wconn
=
this
;
// XXX
}
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