/* Returns: Pointer to a page, NULL on error.  */
PAGE* __bt_new(BTREE *t, pgno_t *npg)
/* Returns: Pointer to a page, NULL on error.  */
PAGE* __bt_new(BTREE *t, pgno_t *npg)
{
	PAGE *h;
	if (t->bt_free != P_INVALID &&
	    (h = mpool_get(t->bt_mp, t->bt_free, 0)) != NULL) {
		*npg = t->bt_free;
		t->bt_free = h->nextpg;
		F_SET(t, B_METADIRTY);
		return (h);
	}
	return (mpool_new(t->bt_mp, npg));
}