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
d3a45067
Commit
d3a45067
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
82f28080
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
3 deletions
+51
-3
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+51
-3
No files found.
bigfile/tests/test_virtmem.c
View file @
d3a45067
...
...
@@ -1181,8 +1181,8 @@ void test_file_access_mmapbase(void)
RAM
*
ram
;
BigFileH
fh_struct
,
*
fh
=
&
fh_struct
;
VMA
vma_struct
,
*
vma
=
&
vma_struct
;
// Page *page0, *page2, *page3
;
Page
*
page0
,
*
page2
;
VMA
vma2_struct
,
*
vma2
=
&
vma2_struct
;
Page
*
page0
,
*
page2
,
*
page3
;
blk_t
*
b0
,
*
b2
;
size_t
PS
,
PSb
;
int
fd
,
err
;
...
...
@@ -1366,8 +1366,56 @@ void test_file_access_mmapbase(void)
CHECK_MRU
(
page0
,
page2
);
CHECK_DIRTY
(
page0
,
page2
);
/* dirtying a page in one mapping automatically mmaps dirty page in all
* other wcfs mappings */
err
=
fileh_mmap
(
vma2
,
fh
,
100
,
4
);
ok1
(
!
err
);
ok1
(
fh
->
mmaps
.
next
==
&
vma
->
same_fileh
);
ok1
(
vma
->
same_fileh
.
next
==
&
vma2
->
same_fileh
);
ok1
(
vma2
->
same_fileh
.
next
==
&
fh
->
mmaps
);
ok1
(
M
(
vma
,
0
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma
,
3
));
CHECK_NOPAGE
(
103
);
ok1
(
M
(
vma2
,
0
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma2
,
1
));
CHECK_NOPAGE
(
101
);
ok1
(
M
(
vma2
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma2
,
3
));
CHECK_NOPAGE
(
103
);
CHECK_MRU
(
page0
,
page2
);
CHECK_DIRTY
(
page0
,
page2
);
B
(
vma2
,
3
*
PSb
)
=
13
;
/* write to page[3] via vma2 */
page3
=
pagemap_get
(
&
fh
->
pagemap
,
103
);
ok1
(
M
(
vma
,
0
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma
,
1
));
CHECK_NOPAGE
(
101
);
ok1
(
M
(
vma
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
2
);
ok1
(
M
(
vma
,
3
));
CHECK_PAGE
(
page3
,
103
,
PAGE_DIRTY
,
2
);
ok1
(
M
(
vma2
,
0
));
CHECK_PAGE
(
page0
,
100
,
PAGE_DIRTY
,
2
);
ok1
(
!
M
(
vma2
,
1
));
CHECK_NOPAGE
(
101
);
ok1
(
M
(
vma2
,
2
));
CHECK_PAGE
(
page2
,
102
,
PAGE_DIRTY
,
2
);
ok1
(
M
(
vma2
,
3
));
CHECK_PAGE
(
page3
,
103
,
PAGE_DIRTY
,
2
);
ok1
(
B
(
vma
,
3
*
PSb
+
0
)
==
13
);
/* set by write */
ok1
(
B
(
vma
,
3
*
PSb
+
1
)
==
103
);
ok1
(
B
(
vma
,
3
*
PSb
+
PSb
-
1
)
==
103
);
ok1
(
B
(
vma2
,
3
*
PSb
+
0
)
==
13
);
/* set by write */
ok1
(
B
(
vma2
,
3
*
PSb
+
1
)
==
103
);
ok1
(
B
(
vma2
,
3
*
PSb
+
PSb
-
1
)
==
103
);
CHECK_MRU
(
page3
,
page0
,
page2
);
CHECK_DIRTY
(
page3
,
page0
,
page2
);
// XXX fh vs fh2 vs fh.page3 dirty -> page3 appears mapped in fh2 too
// XXX read page0
// XXX read page3
...
...
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