Commit cb5c1ce6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a1a06fea
......@@ -41,12 +41,13 @@ static void* zfile_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t bl
if (err != nil)
panic("TODO"); // XXX
#if 0 // done by wcfs.cpp
mmap->incref(); // vma->mmap_overlay_server is keeping ref to mmap
vma->mmap_overlay_server = mmap._ptr();
// XXX here? -> in fileh->mmap? don't set at all here?
vma->addr_start = (uintptr_t)mmap->mem_start;
vma->addr_stop = (uintptr_t)mmap->mem_stop;
#endif
return (void*)vma->addr_start; // XXX kill if we set vma->addr_*
}
......
......@@ -450,14 +450,19 @@ pair<Mapping, error> _FileH::mmap(int64_t blk_start, int64_t blk_len, VMA *vma)
return make_pair(nil, E(err));
}
f._mmaps.push_back(mmap); // TODO keep f._mmaps ↑blk_start
// XXX vvv kill from here completely?
// (zfile_mmap_setup_read does vma->mmap_overlay_server = mmap + incref itself)
if (vma != NULL) {
vma->mmap_overlay_server = mmap._ptr(); // XXX +giveref
if (vma->mmap_overlay_server != nil)
panic("vma is already associated with overlay server");
if (!(vma->addr_start == 0 && vma->addr_stop == 0))
panic("vma already covers !nil virtual memory area");
mmap->incref(); // vma->mmap_overlay_server is keeping ref to mmap
vma->mmap_overlay_server = mmap._ptr();
vma->addr_start = (uintptr_t)mmap->mem_start;
vma->addr_stop = (uintptr_t)mmap->mem_stop;
}
f._mmaps.push_back(mmap); // TODO keep f._mmaps ↑blk_start
retok = true;
return make_pair(mmap, nil);
}
......
......@@ -33,7 +33,7 @@
// views are a bit outdated, but close to head, which means that in practice
// the kernel cache for /head/bigfile/* is being used almost 100% of the time.
//
// A mapping for bigfile X @at is built from OS-level memory mappings of
// A mapping for bigfile X@at is built from OS-level memory mappings of
// on-WCFS files as follows:
//
// ___ /@revA/bigfile/X
......
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