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
deb52f9d
Commit
deb52f9d
authored
Jan 15, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
dbaf1db9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wcfs/internal/wcfs.cpp
wcfs/internal/wcfs.cpp
+7
-5
No files found.
wcfs/internal/wcfs.cpp
View file @
deb52f9d
...
...
@@ -445,6 +445,8 @@ error _Conn::resync(zodb::Tid at) {
error
_Mapping
::
_remmapblk
(
int64_t
blk
,
zodb
::
Tid
at
)
{
// XXX err context? blk #<blk> @<at>
_Mapping
*
mmap
=
this
;
xerr
::
Contextf
E
(
"conn @%s: f<%s>: remmapblk #%ld @%s"
,
v
(
mmap
->
fileh
->
wconn
->
at
),
v
(
mmap
->
fileh
->
foid
),
blk
,
v
(
at
));
// XXX +wcfs path?
ASSERT
(
mmap
->
blk_start
<=
blk
&&
blk
<
mmap
->
blk_stop
());
FileH
f
=
mmap
->
fileh
;
...
...
@@ -461,7 +463,7 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) {
tie
(
fsfile
,
err
)
=
f
->
wconn
->
_wc
->
_open
(
fmt
::
sprintf
(
"@%s/bigfile/%s"
,
v
(
at
),
v
(
f
->
foid
)));
if
(
err
!=
nil
)
return
err
;
return
E
(
err
)
;
fclose
=
true
;
}
defer
([
&
]()
{
...
...
@@ -472,22 +474,22 @@ error _Mapping::_remmapblk(int64_t blk, zodb::Tid at) {
struct
stat
st
;
err
=
fsfile
->
stat
(
&
st
);
if
(
err
!=
nil
)
return
err
;
return
E
(
err
)
;
if
((
size_t
)
st
.
st_blksize
!=
f
->
blksize
)
return
fmt
::
errorf
(
"wcfs bug: blksize changed: %zd -> %ld"
,
f
->
blksize
,
st
.
st_blksize
);
return
E
(
fmt
::
errorf
(
"wcfs bug: blksize changed: %zd -> %ld"
,
f
->
blksize
,
st
.
st_blksize
)
);
// block is beyond file size - mmap with zeros - else access to memory
// after file.size will raise SIGBUS. (assumes head/f size ↑=)
if
((
blk
+
1
)
*
f
->
blksize
>
(
size_t
)
st
.
st_size
)
{
err
=
mmap_zero_into_ro
(
blkmem
,
1
*
f
->
blksize
);
if
(
err
!=
nil
)
return
err
;
return
E
(
err
)
;
}
// block is inside file - mmap file data
else
{
err
=
mmap_into_ro
(
blkmem
,
1
*
f
->
blksize
,
fsfile
,
blk
*
f
->
blksize
);
if
(
err
!=
nil
)
return
err
;
return
E
(
err
)
;
}
return
nil
;
...
...
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