Commit a0275a3c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9f287f7d
......@@ -1180,7 +1180,7 @@ void test_file_access_mmapbase(void)
BigFileH fh_struct, *fh = &fh_struct;
VMA vma_struct, *vma = &vma_struct;
// Page *page0, *page2, *page3;
Page *page2;
Page *page0, *page2;
size_t PS, PSb;
int fd, err;
......@@ -1291,6 +1291,23 @@ void test_file_access_mmapbase(void)
ok1(ram->lru_list.prev == &page2->lru);
ok1(page2->lru.prev == &ram->lru_list);
/* write to page[0] - page COW'ed into RAM */
B(vma, 0*PSb) = 10;
page0 = pagemap_get(&fh->pagemap, 100);
ok1( M(vma, 0)); CHECK_PAGE (page0, 100, PAGE_DIRTY, 1);
ok1(!M(vma, 1)); CHECK_NOPAGE( 101 );
ok1( M(vma, 2)); CHECK_PAGE (page2, 102, PAGE_DIRTY, 1);
ok1(!M(vma, 3)); CHECK_NOPAGE( 103 );
ok1(B(vma, 0*PSb + 0) == 10); /* set by write */
ok1(B(vma, 0*PSb + 1) == 100);
ok1(B(vma, 0*PSb + PSb - 1) == 100);
ok1(ram->lru_list.prev == &page0->lru);
ok1(page0->lru.prev == &page2->lru);
ok1(page2->lru.prev == &ram->lru_list);
}
......
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