Commit 3dcac7d7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2b3de554
...@@ -105,22 +105,21 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]: ...@@ -105,22 +105,21 @@ cdef public class _ZBigFile(BigFile) [object _ZBigFile, type _ZBigFile_Type]:
# functions that we give to virtmem bigfile_ops .mmap* # functions that we give to virtmem bigfile_ops .mmap*
""" cdef extern from * nogil:
cdef nogil: """
void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) { void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) {
FileH fileh; # XXX = ... somehow from file wcfs::FileH fileh; // XXX = ... somehow from file
Mapping mmap; wcfs::Mapping mmap;
error err; error err;
tie(mmap, err) = fileh->mmap(blk, blklen, vma); tie(mmap, err) = fileh->mmap(blk, blklen, vma);
if (err != nil) if (err != nil)
panic("TODO"); # XXX panic("TODO"); // XXX
mmap->incref(); # vma->mmap_overlay_server is keeping ref to mmap mmap->incref(); // vma->mmap_overlay_server is keeping ref to mmap
vma->mmap_overlay_server = mmap._ptr(); vma->mmap_overlay_server = mmap._ptr();
# XXX here? -> in fileh->mmap? don't set at all here? // XXX here? -> in fileh->mmap? don't set at all here?
vma->addr_start = (uintptr_t)mmap->mem_start; vma->addr_start = (uintptr_t)mmap->mem_start;
vma->addr_stop = (uintptr_t)mmap->mem_stop; vma->addr_stop = (uintptr_t)mmap->mem_stop;
...@@ -128,7 +127,7 @@ cdef nogil: ...@@ -128,7 +127,7 @@ cdef nogil:
} }
int virt_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) { int virt_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
_Mapping *mmap = static_cast<_Mapping*>(vma->mmap_overlay_server); wcfs::_Mapping *mmap = static_cast<wcfs::_Mapping*>(vma->mmap_overlay_server);
// XXX use file? // XXX use file?
mmap->remmap_blk(blk); // XXX err mmap->remmap_blk(blk); // XXX err
...@@ -137,14 +136,16 @@ cdef nogil: ...@@ -137,14 +136,16 @@ cdef nogil:
void virt_munmap(VMA *vma, BigFile *file) { void virt_munmap(VMA *vma, BigFile *file) {
Mapping mmap = adoptref(static_cast<_Mapping*>(vma->mmap_overlay_server)); // NOTE taking 1 ref back // NOTE taking 1 ref back from vma->mmap_overlay_server
wcfs::Mapping mmap = adoptref(static_cast<wcfs::_Mapping*>(vma->mmap_overlay_server));
vma->mmap_overlay_server = NULL; vma->mmap_overlay_server = NULL;
mmap->unmap(); mmap->unmap();
// XXX close mmap->fileh // XXX close mmap->fileh
} }
""" """
pass
......
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