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
39f1bd67
Commit
39f1bd67
authored
Jul 16, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
02fa982f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
wcfs/__init__.py
wcfs/__init__.py
+9
-4
No files found.
wcfs/__init__.py
View file @
39f1bd67
...
@@ -168,9 +168,11 @@ def _pinner(wconn, ctx):
...
@@ -168,9 +168,11 @@ def _pinner(wconn, ctx):
f
.
pinned
[
req
.
blk
]
=
req
.
at
f
.
pinned
[
req
.
blk
]
=
req
.
at
# mmap creates file mapping representing file data as of wconn.at database state.
# mmap creates file mapping representing file
[blk_start +blk_len)
data as of wconn.at database state.
@
func
(
Conn
)
@
func
(
Conn
)
def
mmap
(
wconn
,
foid
,
blk
,
blklen
):
# -> Mapping
def
mmap
(
wconn
,
foid
,
blk_start
,
blk_len
):
# -> Mapping
assert
blk_len
>=
0
blk_stop
=
blk_start
+
blk_len
with
wconn
.
_filemu
:
with
wconn
.
_filemu
:
f
=
wconn
.
_filetab
.
get
(
foid
)
f
=
wconn
.
_filetab
.
get
(
foid
)
if
f
is
None
:
if
f
is
None
:
...
@@ -186,8 +188,11 @@ def mmap(wconn, foid, blk, blklen): # -> Mapping
...
@@ -186,8 +188,11 @@ def mmap(wconn, foid, blk, blklen): # -> Mapping
# XXX relock wconn -> f ?
# XXX relock wconn -> f ?
# create memory with head/f mapping and applied pins
# create memory with head/f mapping and applied pins
mem
=
mm
.
map_ro
(
f
.
headf
.
fileno
(),
blk
*
f
.
blksize
,
blklen
*
f
.
blksize
)
mem
=
mm
.
map_ro
(
f
.
headf
.
fileno
(),
blk_start
*
f
.
blksize
,
blk_len
*
f
.
blksize
)
mmap
=
_Mapping
(
f
,
blk_start
,
mem
)
mmap
=
_Mapping
()
mmap
.
file
=
f
mmap
.
blk_start
=
blk_start
mmap
.
mem
=
mem
for
blk
,
rev
in
f
.
pinned
.
items
():
# XXX keep f.pinned ↑blk and use binary search?
for
blk
,
rev
in
f
.
pinned
.
items
():
# XXX keep f.pinned ↑blk and use binary search?
if
not
(
blk_start
<=
blk
<
blk_stop
):
if
not
(
blk_start
<=
blk
<
blk_stop
):
continue
# blk out of this mapping
continue
# blk out of this mapping
...
...
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