/* * These three functions resize the page pool. */ static void drop_pages(struct page_list *pl) { struct page_list *next; while (pl) { next = pl->next; free_pl(pl); pl = next; } }
void free_test(test_t *t) { if (t == NULL) return; switch (t->type) { case ANYOF: case ALLOF: free_tl(t->u.tl); break; case EXISTS: free_sl(t->u.sl); break; case SIZE: case SFALSE: case STRUE: break; case HEADER: free_sl(t->u.h.sl); free_pl(t->u.h.pl, t->u.h.comptag); break; case ADDRESS: free_sl(t->u.ae.sl); free_pl(t->u.ae.pl, t->u.ae.comptag); break; case NOT: free_test(t->u.t); break; } free(t); }
/* * Add the provided pages to a client's free page list, releasing * back to the system any beyond the reserved_pages limit. */ static void kcopyd_put_pages(struct dm_kcopyd_client *kc, struct page_list *pl) { struct page_list *next; do { next = pl->next; if (kc->nr_free_pages >= kc->nr_reserved_pages) free_pl(pl); else { pl->next = kc->pages; kc->pages = pl; kc->nr_free_pages++; } pl = next; } while (pl); }