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
cfb6df9a
Commit
cfb6df9a
authored
Jul 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
821d3909
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
wcfs/__init__.py
wcfs/__init__.py
+7
-2
No files found.
wcfs/__init__.py
View file @
cfb6df9a
...
@@ -136,7 +136,7 @@ def _pinner(wconn, ctx):
...
@@ -136,7 +136,7 @@ def _pinner(wconn, ctx):
# FIXME check if virtmem did not mapped RW page into this block already
# FIXME check if virtmem did not mapped RW page into this block already
mmap
.
pin
(
req
.
blk
,
req
.
at
)
mmap
.
pin
(
req
.
blk
,
req
.
at
)
# update .pinned
# update
f
.pinned
if
req
.
at
is
None
:
if
req
.
at
is
None
:
f
.
pinned
.
pop
(
req
.
blk
,
None
)
# = delete(f.pinned, req.blk) -- unpin to @head
f
.
pinned
.
pop
(
req
.
blk
,
None
)
# = delete(f.pinned, req.blk) -- unpin to @head
else
:
else
:
...
@@ -149,6 +149,7 @@ def _pinner(wconn, ctx):
...
@@ -149,6 +149,7 @@ def _pinner(wconn, ctx):
# NOTE this does not check wrt virtmem already mapped blk as RW XXX ok?
# NOTE this does not check wrt virtmem already mapped blk as RW XXX ok?
@
func
(
_Mapping
)
@
func
(
_Mapping
)
def
pin
(
mmap
,
blk
,
at
):
def
pin
(
mmap
,
blk
,
at
):
assert
mmap
.
blk_start
<=
blk
<
mmap
.
blk_stop
f
=
mmap
.
file
f
=
mmap
.
file
if
at
is
None
:
if
at
is
None
:
fsfile
=
f
.
headf
fsfile
=
f
.
headf
...
@@ -174,11 +175,15 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko
...
@@ -174,11 +175,15 @@ def mmap(wconn, foid, offset, size): # -> Mapping XXX offset, size -> blko
# create memory with head/f mapping and applied pins
# create memory with head/f mapping and applied pins
mem
=
mm
.
mmap_ro
(
f
.
headf
.
fileno
(),
offset
,
size
)
mem
=
mm
.
mmap_ro
(
f
.
headf
.
fileno
(),
offset
,
size
)
mmap
=
_Mapping
(
f
,
blk_start
,
mem
)
for
blk
,
rev
in
f
.
pin
.
items
():
# XXX keep f.pin ↑blk and use binary search?
for
blk
,
rev
in
f
.
pin
.
items
():
# XXX keep f.pin ↑blk and use binary search?
if
not
(
blk_start
<=
blk
&&
blk
<
blk_stop
):
if
not
(
blk_start
<=
blk
&&
blk
<
blk_stop
):
continue
# blk out of this mapping
continue
# blk out of this mapping
mmap
.
pin
(
blk
,
rev
)
mm
.
mmap_into_ro
(
mem
[(
blk
-
blk_start
)
*
blksize
:][:
blksize
],
f
.
mmaps
.
append
(
mmap
)
# XXX keep f.mmaps ↑blk_start
return
mmap
# XXX Watch
# XXX Watch
...
...
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