@@ -762,6 +762,8 @@ struct cl_page {
struct lu_ref_link cp_queue_ref;
/** Assigned if doing a sync_io */
struct cl_sync_io *cp_sync_io;
+ /** layout_entry + stripe index, composed using lov_comp_index() */
+ unsigned int cp_lov_index;
};
/**
@@ -440,8 +440,6 @@ struct lov_lock {
struct lov_page {
struct cl_page_slice lps_cl;
- /** layout_entry + stripe index, composed using lov_comp_index() */
- unsigned int lps_index;
/* the layout gen when this page was created */
u32 lps_layout_gen;
};
@@ -189,17 +189,6 @@ struct lov_io_sub *lov_sub_get(const struct lu_env *env,
* Lov io operations.
*
*/
-static int lov_page_index(const struct cl_page *page)
-{
- const struct cl_page_slice *slice;
-
- slice = cl_page_at(page, &lov_device_type);
- LASSERT(slice);
- LASSERT(slice->cpl_obj);
-
- return cl2lov_page(slice)->lps_index;
-}
-
static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
struct cl_io *io)
{
@@ -1105,10 +1094,10 @@ static int lov_io_submit(const struct lu_env *env,
cl_2queue_init(cl2q);
cl_page_list_move(&cl2q->c2_qin, qin, page);
- index = lov_page_index(page);
+ index = page->cp_lov_index;
cl_page_list_for_each_safe(page, tmp, qin) {
/* this page is not on this stripe */
- if (index != lov_page_index(page))
+ if (index != page->cp_lov_index)
continue;
cl_page_list_move(&cl2q->c2_qin, qin, page);
@@ -1171,10 +1160,10 @@ static int lov_io_commit_async(const struct lu_env *env,
cl_page_list_move(plist, queue, page);
- index = lov_page_index(page);
+ index = page->cp_lov_index;
while (queue->pl_nr > 0) {
page = cl_page_list_first(queue);
- if (index != lov_page_index(page))
+ if (index != page->cp_lov_index)
break;
cl_page_list_move(plist, queue, page);
@@ -1218,7 +1207,7 @@ static int lov_io_fault_start(const struct lu_env *env,
fio = &ios->cis_io->u.ci_fault;
lio = cl2lov_io(env, ios);
- sub = lov_sub_get(env, lio, lov_page_index(fio->ft_page));
+ sub = lov_sub_get(env, lio, fio->ft_page->cp_lov_index);
if (IS_ERR(sub))
return PTR_ERR(sub);
sub->sub_io.u.ci_fault.ft_nob = fio->ft_nob;
@@ -57,8 +57,8 @@ static int lov_comp_page_print(const struct lu_env *env,
struct lov_page *lp = cl2lov_page(slice);
return (*printer)(env, cookie,
- LUSTRE_LOV_NAME "-page@%p, comp index: %x, gen: %u\n",
- lp, lp->lps_index, lp->lps_layout_gen);
+ LUSTRE_LOV_NAME "-page@%p, gen: %u\n",
+ lp, lp->lps_layout_gen);
}
static const struct cl_page_operations lov_comp_page_ops = {
@@ -95,11 +95,11 @@ int lov_page_init_composite(const struct lu_env *env, struct cl_object *obj,
rc = lov_stripe_offset(loo->lo_lsm, entry, offset, stripe, &suboff);
LASSERT(rc == 0);
- lpg->lps_index = lov_comp_index(entry, stripe);
+ page->cp_lov_index = lov_comp_index(entry, stripe);
lpg->lps_layout_gen = loo->lo_lsm->lsm_layout_gen;
cl_page_slice_add(page, &lpg->lps_cl, obj, index, &lov_comp_page_ops);
- sub = lov_sub_get(env, lio, lpg->lps_index);
+ sub = lov_sub_get(env, lio, page->cp_lov_index);
if (IS_ERR(sub))
return PTR_ERR(sub);
@@ -136,7 +136,7 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
struct lov_page *lpg = cl_object_page_slice(obj, page);
void *addr;
- lpg->lps_index = ~0;
+ page->cp_lov_index = ~0;
cl_page_slice_add(page, &lpg->lps_cl, obj, index, &lov_empty_page_ops);
addr = kmap(page->cp_vmpage);
memset(addr, 0, cl_page_size(obj));