lck->lls_sub[idx].sub_lock = lsl;
lck->lls_nr_filled++;
LASSERT(lck->lls_nr_filled <= lck->lls_nr);
- cfs_list_add_tail(&link->lll_list, &lsl->lss_parents);
+ list_add_tail(&link->lll_list, &lsl->lss_parents);
link->lll_idx = idx;
link->lll_super = lck;
cl_lock_get(parent);
int result = 0;
ENTRY;
- LASSERT(cfs_list_empty(&closure->clc_list));
+ LASSERT(list_empty(&closure->clc_list));
sublock = lls->sub_lock;
child = sublock->lss_cl.cls_lock;
ENTRY;
LASSERTF(result <= 0 || result == CLO_REPEAT || result == CLO_WAIT,
- "result = %d", result);
+ "result = %d\n", result);
LASSERTF(rc <= 0 || rc == CLO_REPEAT || rc == CLO_WAIT,
"rc = %d\n", rc);
CLASSERT(CLO_WAIT < CLO_REPEAT);
* XXX for wide striping smarter algorithm is desirable,
* breaking out of the loop, early.
*/
- if (lov_stripe_intersects(loo->lo_lsm, i,
- file_start, file_end, &start, &end))
+ if (likely(r0->lo_sub[i] != NULL) &&
+ lov_stripe_intersects(loo->lo_lsm, i,
+ file_start, file_end, &start, &end))
nr++;
}
LASSERT(nr > 0);
* top-lock.
*/
for (i = 0, nr = 0; i < r0->lo_nr; ++i) {
- if (lov_stripe_intersects(loo->lo_lsm, i,
- file_start, file_end, &start, &end)) {
+ if (likely(r0->lo_sub[i] != NULL) &&
+ lov_stripe_intersects(loo->lo_lsm, i,
+ file_start, file_end, &start, &end)) {
struct cl_lock_descr *descr;
descr = &lck->lls_sub[nr].sub_descr;
*/
start = cl_offset(&lov->lo_cl, descr->cld_start);
end = cl_offset(&lov->lo_cl, descr->cld_end + 1) - 1;
- result = end - start <= lsm->lsm_stripe_size &&
- stripe == lov_stripe_number(lsm, start) &&
- stripe == lov_stripe_number(lsm, end);
- if (result) {
+
+ result = 0;
+ /* glimpse should work on the object with LOV EA hole. */
+ if ((end - start <= lsm->lsm_stripe_size) ||
+ (descr->cld_end == CL_PAGE_EOF &&
+ unlikely(lov->lo_lsm->lsm_pattern & LOV_PATTERN_F_HOLE))) {
+ int idx;
+
+ idx = lov_stripe_number(lsm, start);
+ if (idx == stripe ||
+ unlikely(lov_r0(lov)->lo_sub[idx] == NULL)) {
+ idx = lov_stripe_number(lsm, end);
+ if (idx == stripe ||
+ unlikely(lov_r0(lov)->lo_sub[idx] == NULL))
+ result = 1;
+ }
+ }
+
+ if (result != 0) {
struct cl_lock_descr *subd = &lov_env_info(env)->lti_ldescr;
obd_off sub_start;
obd_off sub_end;
LASSERT(cl_lock_is_mutexed(sub->lss_cl.cls_lock));
ENTRY;
- cfs_list_del_init(&link->lll_list);
+ list_del_init(&link->lll_list);
LASSERT(lck->lls_sub[link->lll_idx].sub_lock == sub);
/* yank this sub-lock from parent's array */
lck->lls_sub[link->lll_idx].sub_lock = NULL;
LASSERT(cl_lock_is_mutexed(sub->lss_cl.cls_lock));
ENTRY;
- cfs_list_for_each_entry(scan, &sub->lss_parents, lll_list) {
+ list_for_each_entry(scan, &sub->lss_parents, lll_list) {
if (scan->lll_super == lck)
RETURN(scan);
}
struct cl_lock_closure *closure;
closure = &lov_env_info(env)->lti_closure;
- LASSERT(cfs_list_empty(&closure->clc_list));
+ LASSERT(list_empty(&closure->clc_list));
cl_lock_closure_init(env, closure, parent, 1);
return closure;
}