Removed linux linked list dependency.

This commit is contained in:
Bahadir Balban
2009-06-02 13:19:17 +03:00
parent 4757f46f71
commit 276b4643c6
69 changed files with 455 additions and 885 deletions

View File

@@ -10,7 +10,7 @@
* of how mmaped devices would be mapped with a pager.
*/
struct mmap_device {
struct list_head page_list; /* Dyn-allocated page list */
struct link page_list; /* Dyn-allocated page list */
unsigned long pfn_start; /* Physical pfn start */
unsigned long pfn_end; /* Physical pfn end */
};
@@ -27,17 +27,17 @@ struct page *memdev_page_in(struct vm_object *vm_obj,
return PTR_ERR(-1);
/* Simply return the page if found */
list_for_each_entry(page, &memdev->page_list, list)
list_foreach_struct(page, &memdev->page_list, list)
if (page->offset == pfn_offset)
return page;
/* Otherwise allocate one of our own for that offset and return it */
page = kzalloc(sizeof(struct page));
INIT_LIST_HEAD(&page->list);
link_init(&page->list);
spin_lock_init(&page->lock);
page->offset = pfn_offset;
page->owner = vm_obj;
list_add(&page->list, &memdev->page_list);
list_insert(&page->list, &memdev->page_list);
return page;
}