From: VMware, Inc <> Date: Thu, 24 Feb 2011 21:27:51 +0000 (-0800) Subject: vmblock-fuse: use glib's atomic operations X-Git-Tag: 2011.02.23-368700~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de8a2d1ed3dfcf9bec3a2ed3ecb19d873e2731f9;p=thirdparty%2Fopen-vm-tools.git vmblock-fuse: use glib's atomic operations Instead of using our implemenation of atomic operations from lib/misc which has a ton of dependencies, let's use glib's implementation. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/vmblock-fuse/Makefile.am b/open-vm-tools/vmblock-fuse/Makefile.am index d1759b490..86f067408 100644 --- a/open-vm-tools/vmblock-fuse/Makefile.am +++ b/open-vm-tools/vmblock-fuse/Makefile.am @@ -29,12 +29,13 @@ AM_CFLAGS += -D_XOPEN_SOURCE=600 AM_CFLAGS += -DUSERLEVEL AM_CFLAGS += -D_FILE_OFFSET_BITS=64 AM_CFLAGS += @FUSE_CPPFLAGS@ +AM_CFLAGS += @GLIB2_CPPFLAGS@ AM_CFLAGS += -I$(top_srcdir)/modules/shared/vmblock AM_CFLAGS += -I$(srcdir) vmware_vmblock_fuse_LDADD = -vmware_vmblock_fuse_LDADD += ../lib/misc/libMisc.la vmware_vmblock_fuse_LDADD += @FUSE_LIBS@ +vmware_vmblock_fuse_LDADD += @GLIB2_LIBS@ vmware_vmblock_fuse_SOURCES = vmware_vmblock_fuse_SOURCES += util.c diff --git a/open-vm-tools/vmblock-fuse/fsops.c b/open-vm-tools/vmblock-fuse/fsops.c index b3d4006d8..491ecc3dd 100644 --- a/open-vm-tools/vmblock-fuse/fsops.c +++ b/open-vm-tools/vmblock-fuse/fsops.c @@ -724,7 +724,6 @@ VMBlockRelease(const char *path, // IN: Must be control file. void * VMBlockInit(void) { - Atomic_Init(); BlockInit(); return NULL; } diff --git a/open-vm-tools/vmblock-fuse/os.h b/open-vm-tools/vmblock-fuse/os.h index ef1895972..5bfc3d9cb 100644 --- a/open-vm-tools/vmblock-fuse/os.h +++ b/open-vm-tools/vmblock-fuse/os.h @@ -34,8 +34,8 @@ #include #include #include +#include -#include "vm_atomic.h" #include "vm_assert.h" typedef pthread_rwlock_t os_rwlock_t; @@ -45,7 +45,7 @@ typedef struct os_completion_t { pthread_mutex_t mutex; int completed; } os_completion_t; -typedef Atomic_Int os_atomic_t; +typedef gint os_atomic_t; typedef char * os_blocker_id_t; #define OS_UNKNOWN_BLOCKER 0 @@ -126,10 +126,10 @@ typedef char * os_blocker_id_t; * the value before the dec. */ -#define os_atomic_dec_and_test(atomic) (Atomic_ReadDecInt(atomic) == 1) -#define os_atomic_dec Atomic_DecInt -#define os_atomic_set Atomic_WriteInt -#define os_atomic_inc Atomic_IncInt +#define os_atomic_dec_and_test(atomic) g_atomic_int_dec_and_test(atomic) +#define os_atomic_dec(atomic) g_atomic_int_add((atomic), -1) +#define os_atomic_inc(atomic) g_atomic_int_inc(atomic) +#define os_atomic_set(atomic, val) g_atomic_int_set((atomic), (val)) /* * Extra stuff fuse port needs defined (ie not in os.h for other ports).