@@ -829,6 +829,13 @@ static inline u32 lu_object_attr(const struct lu_object *o)
return o->lo_header->loh_attr;
}
+static inline void lu_object_ref_add_atomic(struct lu_object *o,
+ const char *scope,
+ const void *source)
+{
+ lu_ref_add_atomic(&o->lo_header->loh_reference, scope, source);
+}
+
static inline void lu_object_ref_add(struct lu_object *o,
const char *scope,
const void *source)
@@ -399,7 +399,7 @@ static struct page *vvp_pgcache_current(struct vvp_seq_private *priv)
continue;
priv->vsp_clob = lu2cl(lu_obj);
- lu_object_ref_add(lu_obj, "dump", current);
+ lu_object_ref_add_atomic(lu_obj, "dump", current);
priv->vsp_page_index = 0;
}
@@ -461,7 +461,7 @@ static void mdc_lock_granted(const struct lu_env *env, struct osc_lock *oscl,
/* lock reference taken by ldlm_handle2lock_long() is
* owned by osc_lock and released in osc_lock_detach()
*/
- lu_ref_add(&dlmlock->l_reference, "osc_lock", oscl);
+ lu_ref_add_atomic(&dlmlock->l_reference, "osc_lock", oscl);
oscl->ols_has_ref = 1;
LASSERT(!oscl->ols_dlmlock);