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
95a8df7c
Commit
95a8df7c
authored
Mar 03, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0ce9ff6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
wcfs/client/wcfs.cpp
wcfs/client/wcfs.cpp
+12
-3
No files found.
wcfs/client/wcfs.cpp
View file @
95a8df7c
...
...
@@ -204,6 +204,7 @@ static error mmap_into_ro(void *addr, size_t size, os::File f, off_t offset);
pair
<
Conn
,
error
>
WCFS
::
connect
(
zodb
::
Tid
at
)
{
WCFS
*
wc
=
this
;
xerr
::
Contextf
E
(
"wcfs %s: connect @%s"
,
v
(
wc
->
mountpoint
),
v
(
at
));
etrace
(
""
);
// TODO support !isolated mode
...
...
@@ -261,6 +262,7 @@ error _Conn::close() {
});
xerr
::
Contextf
E
(
"%s: close"
,
v
(
wconn
));
etrace
(
""
);
error
err
,
eret
;
auto
reterr1
=
[
&
eret
](
error
err
)
{
...
...
@@ -345,6 +347,7 @@ error _Conn::_pinner(context::Context ctx) {
error
_Conn
::
__pinner
(
context
::
Context
ctx
)
{
_Conn
&
wconn
=
*
this
;
xerr
::
Contextf
E
(
"pinner"
);
// NOTE pinner error goes to Conn::close who has its own context
etrace
(
""
);
PinReq
req
;
error
err
;
...
...
@@ -373,6 +376,7 @@ error _Conn::__pinner(context::Context ctx) {
error
_Conn
::
_pin1
(
PinReq
*
req
)
{
_Conn
&
wconn
=
*
this
;
xerr
::
Contextf
E
(
"pin f<%s> #%ld @%s"
,
v
(
req
->
foid
),
req
->
blk
,
v
(
req
->
at
));
etrace
(
""
);
error
err
=
wconn
.
__pin1
(
req
);
...
...
@@ -457,7 +461,7 @@ error _Conn::__pin1(PinReq *req) {
if
(
!
(
mmap
->
blk_start
<=
req
->
blk
&&
req
->
blk
<
mmap
->
blk_stop
()))
continue
;
// blk ∉ mmap
trace
(
"
\t
remmapblk %d
%s"
,
req
->
blk
,
(
req
->
at
==
TidHead
?
v
(
req
->
at
)
:
"@head"
));
trace
(
"
\t
remmapblk %d
@%s"
,
req
->
blk
,
(
req
->
at
==
TidHead
?
"head"
:
v
(
req
->
at
)
));
// pin only if virtmem did not dirtied page corresponding to this block already
// if virtmem dirtied the page - it will ask us to remmap it again after commit or abort.
...
...
@@ -512,8 +516,7 @@ error _Conn::resync(zodb::Tid at) {
wconn
.
_atMu
.
RLock
();
xerr
::
Contextf
E
(
"%s: resync -> @%s"
,
v
(
wconn
),
v
(
at
));
wconn
.
_atMu
.
RUnlock
();
etrace
(
"..."
);
etrace
(
""
);
// XXX downErr -> E
// XXX at ^ (increases)
...
...
@@ -665,6 +668,7 @@ pair<FileH, error> _Conn::open(zodb::Oid foid) {
});
xerr
::
Contextf
E
(
"%s: open f<%s>"
,
v
(
wconn
),
v
(
foid
));
etrace
(
""
);
wconn
.
_filehMu
.
Lock
();
...
...
@@ -823,6 +827,7 @@ error _FileH::close() {
// last open went away - real close.
xerr
::
Contextf
E
(
"%s: close f<%s>"
,
v
(
wconn
),
v
(
fileh
.
foid
));
etrace
(
""
);
ASSERT
(
fileh
.
_state
==
_FileHOpened
);
// there can be no open-in-progress, because
fileh
.
_state
=
_FileHClosing
;
// .close() can be called only on "opened" fileh
...
...
@@ -882,6 +887,7 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
});
xerr
::
Contextf
E
(
"%s: mmap f<%s> [blk%ld +blk%ld)"
,
v
(
f
.
wconn
),
v
(
f
.
foid
),
blk_start
,
blk_len
);
etrace
(
""
);
if
(
f
.
_state
>=
_FileHClosing
)
// XXX locking
return
make_pair
(
nil
,
E
(
os
::
ErrClosed
));
...
...
@@ -978,6 +984,7 @@ error _Mapping::unmap() {
});
xerr
::
Contextf
E
(
"%s: f<%s>: unmap"
,
v
(
f
->
wconn
),
v
(
f
->
foid
));
etrace
(
""
);
if
(
mmap
->
vma
!=
nil
)
{
mmap
->
_assertVMAOk
();
...
...
@@ -1016,6 +1023,7 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) {
_Mapping
*
mmap
=
this
;
FileH
f
=
mmap
->
fileh
;
xerr
::
Contextf
E
(
"%s: f<%s>: remmapblk #%ld @%s"
,
v
(
f
->
wconn
),
v
(
f
->
foid
),
blk
,
v
(
at
));
etrace
(
""
);
ASSERT
(
mmap
->
blk_start
<=
blk
&&
blk
<
mmap
->
blk_stop
());
error
err
;
...
...
@@ -1118,6 +1126,7 @@ tuple<os::File, error> WCFS::_open(const string &path, int flags) {
// created mapping, even after it is accessed, does not consume memory.
static
error
mmap_zero_into_ro
(
void
*
addr
,
size_t
size
)
{
xerr
::
Contextf
E
(
"mmap zero"
);
etrace
(
""
);
// mmap /dev/zero with MAP_NORESERVE and MAP_SHARED
// this way the mapping will be able to be read, but no memory will be allocated to keep it.
...
...
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