Skip to content
Snippets Groups Projects
Verified Commit 3a80528d authored by Jacob Lorentzon's avatar Jacob Lorentzon :speech_balloon:
Browse files

Fix MAP_LAZY mappings.

parent cbec8321
No related branches found
No related tags found
1 merge request!238Demand paging
......@@ -364,8 +364,12 @@ impl UserInner {
}
pub fn request_fmap(&self, id: usize, offset: u64, required_page_count: usize, flags: MapFlags) -> Result<()> {
log::info!("REQUEST FMAP");
let packet_id = self.next_id();
self.fmap.lock().insert(packet_id, Arc::downgrade(&context::current()?));
self.todo.send(Packet {
id: self.next_id(),
id: packet_id,
pid: context::context_id().into(),
a: KSMSG_MMAP,
b: id,
......@@ -502,8 +506,10 @@ impl UserInner {
gid: (map.offset >> 32) as u32,
})?;
let mapping_is_lazy = map.flags.contains(MapFlags::MAP_LAZY);
let base_page_opt = match response {
Response::Regular(code) => (!map.flags.contains(MapFlags::MAP_LAZY))
Response::Regular(code) => (!mapping_is_lazy)
.then_some(Error::demux(code)?),
Response::Fd(_) => {
log::debug!("Scheme incorrectly returned an fd for fmap.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment