mirror of
https://github.com/drasko/codezero.git
synced 2026-04-06 20:19:04 +02:00
More updates to vm object handling.
Added a list of links for vm objects so they can follow the links that point at them. More succinct handling of the case where a vm object is dropped. Now depending on the object's number of link references and shadow references, upon a drop it could either be merged, deleted or kept. Added opener reference count for vm files. Now files have opener count, objects have shadow and link count. Link count is also meaningful for how many tasks have mmap'ed that object.
This commit is contained in:
@@ -533,8 +533,11 @@ int do_mmap(struct vm_file *mapfile, unsigned long file_offset,
|
||||
kfree(new);
|
||||
return -ENOMEM;
|
||||
}
|
||||
vmo_link->obj = &mapfile->vm_obj;
|
||||
mapfile->vm_obj.refcnt++;
|
||||
|
||||
/* Attach link to object */
|
||||
vm_link_object(vmo_link, &mapfile->vm_obj);
|
||||
|
||||
/* ADd link to vma list */
|
||||
list_add_tail(&vmo_link->list, &new->vm_obj_list);
|
||||
|
||||
/*
|
||||
@@ -556,8 +559,7 @@ int do_mmap(struct vm_file *mapfile, unsigned long file_offset,
|
||||
kfree(vmo_link);
|
||||
return -ENOMEM;
|
||||
}
|
||||
vmo_link2->obj = &dzero->vm_obj;
|
||||
dzero->vm_obj.refcnt++;
|
||||
vm_link_object(vmo_link2, &dzero->vm_obj);
|
||||
list_add_tail(&vmo_link2->list, &new->vm_obj_list);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user