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
Hide 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
...
@@ -102,13 +102,13 @@ class Conn(object):
...
@@ -102,13 +102,13 @@ class Conn(object):
# _File represent isolated file view under Conn.
# _File represent isolated file view under Conn.
class
_File
(
object
):
class
_File
(
object
):
# .wconn Conn
# .wconn
Conn
# .foid hex of ZBigFile root object ID
# .foid
hex of ZBigFile root object ID
# .
size
size of this file
# .
blksize block
size of this file
# .
blksize block size of this
file
# .
headf file object of head/
file
# .headf
file object of head/file
# .headf
size head/file size is known to be at least headfsize (size ↑=)
# .pinned {} blk -> rev that wcfs already sent us for this file
# .pinned
{} blk -> rev that wcfs already sent us for this file
# .mmaps []_Mapping ↑blk_start mappings of this file
# .mmaps
[]_Mapping ↑blk_start mappings of this file
pass
pass
...
@@ -250,7 +250,7 @@ def resync(wconn, at):
...
@@ -250,7 +250,7 @@ def resync(wconn, at):
# XXX locking
# XXX locking
for
foid
in
wconn
.
_filetab
:
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
# cycle - forget and stop watching it
_
=
wconn
.
_wlink
.
sendReq
(
context
.
background
(),
b"watch %s @%s"
%
(
h
(
foid
),
h
(
at
)))
_
=
wconn
.
_wlink
.
sendReq
(
context
.
background
(),
b"watch %s @%s"
%
(
h
(
foid
),
h
(
at
)))
if
_
!=
"ok"
:
if
_
!=
"ok"
:
...
@@ -258,6 +258,9 @@ def resync(wconn, at):
...
@@ -258,6 +258,9 @@ def resync(wconn, at):
# XXX vvv -> errctx?
# XXX vvv -> errctx?
raise
RuntimeError
(
"resync @%s -> @%s: f<%s>: %s"
%
(
h
(
wconn
.
at
),
h
(
at
),
h
(
foid
),
_
))
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
wconn
.
at
=
at
...
@@ -277,8 +280,8 @@ def mmap(wconn, foid, blk_start, blk_len): # -> Mapping
...
@@ -277,8 +280,8 @@ def mmap(wconn, foid, blk_start, blk_len): # -> Mapping
f
.
mmaps
=
[]
f
.
mmaps
=
[]
_
=
os
.
fstat
(
f
.
headf
.
fileno
())
_
=
os
.
fstat
(
f
.
headf
.
fileno
())
f
.
size
=
_
.
st_size
f
.
blksize
=
_
.
st_blksize
f
.
blksize
=
_
.
st_blksize
f
.
headfsize
=
_
.
st_size
wconn
.
_filetab
[
foid
]
=
f
wconn
.
_filetab
[
foid
]
=
f
...
@@ -295,7 +298,7 @@ def mmap(wconn, foid, blk_start, blk_len): # -> Mapping
...
@@ -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)
# mmap-in zeros after f.size (else access to memory after file.size will raise SIGBUS)
start
=
blk_start
*
f
.
blksize
start
=
blk_start
*
f
.
blksize
mem
=
mm
.
map_ro
(
f
.
headf
.
fileno
(),
start
,
blk_len
*
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
:
if
len
(
zmemtail
)
!=
0
:
mm
.
map_zero_into_ro
(
zmemtail
)
mm
.
map_zero_into_ro
(
zmemtail
)
mmap
=
_Mapping
()
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