Commit 475db2ac authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b48481c0
...@@ -902,14 +902,35 @@ out: ...@@ -902,14 +902,35 @@ out:
} }
/* PyBigFile: mmap methods.
* They redirect op X to type.blkmmapper.X without going to Python level */
static void*
pybigfile_mmap_setup_read(VMA *vma, BigFile *file0, blk_t blk, size_t blklen)
{
BUG(); // XXX
}
static int
pybigfile_remmap_blk_read(VMA *vma, BigFile *file0, blk_t blk)
{
BUG(); // XXX
}
static void
pybigfile_munmap(VMA *vma, BigFile *file0)
{
BUG(); // XXX
}
static const struct bigfile_ops pybigfile_ops = { static const struct bigfile_ops pybigfile_ops = {
.loadblk = pybigfile_loadblk, .loadblk = pybigfile_loadblk,
.storeblk = pybigfile_storeblk, .storeblk = pybigfile_storeblk,
// TODO .mmap* .mmap_setup_read = pybigfile_mmap_setup_read,
.mmap_setup_read = NULL, .remmap_blk_read = pybigfile_remmap_blk_read,
.remmap_blk_read = NULL, .munmap = pybigfile_munmap,
.munmap = NULL,
//.release = //.release =
}; };
...@@ -972,6 +993,7 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw) ...@@ -972,6 +993,7 @@ pyfile_new(PyTypeObject *type, PyObject *args, PyObject *kw)
PyObject *blkmmapper; PyObject *blkmmapper;
bigfile_ops *blkmmap_ops = NULL; bigfile_ops *blkmmap_ops = NULL;
/* try to get type.blkmmapper and verify it provides IBlkMMapper interface */
blkmmapper = PyObject_GetAttrString((PyObject*)type, "blkmmapper"); blkmmapper = PyObject_GetAttrString((PyObject*)type, "blkmmapper");
PyErr_Clear(); /* GetAttr raises exception if there is no attribute */ PyErr_Clear(); /* GetAttr raises exception if there is no attribute */
if (blkmmapper) { if (blkmmapper) {
......
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