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
3f6fdab8
Commit
3f6fdab8
authored
Jul 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
69515a9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+8
-1
No files found.
bigfile/tests/test_virtmem.c
View file @
3f6fdab8
...
@@ -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
...
...
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