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
2d2bc897
Commit
2d2bc897
authored
Oct 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6cd01d61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
include/wendelin/bigfile/virtmem.h
include/wendelin/bigfile/virtmem.h
+2
-1
setup.py
setup.py
+3
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+28
-1
No files found.
include/wendelin/bigfile/virtmem.h
View file @
2d2bc897
...
...
@@ -37,7 +37,8 @@
#include <wendelin/list.h>
#include <wendelin/bigfile/types.h>
#include <wendelin/bigfile/pagemap.h>
#include <ccan/bitmap/bitmap.h> // XXX can't forward-decl for bitmap
//#include <ccan/bitmap/bitmap.h> // XXX can't forward-decl for bitmap
typedef
struct
bitmap
bitmap
;
typedef
struct
RAM
RAM
;
typedef
struct
RAMH
RAMH
;
...
...
setup.py
View file @
2d2bc897
...
...
@@ -238,6 +238,9 @@ setup(
'./include'
,
'./3rdparty/ccan'
,
'./3rdparty/include'
],
extra_compile_args
=
[
'-std=gnu++11'
,
# not c++11 since we use typeof
]),
PyGoExt
(
'wcfs.internal.wcfs_test'
,
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
2d2bc897
...
...
@@ -24,6 +24,13 @@
#include <golang/libgolang.h>
using
namespace
golang
;
// XXX hack: C++ does not have __builtin_types_compatible_p, but CCAN configure
// think it does because CCAN is configired via C, not C++
#include <config.h>
#undef HAVE_BUILTIN_TYPES_COMPATIBLE_P
#define HAVE_BUILTIN_TYPES_COMPATIBLE_P 0
#include <wendelin/bigfile/virtmem.h>
#include <wendelin/bug.h>
#include <unordered_map>
...
...
@@ -173,12 +180,32 @@ void Conn::_pin1(SrvReq *req) {
_File
*
f
=
_
->
second
;
// XXX relock wconn -> f
?
// XXX relock wconn -> f
for
(
auto
mmap
:
f
->
mmaps
)
{
// XXX use ↑blk_start for binary search
if
(
!
(
mmap
->
blk_start
<=
req
->
blk
&&
req
->
blk
<
mmap
->
blk_stop
()))
continue
;
// blk ∉ mmap
// XXX reenable
//trace("\tremmapblk %d @%s" % (req->blk, (h(req.at) if req.at else "head")))
// check if virtmem did not dirtied page corresponding to this block already
virt_lock
();
if
(
!
fileh_blk_isdirty
(
mmap
->
fileh
,
req
->
blk
))
mmap
->
_remmapblk
(
req
.
blk
,
req
.
at
);
virt_unlock
();
//trace("\t-> remmaped"); XXX
}
// update f.pinned
// XXX do it before ^^^ remmapblk (so that e.g. concurrent
// discard/writeout see correct f.pinned) ?
#if 0
if req.at is None:
f.pinned.pop(req.blk, None) # = delete(f.pinned, req.blk) -- unpin to @head
else:
f.pinned[req.blk] = req.at
}
#endif
wconn
->
_filemu
.
unlock
();
}
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