Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
d3fe8249
Commit
d3fe8249
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
38c08e6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+38
-0
No files found.
bigfile/tests/test_virtmem.c
View file @
d3fe8249
...
@@ -1183,6 +1183,7 @@ void test_file_access_mmapbase(void)
...
@@ -1183,6 +1183,7 @@ void test_file_access_mmapbase(void)
VMA
vma_struct
,
*
vma
=
&
vma_struct
;
VMA
vma_struct
,
*
vma
=
&
vma_struct
;
// Page *page0, *page2, *page3;
// Page *page0, *page2, *page3;
Page
*
page0
,
*
page2
;
Page
*
page0
,
*
page2
;
blk_t
*
b0
,
*
b2
;
size_t
PS
,
PSb
;
size_t
PS
,
PSb
;
int
fd
,
err
;
int
fd
,
err
;
...
@@ -1314,6 +1315,43 @@ void test_file_access_mmapbase(void)
...
@@ -1314,6 +1315,43 @@ void test_file_access_mmapbase(void)
CHECK_MRU
(
page0
,
page2
);
CHECK_MRU
(
page0
,
page2
);
CHECK_DIRTY
(
page0
,
page2
);
CHECK_DIRTY
(
page0
,
page2
);
/* unmap vma - dirty pages should stay in fh->pagemap and memory should
* not be forgotten */
diag
(
"vma_unmap"
);
vma_unmap
(
vma
);
ok1
(
list_empty
(
&
fh
->
mmaps
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
0
);
CHECK_NOPAGE
(
101
);
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
0
);
CHECK_NOPAGE
(
103
);
CHECK_MRU
(
page0
,
page2
);
CHECK_DIRTY
(
page0
,
page2
);
b0
=
page_mmap
(
page0
,
NULL
,
PROT_READ
);
ok1
(
b0
);
b2
=
page_mmap
(
page2
,
NULL
,
PROT_READ
);
ok1
(
b2
);
ok1
(
b0
[
0
]
==
10
);
ok1
(
b0
[
1
]
==
100
);
ok1
(
b0
[
PSb
-
1
]
==
100
);
ok1
(
b2
[
0
]
==
12
);
ok1
(
b2
[
1
]
==
102
);
ok1
(
b2
[
PSb
-
1
]
==
102
);
xmunmap
(
b0
,
PS
);
xmunmap
(
b2
,
PS
);
// XXX verify notify_munmap was correctly called
#undef CHECK_MRU
#undef CHECK_MRU
#undef CHECK_PAGE
#undef CHECK_PAGE
#undef CHECK_NOPAGE
#undef CHECK_NOPAGE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment