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
20c301bc
Commit
20c301bc
authored
Oct 30, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ce13601e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+10
-7
No files found.
wcfs/internal/wcfs_virtmem.cpp
View file @
20c301bc
...
@@ -116,7 +116,7 @@ struct Conn {
...
@@ -116,7 +116,7 @@ struct Conn {
public:
public:
error
close
();
error
close
();
void
resync
(
Tid
at
);
error
resync
(
Tid
at
);
private:
private:
void
_pinner
(
IContext
*
ctx
);
void
_pinner
(
IContext
*
ctx
);
...
@@ -365,8 +365,9 @@ void Conn::_pin1(PinReq *req) {
...
@@ -365,8 +365,9 @@ void Conn::_pin1(PinReq *req) {
// XXX Conn::mmap
// XXX Conn::mmap
// resync resyncs connection and its mappings onto different database view.
// resync resyncs connection and its mappings onto different database view.
void
Conn
::
resync
(
Tid
at
)
{
// XXX void -> err?
error
Conn
::
resync
(
Tid
at
)
{
Conn
&
wconn
=
*
this
;
Conn
&
wconn
=
*
this
;
// XXX err ctx
// XXX locking
// XXX locking
...
@@ -378,9 +379,10 @@ void Conn::resync(Tid at) { // XXX void -> err?
...
@@ -378,9 +379,10 @@ void Conn::resync(Tid at) { // XXX void -> err?
// cycle - forget and stop watching it
// cycle - forget and stop watching it
// update f.headfsize and remmap to head/f zero regions that are now covered by head/f
// update f.headfsize and remmap to head/f zero regions that are now covered by head/f
_
=
os
.
fstat
(
f
.
headf
.
fileno
())
struct
stat
st
;
assert
f
.
blksize
==
_
.
st_blksize
// blksize must not change
auto
err
=
f
->
headf
.
stat
(
&
st
)
// XXX err
headfsize
=
_
.
st_size
assert
f
.
blksize
==
st
.
st_blksize
// blksize must not change
headfsize
=
st
.
st_size
;
assert
f
.
headfsize
<=
headfsize
// head/file size ↑=
assert
f
.
headfsize
<=
headfsize
// head/file size ↑=
assert
headfsize
%
f
.
blksize
==
0
assert
headfsize
%
f
.
blksize
==
0
for
mmap
in
f
.
mmaps
:
for
mmap
in
f
.
mmaps
:
...
@@ -393,11 +395,12 @@ void Conn::resync(Tid at) { // XXX void -> err?
...
@@ -393,11 +395,12 @@ void Conn::resync(Tid at) { // XXX void -> err?
f
.
headfsize
=
headfsize
;
f
.
headfsize
=
headfsize
;
_
=
wconn
.
_wlink
.
sendReq
(
context
.
background
(),
b
"watch %s @%s"
%
(
h
(
foid
),
h
(
at
)))
_
=
wconn
.
_wlink
->
sendReq
(
context
.
background
(),
fmt
::
sprintf
(
"watch %s @%s"
,
h_
(
foid
),
h_
(
at
)));
if
_
!=
"ok"
:
if
(
_
!=
"ok"
)
{
// XXX unregister f from _filetab
// XXX unregister f from _filetab
// 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
),
_
))
}
}
}
wconn
.
at
=
at
;
wconn
.
at
=
at
;
...
...
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