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
10db71c2
Commit
10db71c2
authored
Apr 14, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
03aa7ebd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
13 deletions
+20
-13
bigfile/file_zodb.cpp
bigfile/file_zodb.cpp
+13
-7
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+2
-1
bigfile/virtmem.c
bigfile/virtmem.c
+2
-1
include/wendelin/bigfile/file.h
include/wendelin/bigfile/file.h
+3
-4
No files found.
bigfile/file_zodb.cpp
View file @
10db71c2
...
...
@@ -39,8 +39,7 @@ static int zfile_mmap_setup_read(VMA *vma, BigFile *file, blk_t blk, size_t blkl
tie
(
mmap
,
err
)
=
fileh
->
mmap
(
blk
,
blklen
,
vma
);
if
(
err
!=
nil
)
{
// XXX no way to return error details to virtmem
log
::
Errorf
(
"%s: mmap_setup_read #[%d +%d): %s"
,
v
(
fileh
),
blk
,
blklen
,
v
(
err
));
log
::
Errorf
(
"%s"
,
v
(
err
));
// XXX no way to return error details to virtmem
return
-
1
;
}
...
...
@@ -56,13 +55,16 @@ static int zfile_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
error
err
;
err
=
mmap
->
remmap_blk
(
blk
);
if
(
err
!=
nil
)
panic
(
v
(
err
));
// XXX
if
(
err
!=
nil
)
{
log
::
Errorf
(
"%s"
,
v
(
err
));
// XXX no way to return error details to virtmem
return
-
1
;
}
return
0
;
}
static
void
zfile_munmap
(
VMA
*
vma
,
BigFile
*
file
)
{
static
int
zfile_munmap
(
VMA
*
vma
,
BigFile
*
file
)
{
wcfs
::
_Mapping
*
mmap
=
static_cast
<
wcfs
::
_Mapping
*>
(
vma
->
mmap_overlay_server
);
_ZBigFile
*
_zfile
=
container_of
(
file
,
_ZBigFile
,
__pyx_base
.
file
);
...
...
@@ -71,8 +73,12 @@ static void zfile_munmap(VMA *vma, BigFile *file) {
error
err
;
err
=
mmap
->
unmap
();
if
(
err
!=
nil
)
panic
(
v
(
err
));
// XXX
if
(
err
!=
nil
)
{
log
::
Errorf
(
"%s"
,
v
(
err
));
// XXX no way to return error details to virtmem
return
-
1
;
}
return
0
;
}
...
...
bigfile/tests/test_virtmem.c
View file @
10db71c2
...
...
@@ -1191,12 +1191,13 @@ int mmapfile_remmap_blk_read(VMA *vma, BigFile *file, blk_t blk) {
return
0
;
}
void
mmapfile_munmap
(
VMA
*
vma
,
BigFile
*
file
)
{
int
mmapfile_munmap
(
VMA
*
vma
,
BigFile
*
file
)
{
BigFileMMap
*
f
=
upcast
(
BigFileMMap
*
,
file
);
size_t
len
=
vma
->
addr_stop
-
vma
->
addr_start
;
f
->
nmunmap
++
;
xmunmap
((
void
*
)
vma
->
addr_start
,
len
);
return
0
;
}
static
const
struct
bigfile_ops
mmapfile_ops
=
{
...
...
bigfile/virtmem.c
View file @
10db71c2
...
...
@@ -337,7 +337,8 @@ void vma_unmap(VMA *vma)
/* unmap whole vma at once - the kernel unmaps each mapping in turn.
* NOTE error here would mean something is broken */
if
(
fileh
->
mmap_overlay
)
{
fileh
->
file
->
file_ops
->
munmap
(
vma
,
fileh
->
file
);
int
err
=
fileh
->
file
->
file_ops
->
munmap
(
vma
,
fileh
->
file
);
BUG_ON
(
err
);
}
else
{
xmunmap
((
void
*
)
vma
->
addr_start
,
len
);
}
...
...
include/wendelin/bigfile/file.h
View file @
10db71c2
...
...
@@ -157,17 +157,16 @@ struct bigfile_ops {
* RW dirty page was discarded.
*
* Called under virtmem lock. XXX hard to rework to call with !virt_lock
*
* XXX error -> bug (must not fail)
* Virtmem considers remmap_blk_read failure as fatal.
*/
int
(
*
remmap_blk_read
)
(
VMA
*
vma
,
BigFile
*
file
,
blk_t
blk
);
/* munmap is called when vma set up via mmap_setup_read is going to be unmapped.
*
* Called under virtmem lock. TODO easy to rework to call with !virt_lock
*
Must not fai
l.
*
Virtmem considers munmap failure as fata
l.
*/
void
(
*
munmap
)
(
VMA
*
vma
,
BigFile
*
file
);
int
(
*
munmap
)
(
VMA
*
vma
,
BigFile
*
file
);
};
typedef
struct
bigfile_ops
bigfile_ops
;
...
...
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