summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-04-02 15:51:30 +0200
committerVijay Bellur <vbellur@redhat.com>2015-04-04 10:48:35 -0700
commit28397cae4102ac3f08576ebaf071ad92683097e8 (patch)
tree4c8be92299a951c8a28e1dc85bf2671f60da6e08 /xlators/cluster/afr/src/afr-self-heal-common.c
parent0aebfaa349c7c68c2d59531eabae5a03a748e16a (diff)
Avoid conflict between contrib/uuid and system uuid
glusterfs relies on Linux uuid implementation, which API is incompatible with most other systems's uuid. As a result, libglusterfs has to embed contrib/uuid, which is the Linux implementation, on non Linux systems. This implementation is incompatible with systtem's built in, but the symbols have the same names. Usually this is not a problem because when we link with -lglusterfs, libc's symbols are trumped. However there is a problem when a program not linked with -lglusterfs will dlopen() glusterfs component. In such a case, libc's uuid implementation is already loaded in the calling program, and it will be used instead of libglusterfs's implementation, causing crashes. A possible workaround is to use pre-load libglusterfs in the calling program (using LD_PRELOAD on NetBSD for instance), but such a mechanism is not portable, nor is it flexible. A much better approach is to rename libglusterfs's uuid_* functions to gf_uuid_* to avoid any possible conflict. This is what this change attempts. BUG: 1206587 Change-Id: I9ccd3e13afed1c7fc18508e92c7beb0f5d49f31a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/10017 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 21b4c4414d9..f3d1f8b0b14 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -45,7 +45,7 @@ afr_selfheal_post_op (call_frame_t *frame, xlator_t *this, inode_t *inode,
local = frame->local;
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
STACK_WIND (frame, afr_selfheal_post_op_cbk, priv->children[subvol],
priv->children[subvol]->fops->xattrop, &loc,
@@ -711,7 +711,7 @@ afr_selfheal_unlocked_lookup_on (call_frame_t *frame, inode_t *parent,
}
loc.parent = inode_ref (parent);
- uuid_copy (loc.pargfid, parent->gfid);
+ gf_uuid_copy (loc.pargfid, parent->gfid);
loc.name = name;
loc.inode = inode_ref (inode);
@@ -749,7 +749,7 @@ afr_selfheal_unlocked_discover_on (call_frame_t *frame, inode_t *inode,
}
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, gfid);
+ gf_uuid_copy (loc.gfid, gfid);
AFR_ONLIST (discover_on, frame, afr_selfheal_discover_cbk, lookup, &loc,
xattr_req);
@@ -840,7 +840,7 @@ afr_selfheal_tryinodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
struct gf_flock flock = {0, };
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
flock.l_type = F_WRLCK;
flock.l_start = off;
@@ -870,7 +870,7 @@ afr_selfheal_inodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
local = frame->local;
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
flock.l_type = F_WRLCK;
flock.l_start = off;
@@ -908,7 +908,7 @@ afr_selfheal_uninodelk (call_frame_t *frame, xlator_t *this, inode_t *inode,
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
flock.l_type = F_UNLCK;
flock.l_start = off;
@@ -930,7 +930,7 @@ afr_selfheal_tryentrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
loc_t loc = {0,};
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
AFR_ONALL (frame, afr_selfheal_lock_cbk, entrylk, dom,
&loc, name, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK, NULL);
@@ -954,7 +954,7 @@ afr_selfheal_entrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
local = frame->local;
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
AFR_ONALL (frame, afr_selfheal_lock_cbk, entrylk, dom, &loc,
name, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK, NULL);
@@ -985,7 +985,7 @@ afr_selfheal_unentrylk (call_frame_t *frame, xlator_t *this, inode_t *inode,
loc_t loc = {0,};
loc.inode = inode_ref (inode);
- uuid_copy (loc.gfid, inode->gfid);
+ gf_uuid_copy (loc.gfid, inode->gfid);
AFR_ONLIST (locked_on, frame, afr_selfheal_lock_cbk, entrylk,
dom, &loc, name, ENTRYLK_UNLOCK, ENTRYLK_WRLCK, NULL);
@@ -1225,7 +1225,7 @@ afr_inode_find (xlator_t *this, uuid_t gfid)
if (!inode)
return NULL;
- uuid_copy (inode->gfid, gfid);
+ gf_uuid_copy (inode->gfid, gfid);
return inode;
}
@@ -1271,7 +1271,7 @@ afr_selfheal_newentry_mark (call_frame_t *frame, xlator_t *this, inode_t *inode,
priv = this->private;
- uuid_copy (inode->gfid, replies[source].poststat.ia_gfid);
+ gf_uuid_copy (inode->gfid, replies[source].poststat.ia_gfid);
xattr = dict_new();
if (!xattr)