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
fed7c147
Commit
fed7c147
authored
Dec 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
74d170c6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
25 deletions
+25
-25
wcfs/__init__.py
wcfs/__init__.py
+0
-23
wcfs/internal/wcfs_misc.cpp
wcfs/internal/wcfs_misc.cpp
+8
-0
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+1
-1
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+16
-1
No files found.
wcfs/__init__.py
View file @
fed7c147
...
...
@@ -87,29 +87,6 @@ class WCFS(_WCFS):
# ._proc wcfs process if it was opened by this WCFS | None
pass
"""
# remmap_blk remmaps file[blk] in its place again.
# virtmem calls this to remmap a block after RW dirty page was e.g. discarded.
@func(_Mapping)
def remmap_blk(mmap, blk):
# XXX locking
assert (mmap.blk_start <= blk < mmap.blk_stop)
blkrev = mmap.pinned.get(blk, None) # rev | @head
mmap._remmapblk(blk, blkrev)
# unmap is removes mapping memory from address space.
# virtmem calls this when VMA is unmapped.
@func(_Mapping)
def unmap(mmap):
# XXX locking
mm.unmap(mmap.mem)
mmap.mem = None
f = mmap.file
f.mmaps.remove(mmap)
"""
# ---- WCFS raw file access ----
...
...
wcfs/internal/wcfs_misc.cpp
View file @
fed7c147
...
...
@@ -173,6 +173,14 @@ error map_into(void *addr, size_t size, int prot, int flags, os::File f, off_t o
return
nil
;
}
// unmap unmaps [addr +size) memory previously mapped with map & co.
error
unmap
(
void
*
addr
,
size_t
size
)
{
int
err
=
::
munmap
(
addr
,
size
);
if
(
err
!=
0
)
return
os
::
_pathError
(
"munmap"
,
"<memory>"
/*XXX ok?*/
,
errno
);
return
nil
;
}
}
// mm::
...
...
wcfs/internal/wcfs_misc.h
View file @
fed7c147
...
...
@@ -122,7 +122,7 @@ tuple<File, error> open(const string &path, int flags = O_RDONLY,
namespace
mm
{
tuple
<
uint8_t
*
,
error
>
map
(
int
prot
,
int
flags
,
os
::
File
f
,
off_t
offset
,
size_t
size
);
error
map_into
(
void
*
addr
,
size_t
size
,
int
prot
,
int
flags
,
os
::
File
f
,
off_t
offset
);
// XXX unmap
error
unmap
(
void
*
addr
,
size_t
size
);
}
// mm::
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
fed7c147
...
...
@@ -87,6 +87,7 @@ struct _Mapping {
error
_remmapblk
(
int64_t
blk
,
zodb
::
Tid
at
);
void
remmap_blk
(
int64_t
blk
);
void
unmap
();
};
...
...
@@ -481,7 +482,21 @@ void _Mapping::remmap_blk(int64_t blk) {
mmap
.
_remmapblk
(
blk
,
blkrev
);
// XXX err
}
// XXX _Mapping::unmap
// unmap removes mapping memory from address space.
// virtmem calls this when VMA is unmapped.
void
_Mapping
::
unmap
()
{
_Mapping
*
mmap
=
this
;
// XXX locking
mm
::
unmap
(
mmap
->
mem_start
,
mmap
->
mem_stop
-
mmap
->
mem_start
);
// XXX err?
mmap
->
mem_start
=
NULL
;
mmap
->
mem_stop
=
NULL
;
// XXX clear other fields?
_File
*
f
=
mmap
->
file
;
//f->mmaps.remove(mmap);
std
::
remove
(
f
->
mmaps
.
begin
(),
f
->
mmaps
.
end
(),
mmap
);
// XXX keep mmaps sorted
}
// ---- WCFS raw file access ----
...
...
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