};
};
+/*
+ * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing
+ * this issue out.
+ */
+static inline void free_buffer_page(struct buffer_page *bpage)
+{
+ reset_page_mapcount(&bpage->page);
+ bpage->page.mapping = NULL;
+ __free_page(&bpage->page);
+}
+
/*
* We need to fit the time_stamp delta into 27 bits.
*/
free_pages:
list_for_each_entry_safe(page, tmp, &pages, list) {
list_del_init(&page->list);
- __free_page(&page->page);
+ free_buffer_page(page);
}
return -ENOMEM;
}
list_for_each_entry_safe(page, tmp, head, list) {
list_del_init(&page->list);
- __free_page(&page->page);
+ free_buffer_page(page);
}
kfree(cpu_buffer);
}
p = cpu_buffer->pages.next;
page = list_entry(p, struct buffer_page, list);
list_del_init(&page->list);
- __free_page(&page->page);
+ free_buffer_page(page);
}
BUG_ON(list_empty(&cpu_buffer->pages));
free_pages:
list_for_each_entry_safe(page, tmp, &pages, list) {
list_del_init(&page->list);
- __free_page(&page->page);
+ free_buffer_page(page);
}
return -ENOMEM;
}