Commit 260b1d29 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c6c69c5a
......@@ -17,13 +17,15 @@
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// File file_zodb.cpp provides blkmmapper functions for _ZBigFile.
#include "wcfs/internal/wcfs.h"
#include "wendelin/bigfile/file.h"
#include "wendelin/bigfile/virtmem.h"
#include "bigfile/_bigfile.h"
#include "bigfile/_file_zodb.h"
void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) {
void* zfile_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) {
//_ZBigFile* _zfile = static_cast<_ZBigFile*>(file);
_ZBigFile* _zfile = NULL; // XXX
......@@ -45,7 +47,7 @@ void* virt_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blklen) {
return (void*)vma->addr_start; // XXX kill if we set vma->addr_*
}
int virt_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
int zfile_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
wcfs::_Mapping *mmap = static_cast<wcfs::_Mapping*>(vma->mmap_overlay_server);
// XXX use file?
......@@ -54,7 +56,7 @@ int virt_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
}
void virt_munmap(VMA *vma, BigFile *file) {
void zfile_munmap(VMA *vma, BigFile *file) {
// 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;
......@@ -63,3 +65,11 @@ void virt_munmap(VMA *vma, BigFile *file) {
// XXX close mmap->fileh
}
//const VirtMMapper zfile_mmapper = {
const bigfile_ops zfile_mmap_ops = {
.mmap_setup_read = zfile_mmap_setup_read,
.remmap_blk_read = zfile_remmap_blk_read,
.munmap = zfile_munmap,
};
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