Docs/RCU: Correct sample code of qatomic_rcu_set
authorKeqian Zhu <zhukeqian1@huawei.com>
Wed, 6 Jan 2021 07:17:10 +0000 (15:17 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Jan 2021 11:38:03 +0000 (12:38 +0100)
Correct sample code to avoid confusing readers.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Cc: qemu-trivial@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210106071710.15836-1-zhukeqian1@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/devel/rcu.txt

index cdf002edd82625c2a322cdab797c1b521c24d311..2e6cc607a17e58346efd77a978379925c01f006e 100644 (file)
@@ -392,7 +392,7 @@ Instead, we store the size of the array with the array itself:
 
             /* Removal phase.  */
             old_array = global_array;
-            qatomic_rcu_set(&new_array->data, new_array);
+            qatomic_rcu_set(&global_array, new_array);
             synchronize_rcu();
 
             /* Reclamation phase.  */