Fixed 2 bugs in vma_merge_object().

Looks like it had never been called before.
This commit is contained in:
Bahadir Balban
2008-10-25 12:05:26 +03:00
parent d43a98b4af
commit cb9b02a24e
2 changed files with 4 additions and 3 deletions

View File

@@ -148,7 +148,7 @@ int vma_merge_object(struct vm_object *redundant)
/* The redundant shadow object */
struct vm_object *front; /* Shadow in front of redundant */
struct vm_obj_link *last_link;
struct page *p1, *p2;
struct page *p1, *p2, *n;
/* Check link and shadow count is really 1 */
BUG_ON(redundant->nlinks != 1);
@@ -159,10 +159,10 @@ int vma_merge_object(struct vm_object *redundant)
struct vm_object, shref);
/* Move all non-intersecting pages to front shadow. */
list_for_each_entry(p1, &redundant->page_cache, list) {
list_for_each_entry_safe(p1, n, &redundant->page_cache, list) {
/* Page doesn't exist in front, move it there */
if (!(p2 = find_page(front, p1->offset))) {
list_del(&p1->list);
list_del_init(&p1->list);
spin_lock(&p1->lock);
p1->owner = front;
spin_unlock(&p1->lock);

View File

@@ -194,6 +194,7 @@ int insert_page_olist(struct page *this, struct vm_object *vmo)
list_add_tail(&this->list, &vmo->page_cache);
return 0;
}
/* Else find the right interval */
list_for_each_entry(before, &vmo->page_cache, list) {
after = list_entry(before->list.next, struct page, list);