Lines Matching refs:page
53 struct page *queue;
68 #error unsupported page size
78 static void add_page_to_queue(struct page *page, struct page **p) in add_page_to_queue() argument
81 if (page->pprev_hash) in add_page_to_queue()
82 PAGE_BUG(page); in add_page_to_queue()
84 page->next_hash = *p; in add_page_to_queue()
86 (*p)->pprev_hash = &page->next_hash; in add_page_to_queue()
87 *p = page; in add_page_to_queue()
88 page->pprev_hash = p; in add_page_to_queue()
91 static void remove_page_from_queue(struct page *page) in remove_page_from_queue() argument
93 if (page->pprev_hash) { in remove_page_from_queue()
94 if (page->next_hash) in remove_page_from_queue()
95 page->next_hash->pprev_hash = page->pprev_hash; in remove_page_from_queue()
96 *page->pprev_hash = page->next_hash; in remove_page_from_queue()
97 page->pprev_hash = NULL; in remove_page_from_queue()
104 struct page *page; in __get_small_page() local
111 page = order->queue; in __get_small_page()
114 if (USED_MAP(page) & ~order->all_used) in __get_small_page()
115 PAGE_BUG(page); in __get_small_page()
117 offset = ffz(USED_MAP(page)); in __get_small_page()
118 SET_USED(page, offset); in __get_small_page()
119 if (USED_MAP(page) == order->all_used) in __get_small_page()
120 remove_page_from_queue(page); in __get_small_page()
123 return (unsigned long) page_address(page) + (offset << order->shift); in __get_small_page()
126 page = alloc_page(priority); in __get_small_page()
130 if (!page) in __get_small_page()
132 SetPageReserved(page); in __get_small_page()
133 USED_MAP(page) = 0; in __get_small_page()
135 add_page_to_queue(page, &order->queue); in __get_small_page()
137 __free_page(page); in __get_small_page()
139 page = order->queue; in __get_small_page()
151 struct page *page; in __free_small_page() local
154 page = virt_to_page(spage); in __free_small_page()
159 if (!PageReserved(page) || spage & order->mask) in __free_small_page()
163 if (USED_MAP(page) & ~order->all_used) in __free_small_page()
164 PAGE_BUG(page); in __free_small_page()
175 if (USED_MAP(page) == order->all_used) in __free_small_page()
176 add_page_to_queue(page, &order->queue); in __free_small_page()
178 if (!TEST_AND_CLEAR_USED(page, spage)) in __free_small_page()
181 if (USED_MAP(page) == 0) in __free_small_page()
192 remove_page_from_queue(page); in __free_small_page()
194 ClearPageReserved(page); in __free_small_page()
195 __free_page(page); in __free_small_page()