ENTRY;
result = +1;
- OBD_SLAB_ALLOC_PTR(page, cl_page_kmem);
+ OBD_SLAB_ALLOC_PTR_GFP(page, cl_page_kmem, CFS_ALLOC_IO);
if (page != NULL) {
atomic_set(&page->cp_ref, 1);
page->cp_obj = o;
ENTRY;
CL_PAGE_HEADER(D_TRACE, env, pg, "%i %i\n", crt, ioret);
- if (crt == CRT_READ) {
+ if (crt == CRT_READ && ioret == 0) {
PASSERT(env, pg, !(pg->cp_flags & CPF_READ_COMPLETED));
pg->cp_flags |= CPF_READ_COMPLETED;
}
(const struct lu_env *,
const struct cl_page_slice *, int), ioret);
- KLASSERT(!PageWriteback(cl_page_vmpage(env, pg)));
+ /* Don't assert the page writeback bit here because the lustre file
+ * may be as a backend of swap space. in this case, the page writeback
+ * is set by VM, and obvious we shouldn't clear it at all. Fortunately
+ * this type of pages are all TRANSIENT pages. */
+ KLASSERT(ergo(pg->cp_type == CPT_CACHEABLE,
+ !PageWriteback(cl_page_vmpage(env, pg))));
EXIT;
}
EXPORT_SYMBOL(cl_page_completion);