mirror of
https://github.com/drasko/codezero.git
synced 2026-02-02 13:13:15 +01:00
Multiple updates on sleeping, vma dropping and thread suspend.
- Updated sleeping paths such that a task is atomically put into a runqueue and made RUNNABLE, or removed from a runqueue and made SLEEPING. - Modified vma dropping sources to handle both copy_on_write() and exit() cases in a common function. - Added the first infrastructure to have a pager to suspend a task and wait for suspend completion from the scheduler.
This commit is contained in:
@@ -133,6 +133,9 @@ int vm_object_delete(struct vm_object *vmo)
|
||||
/* Obtain and free via the base object */
|
||||
if (vmo->flags & VM_OBJ_FILE) {
|
||||
f = vm_object_to_file(vmo);
|
||||
BUG_ON(!list_empty(&f->list));
|
||||
if (f->priv_data)
|
||||
kfree(f->priv_data);
|
||||
kfree(f);
|
||||
} else if (vmo->flags & VM_OBJ_SHADOW)
|
||||
kfree(vmo);
|
||||
@@ -141,3 +144,12 @@ int vm_object_delete(struct vm_object *vmo)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vm_file_delete(struct vm_file *f)
|
||||
{
|
||||
/* Delete it from global file list */
|
||||
list_del_init(&f->list);
|
||||
|
||||
/* Delete file via base object */
|
||||
return vm_object_delete(&f->vm_obj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user