Commit 72eb63d0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b20611b2
......@@ -34,7 +34,7 @@
#include "../../t/t_utils.h"
#include "../../t/t_utils.c"
/* test_vmamap verifies addr -> VMA lookup. */
void test_vmamap()
{
VMA vma1, vma2, vma3;
......
......@@ -236,7 +236,7 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
goto fail;
/* allocate address space somewhere */
// XXX overlay: -> mmap(base, READ)
// XXX overlay: -> mmap(base, READ) + mmap(fileh->dirty_pages)
addr = mem_valloc(NULL, len);
if (!addr)
goto fail;
......@@ -290,6 +290,7 @@ void vma_unmap(VMA *vma)
/* unmap whole vma at once - the kernel unmaps each mapping in turn.
* NOTE error here would mean something is broken */
// XXX overlay: -> notify_unmap
xmunmap((void *)vma->addr_start, len);
/* scan through mapped-to-this-vma pages and release them */
......
......@@ -59,16 +59,6 @@ struct bigfile_ops {
*/
int (*loadblk) (BigFile *file, blk_t blk, void *buf);
/* mmap_read is called to mmap read-only file[offset +len) into @addr.
*
* XXX mmap_read -> !loadblk ?
* NOTE offset and len are in bytes, not pages.
*
* @addr NULL - mmap at anywhere, !NULL - mmap exactly at addr.
* @return !NULL - mapped there, NULL - error.
*/
void*(*mmap_read)(BigFile *file, void *addr, off_t pgoffset, size_t len);
/* storeblk is called to store file block from memory.
*
* NOTE contrary to loadblk, storeblk is called from regular context.
......@@ -78,6 +68,26 @@ struct bigfile_ops {
*/
int (*storeblk) (BigFile *file, blk_t blk, const void *buf);
/* mmap_read is called to mmap read-only file[blk +blklen) into @addr.
*
* XXX mmap_read -> !loadblk ?
* NOTE blk and blklen are in blocks, not pages.
*
* @addr NULL - mmap at anywhere, !NULL - mmap exactly at addr.
* @return !NULL - mapped there, NULL - error.
*/
void*(*mmap_read) (BigFile *file, void *addr, blk_t blk, size_t blklen);
// - mmap_setup(vma) setup initial mmap
// - mresync(vma) resync mmap to updated DB view; forget RW
// - munmap(vma) before VMA is unmapped
// /* notify_munmap XXX
// */
// void (*notify_munmap) (BigFile *file
/* release is called to release resources associated with file.
*
* The file is not otherwise used at the time of and past release call.
......
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