fobj = reservation_object_get_list(obj);
count = fobj->shared_count;
- preempt_disable();
- write_seqcount_begin(&obj->seq);
-
for (i = 0; i < count; ++i) {
old = rcu_dereference_protected(fobj->shared[i],
RCU_INIT_POINTER(fobj->shared[i], fence);
/* pointer update must be visible before we extend the shared_count */
smp_store_mb(fobj->shared_count, count);
-
- write_seqcount_end(&obj->seq);
- preempt_enable();
dma_fence_put(old);
}
EXPORT_SYMBOL(reservation_object_add_shared_fence);
new->shared_max = old->shared_max;
new->shared_count = k;
- /* Install the new fence list, seqcount provides the barriers */
- preempt_disable();
- write_seqcount_begin(&resv->seq);
- RCU_INIT_POINTER(resv->fence, new);
- write_seqcount_end(&resv->seq);
- preempt_enable();
+ rcu_assign_pointer(resv->fence, new);
/* Drop the references to the removed fences or move them to ef_list */
for (i = j, k = 0; i < old->shared_count; ++i) {