Commit 3f6fdab8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 69515a9f
...@@ -1123,7 +1123,8 @@ void test_pagefault_savestate() ...@@ -1123,7 +1123,8 @@ void test_pagefault_savestate()
* Store, contrary to load, is done via regular file writes. */ * 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 */
int nstoreblk; /* number of times storeblk called */
}; };
typedef struct BigFileMMap BigFileMMap; typedef struct BigFileMMap BigFileMMap;
...@@ -1140,6 +1141,8 @@ int mmapfile_storeblk(BigFile *file, blk_t blk, const void *buf) { ...@@ -1140,6 +1141,8 @@ int mmapfile_storeblk(BigFile *file, blk_t blk, const void *buf) {
size_t n = f->blksize; size_t n = f->blksize;
off_t at = blk*f->blksize; off_t at = blk*f->blksize;
f->nstoreblk++;
while (n > 0) { while (n > 0) {
ssize_t wrote; ssize_t wrote;
wrote = pwrite(f->fd, buf, n, at); wrote = pwrite(f->fd, buf, n, at);
...@@ -1229,6 +1232,7 @@ void test_file_access_mmapbase(void) ...@@ -1229,6 +1232,7 @@ void test_file_access_mmapbase(void)
.blksize = ram->pagesize, /* artificially blksize = pagesize */ .blksize = ram->pagesize, /* artificially blksize = pagesize */
.file_ops = &mmapfile_ops, .file_ops = &mmapfile_ops,
.fd = fd, .fd = fd,
.nstoreblk = 0,
}; };
/* fstore stores data into file[blk] */ /* fstore stores data into file[blk] */
...@@ -1511,7 +1515,9 @@ void test_file_access_mmapbase(void) ...@@ -1511,7 +1515,9 @@ void test_file_access_mmapbase(void)
diag("writeout (store)"); diag("writeout (store)");
mkdirty2(10); mkdirty2(10);
file.nstoreblk = 0;
ok1(!fileh_dirty_writeout(fh, WRITEOUT_STORE)); ok1(!fileh_dirty_writeout(fh, WRITEOUT_STORE));
ok1(file.nstoreblk == 2);
ok1( M(vma, 0)); CHECK_PAGE (page0, 100, PAGE_DIRTY, 1); ok1( M(vma, 0)); CHECK_PAGE (page0, 100, PAGE_DIRTY, 1);
ok1(!M(vma, 1)); CHECK_NOPAGE( 101 ); ok1(!M(vma, 1)); CHECK_NOPAGE( 101 );
...@@ -1539,6 +1545,7 @@ void test_file_access_mmapbase(void) ...@@ -1539,6 +1545,7 @@ void test_file_access_mmapbase(void)
xmunmap(b2, PS); xmunmap(b2, PS);
diag("writeout (mark)"); diag("writeout (mark)");
ok1(!fileh_dirty_writeout(fh, WRITEOUT_MARKSTORED));
// XXX // XXX
......
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