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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
eb1e1798
Commit
eb1e1798
authored
Dec 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4f8b5511
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
wcfs/internal/wcfs.h
wcfs/internal/wcfs.h
+1
-1
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+20
-16
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+1
-1
No files found.
wcfs/internal/wcfs.h
View file @
eb1e1798
...
@@ -33,7 +33,7 @@ using std::pair;
...
@@ -33,7 +33,7 @@ using std::pair;
#include "wcfs_misc.h"
#include "wcfs_misc.h"
class
_Conn
;
struct
_Conn
;
class
_WatchLink
;
class
_WatchLink
;
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
eb1e1798
...
@@ -66,8 +66,8 @@ struct PinReq;
...
@@ -66,8 +66,8 @@ struct PinReq;
// Use .resync to resync Conn onto different database view.
// Use .resync to resync Conn onto different database view.
//
//
// Conn logically mirrors ZODB.Connection .
// Conn logically mirrors ZODB.Connection .
typedef
refptr
<
class
_Conn
>
Conn
;
typedef
refptr
<
struct
_Conn
>
Conn
;
class
_Conn
{
struct
_Conn
:
object
{
WCFS
*
_wc
;
WCFS
*
_wc
;
zodb
::
Tid
at
;
zodb
::
Tid
at
;
WatchLink
_wlink
;
// watch/receive pins for created mappings
WatchLink
_wlink
;
// watch/receive pins for created mappings
...
@@ -75,7 +75,8 @@ class _Conn {
...
@@ -75,7 +75,8 @@ class _Conn {
sync
::
Mutex
_filemu
;
sync
::
Mutex
_filemu
;
dict
<
zodb
::
Oid
,
_File
*>
_filetab
;
// {} foid -> _file
dict
<
zodb
::
Oid
,
_File
*>
_filetab
;
// {} foid -> _file
// XXX ._pinWG, ._pinCancel
sync
::
WorkGroup
_pinWG
;
func
<
void
()
>
_pinCancel
;
// don't new - create via WCFS.connect
// don't new - create via WCFS.connect
private:
private:
...
@@ -90,7 +91,7 @@ public:
...
@@ -90,7 +91,7 @@ public:
error
resync
(
zodb
::
Tid
at
);
error
resync
(
zodb
::
Tid
at
);
private:
private:
void
_pinner
(
context
::
Context
ctx
);
error
_pinner
(
context
::
Context
ctx
);
void
_pin1
(
PinReq
*
req
);
void
_pin1
(
PinReq
*
req
);
};
};
...
@@ -148,17 +149,20 @@ tuple<Conn, error> WCFS::connect(zodb::Tid at) {
...
@@ -148,17 +149,20 @@ tuple<Conn, error> WCFS::connect(zodb::Tid at) {
wconn
->
_wlink
=
wlink
;
wconn
->
_wlink
=
wlink
;
pinCtx
,
wconn
.
_pinCancel
=
context
.
with_cancel
(
context
.
background
())
context
::
Context
pinCtx
;
wconn
.
_pinWG
=
sync
.
WorkGroup
(
pinCtx
)
tie
(
pinCtx
,
wconn
->
_pinCancel
)
=
context
::
with_cancel
(
context
::
background
());
wconn
.
_pinWG
.
go
(
wconn
.
_pinner
)
wconn
->
_pinWG
=
sync
::
NewWorkGroup
(
pinCtx
);
wconn
->
_pinWG
->
go
([
wconn
](
context
::
Context
ctx
)
->
error
{
return
wconn
->
_pinner
(
ctx
);
});
return
make_tuple
(
wconn
,
nil
);
return
make_tuple
(
wconn
,
nil
);
}
}
// close releases resources associated with wconn.
// close releases resources associated with wconn.
// XXX what happens to file mmappings?
// XXX what happens to file mmappings?
error
Conn
::
close
()
{
// XXX error -> void?
error
_
Conn
::
close
()
{
// XXX error -> void?
Conn
&
wconn
=
*
this
;
_Conn
&
wconn
=
*
this
;
wconn
.
_wlink
->
close
();
// XXX err
wconn
.
_wlink
->
close
();
// XXX err
#if 0
#if 0
...
@@ -191,8 +195,8 @@ error Conn::close() { // XXX error -> void?
...
@@ -191,8 +195,8 @@ error Conn::close() { // XXX error -> void?
}
}
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
void
Conn
::
_pinner
(
context
::
Context
ctx
)
{
error
_Conn
::
_pinner
(
context
::
Context
ctx
)
{
// XXX error -> where?
Conn
&
wconn
=
*
this
;
_Conn
&
wconn
=
*
this
;
// XXX panic/exc -> log.CRITICAL
// XXX panic/exc -> log.CRITICAL
...
@@ -203,7 +207,7 @@ void Conn::_pinner(context::Context ctx) {
...
@@ -203,7 +207,7 @@ void Conn::_pinner(context::Context ctx) {
err
=
wconn
.
_wlink
->
recvReq
(
ctx
,
&
req
);
err
=
wconn
.
_wlink
->
recvReq
(
ctx
,
&
req
);
if
(
err
!=
nil
)
{
if
(
err
!=
nil
)
{
// XXX -> err, handle EOF, abort on *
// XXX -> err, handle EOF, abort on *
return
;
// XXX ok? (EOF - when wcfs closes wlink)
return
err
;
// XXX ok? (EOF - when wcfs closes wlink)
}
}
// we received request to pin/unpin file block. handle it
// we received request to pin/unpin file block. handle it
...
@@ -212,8 +216,8 @@ void Conn::_pinner(context::Context ctx) {
...
@@ -212,8 +216,8 @@ void Conn::_pinner(context::Context ctx) {
}
}
// pin1 handles one pin request received from wcfs.
// pin1 handles one pin request received from wcfs.
void
Conn
::
_pin1
(
PinReq
*
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
// XXX return error?
// XXX return error?
...
@@ -264,8 +268,8 @@ void Conn::_pin1(PinReq *req) {
...
@@ -264,8 +268,8 @@ void Conn::_pin1(PinReq *req) {
// XXX Conn::mmap
// XXX Conn::mmap
// resync resyncs connection and its mappings onto different database view.
// resync resyncs connection and its mappings onto different database view.
error
Conn
::
resync
(
zodb
::
Tid
at
)
{
error
_
Conn
::
resync
(
zodb
::
Tid
at
)
{
Conn
&
wconn
=
*
this
;
_Conn
&
wconn
=
*
this
;
// XXX err ctx
// XXX err ctx
// XXX locking
// XXX locking
...
...
wcfs/wcfs_test.py
View file @
eb1e1798
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
# See https://www.nexedi.com/licensing for rationale and options.
# See https://www.nexedi.com/licensing for rationale and options.
"""wcfs_test tests wcfs filesystem from outside as python client process
"""wcfs_test tests wcfs filesystem from outside as python client process
It also unit-tests wcfs.py virtmem-level integration.
It also unit-tests wcfs.py virtmem-level integration.
XXX
At functional level, the whole wendelin.core test suite is used to verify
At functional level, the whole wendelin.core test suite is used to verify
wcfs.py/wcfs.go while running tox tests in wcfs mode.
wcfs.py/wcfs.go while running tox tests in wcfs mode.
...
...
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