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
44a59d27
Commit
44a59d27
authored
Jul 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
95fcfdaf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
wcfs/__init__.py
wcfs/__init__.py
+6
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+18
-1
No files found.
wcfs/__init__.py
View file @
44a59d27
...
...
@@ -48,6 +48,8 @@ from ZODB.FileStorage import FileStorage
from
ZODB.utils
import
z64
,
u64
,
p64
from
zodbtools.util
import
ashex
,
fromhex
from
.internal
import
mm
from
six
import
reraise
...
...
@@ -142,7 +144,7 @@ def _pinner(wconn, ctx):
# XXX relock wconn -> f ?
for
mmap
in
f
.
mmaps
:
# XXX use ↑blk_start for binary search
if
not
(
mmap
.
blk_start
<=
req
.
blk
&&
req
.
blk
<
mmap
.
blk_stop
):
if
not
(
mmap
.
blk_start
<=
req
.
blk
<
mmap
.
blk_stop
):
continue
# blk ∉ mmap
# FIXME check if virtmem did not mapped RW page into this block already
...
...
@@ -162,7 +164,7 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko
f
=
wconn
.
_filetab
.
get
(
foid
)
if
f
is
None
:
headf
=
wconn
.
_wc
.
_open
(
"head/%s"
%
(
ashex
(
foid
),),
"rb"
)
f
=
File
(
headf
)
f
=
_
File
(
headf
)
wconn
.
_filetab
[
foid
]
=
f
# XXX relock wconn -> f ?
...
...
@@ -171,7 +173,7 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko
mem
=
mm
.
mmap_ro
(
f
.
headf
.
fileno
(),
offset
,
size
)
mmap
=
_Mapping
(
f
,
blk_start
,
mem
)
for
blk
,
rev
in
f
.
pinned
.
items
():
# XXX keep f.pinned ↑blk and use binary search?
if
not
(
blk_start
<=
blk
&&
blk
<
blk_stop
):
if
not
(
blk_start
<=
blk
<
blk_stop
):
continue
# blk out of this mapping
mmap
.
_remmapblk
(
blk
,
rev
)
...
...
@@ -210,7 +212,7 @@ def remmap_blk(mmap, blk):
# unmap is removes mapping memory from address space.
# virtmem calls this when VMA is unmapped.
@
func
(
_Mapping
)
:
@
func
(
_Mapping
)
def
unmap
(
mmap
):
# XXX locking
mm
.
unmap
(
mmap
.
mem
)
...
...
wcfs/wcfs_test.py
View file @
44a59d27
...
...
@@ -17,7 +17,13 @@
#
# See COPYING file for full licensing terms.
# 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 infrastructure.
At functional level, the whole wendelin.core test suite is used to verify
wcfs.py/wcfs.go while running tox tests in wcfs mode.
"""
from
__future__
import
print_function
,
absolute_import
...
...
@@ -1677,6 +1683,17 @@ def test_wcfs_watch_2files():
# XXX @revX/ is automatically removed after some time
# ---- wcfs.py + virtmem integration ----
# XXX name, text ...
def
test_XXX
():
t
=
tDB
();
zf
=
t
.
zfile
defer
(
t
.
close
)
at1
=
t
.
commit
(
zf
,
{
2
:
'c1'
})
at2
=
t
.
commit
(
zf
,
{
2
:
'c2'
})
wconn
=
t
.
wc
.
connect
(
at1
)
# ---- misc ---
...
...
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