- struct lovsub_object *los = lu2lovsub(obj);
- struct lov_object *lov = los->lso_super;
- ENTRY;
-
- /* We can't assume lov was assigned here, because of the shadow
- * object handling in lu_object_find.
- */
- if (lov) {
- LASSERT(lov->lo_type == LLT_RAID0);
- LASSERT(lov->u.raid0.lo_sub[los->lso_index] == los);
- spin_lock(&lov->u.raid0.lo_sub_lock);
- lov->u.raid0.lo_sub[los->lso_index] = NULL;
- spin_unlock(&lov->u.raid0.lo_sub_lock);
- }
-
- lu_object_fini(obj);
- lu_object_header_fini(&los->lso_header.coh_lu);
- OBD_SLAB_FREE_PTR(los, lovsub_object_kmem);
- EXIT;
+ struct lovsub_object *los = lu2lovsub(obj);
+ struct lov_object *lov = los->lso_super;
+
+ ENTRY;
+
+ /*
+ * We can't assume lov was assigned here, because of the shadow
+ * object handling in lu_object_find.
+ */
+ if (lov) {
+ int index = lov_comp_entry(los->lso_index);
+ int stripe = lov_comp_stripe(los->lso_index);
+ struct lov_layout_raid0 *r0 = lov_r0(lov, index);
+
+ LASSERT(lov->lo_type == LLT_COMP);
+ LASSERT(r0->lo_sub[stripe] == los);
+ spin_lock(&r0->lo_sub_lock);
+ r0->lo_sub[stripe] = NULL;
+ spin_unlock(&r0->lo_sub_lock);
+ }
+
+ lu_object_fini(obj);
+ lu_object_header_fini(&los->lso_header.coh_lu);
+ OBD_FREE_PRE(los, sizeof(*los), "slab-freed");
+ call_rcu(&los->lso_header.coh_lu.loh_rcu, lovsub_object_free_rcu);
+ EXIT;