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
786cab49
Commit
786cab49
authored
Oct 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8d9067f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+3
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+10
-7
No files found.
wcfs/internal/wcfs_misc.h
View file @
786cab49
...
...
@@ -28,6 +28,9 @@ using std::string;
#include <tuple>
using
std
::
tuple
;
// nil is synonim for nullptr and NULL.
const
nullptr_t
nil
=
nullptr
;
// error mimics error from Go.
struct
error
{
string
err
;
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
786cab49
...
...
@@ -123,7 +123,7 @@ struct _Mapping {
return
blk_start
+
(
mem_stop
-
mem_start
)
/
file
->
blksize
;
}
void
_remmapblk
(
int64_t
blk
,
Tid
at
);
error
_remmapblk
(
int64_t
blk
,
Tid
at
);
};
...
...
@@ -211,7 +211,7 @@ void Conn::_pin1(SrvReq *req) {
virt_lock
();
TODO
(
mmap
->
file
->
blksize
!=
mmap
->
fileh
->
ramh
->
ram
->
pagesize
);
if
(
!
__fileh_page_isdirty
(
mmap
->
fileh
,
req
->
blk
))
mmap
->
_remmapblk
(
req
->
blk
,
req
->
at
);
mmap
->
_remmapblk
(
req
->
blk
,
req
->
at
);
// XXX err
virt_unlock
();
//trace("\t-> remmaped"); XXX
}
...
...
@@ -234,7 +234,7 @@ void Conn::_pin1(SrvReq *req) {
//
// at=None means unpin to head/ . XXX -> C
// NOTE this does not check wrt virtmem already mapped blk as RW.
void
_Mapping
::
_remmapblk
(
int64_t
blk
,
Tid
at
)
{
error
_Mapping
::
_remmapblk
(
int64_t
blk
,
Tid
at
)
{
// XXX err context?
_Mapping
*
mmap
=
this
;
...
...
@@ -248,8 +248,9 @@ void _Mapping::_remmapblk(int64_t blk, Tid at) {
}
else
{
// TODO share @rev fd until wconn is resynced?
fsfile
=
f
->
wconn
->
_wc
->
_open
(
"@%s/bigfile/%s"
%
(
h
(
at
),
h
(
f
->
foid
)),
"rb"
)
defer
(
fsfile
.
close
)
fsfile
=
f
->
wconn
->
_wc
->
_open
(
"@%s/bigfile/%s"
%
(
h
(
at
),
h
(
f
->
foid
)),
"rb"
);
// XXX err
defer
(
fsfile
.
close
);
}
struct
stat
st
;
...
...
@@ -260,12 +261,14 @@ void _Mapping::_remmapblk(int64_t blk, Tid at) {
// block is beyond file size - mmap with zeros (assumes head/f size ↑=)
if
((
blk
+
1
)
*
f
->
blksize
>
st
.
st_size
)
{
mm
.
map_zero_into_ro
(
blkmem
);
mm
.
map_zero_into_ro
(
blkmem
);
// XXX err
}
// block is inside file - mmap file data
else
{
mm
.
map_into_ro
(
blkmem
,
fsfile
.
fd
,
blk
*
f
->
blksize
);
mm
.
map_into_ro
(
blkmem
,
fsfile
.
fd
,
blk
*
f
->
blksize
);
// XXX 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