*/
struct lovsub_object **lo_sub;
/**
+ * protect lo_sub
+ */
+ cfs_spinlock_t lo_sub_lock;
+ /**
* When this is true, lov_object::lo_attr contains
* valid up to date attributes for a top-level
* object. This field is reset to 0 when attributes of
if (r0->lo_sub != NULL) {
result = 0;
subconf->coc_inode = conf->coc_inode;
+ cfs_spin_lock_init(&r0->lo_sub_lock);
/*
* Create stripe cl_objects.
*/
cfs_waitlink_init(waiter);
cfs_waitq_add(&site->ls_marche_funebre, waiter);
cfs_set_current_state(CFS_TASK_UNINT);
-
- while (r0->lo_sub[idx] == los)
+ while (1) {
/* this wait-queue is signaled at the end of
* lu_object_free(). */
- cfs_waitq_wait(waiter, CFS_TASK_UNINT);
+ cfs_set_current_state(CFS_TASK_UNINT);
+ cfs_spin_lock(&r0->lo_sub_lock);
+ if (r0->lo_sub[idx] == los) {
+ cfs_spin_unlock(&r0->lo_sub_lock);
+ cfs_waitq_wait(waiter, CFS_TASK_UNINT);
+ } else {
+ cfs_spin_unlock(&r0->lo_sub_lock);
+ cfs_set_current_state(CFS_TASK_RUNNING);
+ break;
+ }
+ }
cfs_waitq_del(&site->ls_marche_funebre, waiter);
}
LASSERT(r0->lo_sub[idx] == NULL);
if (lov) {
LASSERT(lov->lo_type == LLT_RAID0);
LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los);
+ cfs_spin_lock(&lov->u.raid0.lo_sub_lock);
lov->u.raid0.lo_sub[los->lso_index] = NULL;
+ cfs_spin_unlock(&lov->u.raid0.lo_sub_lock);
}
lu_object_fini(obj);