Commit 2d2bc897 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6cd01d61
......@@ -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;
......
......@@ -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',
......
......@@ -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();
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment