mirror of
https://github.com/drasko/codezero.git
synced 2026-02-08 07:53:16 +01:00
Removed linux linked list dependency.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user