* the pages will be transient. We don't care about
* the return code of cl_page_prep() at all.
*/
- (void) cl_page_prep(env, ios->cis_io, page, crt);
+ LASSERT(page->cp_type == CPT_TRANSIENT);
cl_page_completion(env, page, crt, 0);
continue;
}
{
/* Page is queued for IO, change its state. */
ENTRY;
- if (pg->cp_type != CPT_TRANSIENT) {
- cl_page_owner_clear(pg);
- cl_page_state_set(env, pg, cl_req_type_state(crt));
- }
+ cl_page_owner_clear(pg);
+ cl_page_state_set(env, pg, cl_req_type_state(crt));
EXIT;
}
struct page *vmpage = cp->cp_vmpage;
int rc;
- if (cp->cp_type == CPT_TRANSIENT)
- GOTO(start, rc = 0);
+ LASSERT(cp->cp_type != CPT_TRANSIENT);
PASSERT(env, cp, crt < CRT_NR);
PINVRNT(env, cp, cl_page_is_owned(cp, io));
PINVRNT(env, cp, cl_page_invariant(cp));
if (cp->cp_sync_io == NULL)
set_page_writeback(vmpage);
}
-start:
cl_page_io_start(env, cp, crt);
rc = 0;
ENTRY;
PASSERT(env, cp, crt == CRT_WRITE);
-
- if (cp->cp_type == CPT_TRANSIENT)
- GOTO(out, rc = 0);
+ LASSERT(cp->cp_type != CPT_TRANSIENT);
lock_page(vmpage);
PASSERT(env, cp, PageUptodate(vmpage));
LBUG();
}
-out:
if (rc == 0) {
PASSERT(env, cp, cp->cp_state == CPS_CACHED);
cl_page_io_start(env, cp, crt);
unsigned int ppc_bits; /* pages per chunk bits */
unsigned int ppc;
bool sync_queue = false;
+ bool dio = false;
LASSERT(qin->pl_nr > 0);
brw_flags |= OBD_BRW_NDELAY;
page = cl_page_list_first(qin);
- if (page->cp_type == CPT_TRANSIENT)
+ if (page->cp_type == CPT_TRANSIENT) {
brw_flags |= OBD_BRW_NOCACHE;
+ dio = true;
+ }
if (lnet_is_rdma_only_page(page->cp_vmpage))
brw_flags |= OBD_BRW_RDMA_ONLY;
break;
}
- result = cl_page_prep(env, top_io, page, crt);
- if (result != 0) {
- LASSERT(result < 0);
- if (result != -EALREADY)
- break;
- /*
- * Handle -EALREADY error: for read case, the page is
- * already in UPTODATE state; for write, the page
- * is not dirty.
- */
- result = 0;
- continue;
- }
+ if (!dio) {
+ result = cl_page_prep(env, top_io, page, crt);
+ if (result != 0) {
+ LASSERT(result < 0);
+ if (result != -EALREADY)
+ break;
+ /*
+ * Handle -EALREADY error: for read case, the
+ * page is already in UPTODATE state; for
+ * write, the page is not dirty.
+ */
+ result = 0;
+ continue;
+ }
+ }
- if (page->cp_type != CPT_TRANSIENT) {
+ if (!dio)
oap->oap_async_flags = ASYNC_URGENT|ASYNC_READY|ASYNC_COUNT_STABLE;
- }
osc_page_submit(env, opg, crt, brw_flags);
list_add_tail(&oap->oap_pending_item, &list);