};
enum otp_flags {
- ASYNC_READY = 0x1, /* ap_make_ready will not be called before
+ OTP_READY = 0x1, /* ake_ready will not be called before
* this page is added to an rpc */
- ASYNC_URGENT = 0x2, /* page must be put into RPC before return */
- ASYNC_COUNT_STABLE = 0x4, /* ap_refresh_count will not be called
+ OTP_URGENT = 0x2, /* page must be put into RPC before return */
+ OTP_COUNT_STABLE = 0x4, /* refresh_count will not be called
to give the caller a chance to update
or cancel the size of the io */
- ASYNC_HP = 0x8,
- OTP_ASYNC_MAX,
- OTP_ASYNC_BITS = 4
+ OTP_HP = 0x8,
+ OTP_FLAG_MAX,
+ OTP_FLAG_BITS = 4
};
struct osc_transfer_page {
unsigned int otp_page_off:PAGE_SHIFT,
otp_cmd:OBD_BRW_WRITE,
- otp_flags:OTP_ASYNC_BITS,
+ otp_flags:OTP_FLAG_BITS,
/**
* Set if the page must be transferred with OBD_BRW_SRVLOCK.
*/
static inline struct osc_transfer_page *brw_page2otp(struct brw_page *pga)
{
- BUILD_BUG_ON(OTP_ASYNC_MAX - 1 >= (1 << OTP_ASYNC_BITS));
+ BUILD_BUG_ON(OTP_FLAG_MAX - 1 >= (1 << OTP_FLAG_BITS));
return container_of(pga, struct osc_transfer_page, otp_brw_page);
}
extern struct lu_context_key osc_key;
extern struct lu_context_key osc_session_key;
-#define OSC_FLAGS (ASYNC_URGENT|ASYNC_READY)
-
/* osc_page.c */
int osc_dio_pages_init(const struct lu_env *env, struct cl_object *obj,
struct cl_dio_pages *cdp, pgoff_t index);
if (last == NULL || last->otp_obj_off < otp->otp_obj_off)
last = otp;
- /* checking ASYNC_READY is race safe */
- if ((otp->otp_flags & ASYNC_READY) != 0)
+ /* checking OTP_READY is race safe */
+ if ((otp->otp_flags & OTP_READY) != 0)
continue;
rc = osc_make_ready(env, otp, OBD_BRW_WRITE);
switch (rc) {
case 0:
- otp->otp_flags |= ASYNC_READY;
+ otp->otp_flags |= OTP_READY;
break;
case -EALREADY:
- LASSERT((otp->otp_flags & ASYNC_READY) != 0);
+ LASSERT((otp->otp_flags & OTP_READY) != 0);
break;
default:
LASSERTF(0, "unknown return code: %d\n", rc);
LASSERT(last != NULL);
/* the last page is the only one we need to refresh its count by
* the size of file. */
- if (!(last->otp_flags & ASYNC_COUNT_STABLE)) {
+ if (!(last->otp_flags & OTP_COUNT_STABLE)) {
int last_otp_count = osc_refresh_count(env, obj, last,
OBD_BRW_WRITE);
LASSERTF(last_otp_count > 0,
"last_otp_count %d\n", last_otp_count);
LASSERT(last->otp_page_off + last_otp_count <= PAGE_SIZE);
last->otp_count = last_otp_count;
- last->otp_flags |= ASYNC_COUNT_STABLE;
+ last->otp_flags |= OTP_COUNT_STABLE;
}
/* for the rest of pages, we don't need to call osf_refresh_count()
* because it's known they are not the last page */
list_for_each_entry(otp, &ext->oe_pages, otp_pending_item) {
- if (!(otp->otp_flags & ASYNC_COUNT_STABLE)) {
+ if (!(otp->otp_flags & OTP_COUNT_STABLE)) {
otp->otp_count = PAGE_SIZE - otp->otp_page_off;
- otp->otp_flags |= ASYNC_COUNT_STABLE;
+ otp->otp_flags |= OTP_COUNT_STABLE;
}
}
}
/**
- * prepare pages for ASYNC io and put pages in send queue.
+ * prepare pages for OTP io and put pages in send queue.
*
* \param cmd OBD_BRW_* macroses
* \param lop pending pages
* cl_page_clip later to set this.
*/
if (page->cp_type == CPT_TRANSIENT)
- otp->otp_flags |= ASYNC_COUNT_STABLE|ASYNC_URGENT|
- ASYNC_READY;
+ otp->otp_flags |= OTP_COUNT_STABLE|OTP_URGENT|
+ OTP_READY;
INIT_LIST_HEAD(&otp->otp_pending_item);
INIT_LIST_HEAD(&otp->otp_rpc_item);
if (rc)
GOTO(out, rc);
- otp->otp_flags |= ASYNC_READY|ASYNC_URGENT;
+ otp->otp_flags |= OTP_READY|OTP_URGENT;
if (current->flags & PF_MEMALLOC)
ext->oe_memalloc = 1;
otp->otp_page_off = from;
otp->otp_count = to - from;
- otp->otp_flags |= ASYNC_COUNT_STABLE;
+ otp->otp_flags |= OTP_COUNT_STABLE;
}
static int osc_page_flush(const struct lu_env *env,
struct osc_transfer_page *otp = &opg->ops_otp;
struct osc_io *oio = osc_env_io(env);
- LASSERT(otp->otp_flags & ASYNC_READY);
- LASSERT(otp->otp_flags & ASYNC_COUNT_STABLE);
+ LASSERT(otp->otp_flags & OTP_READY);
+ LASSERT(otp->otp_flags & OTP_COUNT_STABLE);
otp->otp_cmd = crt == CRT_WRITE ? OBD_BRW_WRITE : OBD_BRW_READ;
otp->otp_brw_flags = OBD_BRW_SYNC | brw_flags;