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
3470a1d5
Commit
3470a1d5
authored
Jul 17, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e6ce8953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
wcfs/__init__.py
wcfs/__init__.py
+13
-10
No files found.
wcfs/__init__.py
View file @
3470a1d5
...
...
@@ -104,9 +104,9 @@ class Conn(object):
class
_File
(
object
):
# .wconn Conn
# .foid hex of ZBigFile root object ID
# .size size of this file
# .blksize block size of this file
# .headf file object of head/file
# .headfsize head/file size is known to be at least headfsize (size ↑=)
# .pinned {} blk -> rev that wcfs already sent us for this file
# .mmaps []_Mapping ↑blk_start mappings of this file
pass
...
...
@@ -250,7 +250,7 @@ def resync(wconn, at):
# XXX locking
for
foid
in
wconn
.
_filetab
:
# XXX if file
was
has no mappings and was not used during whole prev
# XXX if file has no mappings and was not used during whole prev
# cycle - forget and stop watching it
_
=
wconn
.
_wlink
.
sendReq
(
context
.
background
(),
b"watch %s @%s"
%
(
h
(
foid
),
h
(
at
)))
if
_
!=
"ok"
:
...
...
@@ -258,6 +258,9 @@ def resync(wconn, at):
# XXX vvv -> errctx?
raise
RuntimeError
(
"resync @%s -> @%s: f<%s>: %s"
%
(
h
(
wconn
.
at
),
h
(
at
),
h
(
foid
),
_
))
# XXX update f.headfsize
# XXX remmap appended data after old f.headfsize
wconn
.
at
=
at
...
...
@@ -277,8 +280,8 @@ def mmap(wconn, foid, blk_start, blk_len): # -> Mapping
f
.
mmaps
=
[]
_
=
os
.
fstat
(
f
.
headf
.
fileno
())
f
.
size
=
_
.
st_size
f
.
blksize
=
_
.
st_blksize
f
.
headfsize
=
_
.
st_size
wconn
.
_filetab
[
foid
]
=
f
...
...
@@ -295,7 +298,7 @@ def mmap(wconn, foid, blk_start, blk_len): # -> Mapping
# mmap-in zeros after f.size (else access to memory after file.size will raise SIGBUS)
start
=
blk_start
*
f
.
blksize
mem
=
mm
.
map_ro
(
f
.
headf
.
fileno
(),
start
,
blk_len
*
f
.
blksize
)
zmemtail
=
mem
[
max
(
f
.
size
,
start
)
-
start
:]
zmemtail
=
mem
[
max
(
f
.
headf
size
,
start
)
-
start
:]
if
len
(
zmemtail
)
!=
0
:
mm
.
map_zero_into_ro
(
zmemtail
)
mmap
=
_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