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

.

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