/* * Get another userspace page. Returns an ERR_PTR on error. Pages are * buffered inside the dio so that we can call get_user_pages() against a * decent number of pages, less frequently. To provide nicer use of the * L1 cache. */ static struct page *dio_get_page(struct dio *dio) { if (dio_pages_present(dio) == 0) { int ret;
ret = dio_refill_pages(dio); if (ret) return ERR_PTR(ret);
BUG_ON(dio_pages_present(dio) == 0);
} return dio->pages[dio->head++]; }