Re: [Qemu-devel] [PATCH v1 2/2] block/archipelago: Use QEMU atomic builtins

2014-09-01 Thread Chrysostomos Nanakos
On 09/01/2014 01:33 PM, Paolo Bonzini wrote: Il 01/09/2014 12:13, Chrysostomos Nanakos ha scritto: -if ((__sync_add_and_fetch(&segreq->ref, -segments_nr + i)) == 0) { +if ((atomic_add_fetch(&segreq->ref, -segments_nr + i)) == 0) { What about this one? It seems easier to me to r

Re: [Qemu-devel] [PATCH v1 2/2] block/archipelago: Use QEMU atomic builtins

2014-09-01 Thread Paolo Bonzini
Il 01/09/2014 12:13, Chrysostomos Nanakos ha scritto: >>> >>> -if ((__sync_add_and_fetch(&segreq->ref, -segments_nr + i)) >>> == 0) { >>> +if ((atomic_add_fetch(&segreq->ref, -segments_nr + i)) == 0) { > > > What about this one? It seems easier to me to read the above and > unders

Re: [Qemu-devel] [PATCH v1 2/2] block/archipelago: Use QEMU atomic builtins

2014-09-01 Thread Chrysostomos Nanakos
On 09/01/2014 12:43 PM, Paolo Bonzini wrote: Il 01/09/2014 10:58, Chrysostomos Nanakos ha scritto: Replace __sync builtins with the ones provided by QEMU for atomic operations. Signed-off-by: Chrysostomos Nanakos --- block/archipelago.c | 11 ++- 1 file changed, 6 insertions(+), 5

Re: [Qemu-devel] [PATCH v1 2/2] block/archipelago: Use QEMU atomic builtins

2014-09-01 Thread Paolo Bonzini
Il 01/09/2014 10:58, Chrysostomos Nanakos ha scritto: > Replace __sync builtins with the ones provided by QEMU > for atomic operations. > > Signed-off-by: Chrysostomos Nanakos > --- > block/archipelago.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/bloc

[Qemu-devel] [PATCH v1 2/2] block/archipelago: Use QEMU atomic builtins

2014-09-01 Thread Chrysostomos Nanakos
Replace __sync builtins with the ones provided by QEMU for atomic operations. Signed-off-by: Chrysostomos Nanakos --- block/archipelago.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/block/archipelago.c b/block/archipelago.c index 34f72dc..fa8cd29 100644 ---