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;
#include "wcfs_misc.h"
class
_Conn
;
struct
_Conn
;
class
_WatchLink
;
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
eb1e1798
...
...
@@ -66,8 +66,8 @@ struct PinReq;
// Use .resync to resync Conn onto different database view.
//
// Conn logically mirrors ZODB.Connection .
typedef
refptr
<
class
_Conn
>
Conn
;
class
_Conn
{
typedef
refptr
<
struct
_Conn
>
Conn
;
struct
_Conn
:
object
{
WCFS
*
_wc
;
zodb
::
Tid
at
;
WatchLink
_wlink
;
// watch/receive pins for created mappings
...
...
@@ -75,7 +75,8 @@ class _Conn {
sync
::
Mutex
_filemu
;
dict
<
zodb
::
Oid
,
_File
*>
_filetab
;
// {} foid -> _file
// XXX ._pinWG, ._pinCancel
sync
::
WorkGroup
_pinWG
;
func
<
void
()
>
_pinCancel
;
// don't new - create via WCFS.connect
private:
...
...
@@ -90,7 +91,7 @@ public:
error
resync
(
zodb
::
Tid
at
);
private:
void
_pinner
(
context
::
Context
ctx
);
error
_pinner
(
context
::
Context
ctx
);
void
_pin1
(
PinReq
*
req
);
};
...
...
@@ -148,17 +149,20 @@ tuple<Conn, error> WCFS::connect(zodb::Tid at) {
wconn
->
_wlink
=
wlink
;
pinCtx
,
wconn
.
_pinCancel
=
context
.
with_cancel
(
context
.
background
())
wconn
.
_pinWG
=
sync
.
WorkGroup
(
pinCtx
)
wconn
.
_pinWG
.
go
(
wconn
.
_pinner
)
context
::
Context
pinCtx
;
tie
(
pinCtx
,
wconn
->
_pinCancel
)
=
context
::
with_cancel
(
context
::
background
());
wconn
->
_pinWG
=
sync
::
NewWorkGroup
(
pinCtx
);
wconn
->
_pinWG
->
go
([
wconn
](
context
::
Context
ctx
)
->
error
{
return
wconn
->
_pinner
(
ctx
);
});
return
make_tuple
(
wconn
,
nil
);
}
// close releases resources associated with wconn.
// XXX what happens to file mmappings?
error
Conn
::
close
()
{
// XXX error -> void?
Conn
&
wconn
=
*
this
;
error
_
Conn
::
close
()
{
// XXX error -> void?
_Conn
&
wconn
=
*
this
;
wconn
.
_wlink
->
close
();
// XXX err
#if 0
...
...
@@ -191,8 +195,8 @@ error Conn::close() { // XXX error -> void?
}
// _pinner receives pin messages from wcfs and adjusts wconn mappings.
void
Conn
::
_pinner
(
context
::
Context
ctx
)
{
Conn
&
wconn
=
*
this
;
error
_Conn
::
_pinner
(
context
::
Context
ctx
)
{
// XXX error -> where?
_Conn
&
wconn
=
*
this
;
// XXX panic/exc -> log.CRITICAL
...
...
@@ -203,7 +207,7 @@ void Conn::_pinner(context::Context ctx) {
err
=
wconn
.
_wlink
->
recvReq
(
ctx
,
&
req
);
if
(
err
!=
nil
)
{
// 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
...
...
@@ -212,8 +216,8 @@ void Conn::_pinner(context::Context ctx) {
}
// pin1 handles one pin request received from wcfs.
void
Conn
::
_pin1
(
PinReq
*
req
)
{
Conn
&
wconn
=
*
this
;
void
_
Conn
::
_pin1
(
PinReq
*
req
)
{
_Conn
&
wconn
=
*
this
;
// XXX defer: reply either ack or nak on error
// XXX return error?
...
...
@@ -264,8 +268,8 @@ void Conn::_pin1(PinReq *req) {
// XXX Conn::mmap
// resync resyncs connection and its mappings onto different database view.
error
Conn
::
resync
(
zodb
::
Tid
at
)
{
Conn
&
wconn
=
*
this
;
error
_
Conn
::
resync
(
zodb
::
Tid
at
)
{
_Conn
&
wconn
=
*
this
;
// XXX err ctx
// XXX locking
...
...
wcfs/wcfs_test.py
View file @
eb1e1798
...
...
@@ -19,7 +19,7 @@
# See https://www.nexedi.com/licensing for rationale and options.
"""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
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