tcb_destroy() in pager and fs0 now caters for shared structures.

This commit is contained in:
Bahadir Balban
2008-11-09 10:40:18 +02:00
parent 63fb907cd0
commit b387a0526a
2 changed files with 11 additions and 0 deletions

View File

@@ -148,6 +148,11 @@ void tcb_destroy(struct tcb *task)
{
global_remove_task(task);
if (--task->fs_data->tcb_refs == 0)
kfree(task->fs_data);
if (--task->files->tcb_refs == 0)
kfree(task->files);
kfree(task);
}

View File

@@ -49,6 +49,7 @@ void global_add_task(struct tcb *task)
list_add_tail(&task->list, &global_tasks.list);
global_tasks.total++;
}
void global_remove_task(struct tcb *task)
{
BUG_ON(list_empty(&task->list));
@@ -115,6 +116,11 @@ int tcb_destroy(struct tcb *task)
{
global_remove_task(task);
if (--task->vm_area_head->tcb_refs == 0)
kfree(task->vm_area_head);
if (--task->files->tcb_refs == 0)
kfree(task->files);
kfree(task);
return 0;