Commit b24422e5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a5a55c6f
...@@ -1118,7 +1118,9 @@ void test_pagefault_savestate() ...@@ -1118,7 +1118,9 @@ void test_pagefault_savestate()
* data and everything else comes as read-only mmap from wcfs file. * data and everything else comes as read-only mmap from wcfs file.
*/ */
/* file that mmaps blkdata */ // XXX /* BigFileMMap is BigFile that mmaps blkdata for read from a regular file.
*
* Store, contrary to load, is done via regular file writes. */
struct BigFileMMap { struct BigFileMMap {
BigFile; BigFile;
int fd; /* fd of file to mmap */ int fd; /* fd of file to mmap */
...@@ -1171,6 +1173,7 @@ static const struct bigfile_ops mmapfile_ops = { ...@@ -1171,6 +1173,7 @@ static const struct bigfile_ops mmapfile_ops = {
}; };
/* verify virtmem behaviour when it is given BigFile with .mmap_* to handle data load. */
void test_file_access_mmapbase(void) void test_file_access_mmapbase(void)
{ {
RAM *ram; RAM *ram;
...@@ -1211,7 +1214,7 @@ void test_file_access_mmapbase(void) ...@@ -1211,7 +1214,7 @@ void test_file_access_mmapbase(void)
.fd = fd, .fd = fd,
}; };
/* fstore stores date into file[blk] */ /* fstore stores data into file[blk] */
void fstore(blk_t blk, blk_t data) { void fstore(blk_t blk, blk_t data) {
blk_t *buf; blk_t *buf;
int i; int i;
...@@ -1361,8 +1364,8 @@ void test_file_access_mmapbase(void) ...@@ -1361,8 +1364,8 @@ void test_file_access_mmapbase(void)
CHECK_MRU (page0, page2); CHECK_MRU (page0, page2);
CHECK_DIRTY (page0, page2); CHECK_DIRTY (page0, page2);
/* dirtying a page in one mapping automatically mmaps dirty page in all /* dirtying a page in one mapping should automatically mmap the dirty page
* other wcfs mappings */ * in all other wcfs mappings */
diag("dirty page in vma2 -> dirties vma1"); diag("dirty page in vma2 -> dirties vma1");
err = fileh_mmap(vma2, fh, 100, 4); err = fileh_mmap(vma2, fh, 100, 4);
ok1(!err); ok1(!err);
...@@ -1376,10 +1379,10 @@ void test_file_access_mmapbase(void) ...@@ -1376,10 +1379,10 @@ void test_file_access_mmapbase(void)
ok1( M(vma, 2)); CHECK_PAGE (page2, 102, PAGE_DIRTY, 2); ok1( M(vma, 2)); CHECK_PAGE (page2, 102, PAGE_DIRTY, 2);
ok1(!M(vma, 3)); CHECK_NOPAGE( 103 ); ok1(!M(vma, 3)); CHECK_NOPAGE( 103 );
ok1( M(vma2, 0)); CHECK_PAGE (page0, 100, PAGE_DIRTY, 2); ok1( M(vma2, 0));
ok1(!M(vma2, 1)); CHECK_NOPAGE( 101 ); ok1(!M(vma2, 1));
ok1( M(vma2, 2)); CHECK_PAGE (page2, 102, PAGE_DIRTY, 2); ok1( M(vma2, 2));
ok1(!M(vma2, 3)); CHECK_NOPAGE( 103 ); ok1(!M(vma2, 3));
CHECK_MRU (page0, page2); CHECK_MRU (page0, page2);
CHECK_DIRTY (page0, page2); CHECK_DIRTY (page0, page2);
......
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