summaryrefslogtreecommitdiffstats
path: root/xlators/mount
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/mount
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/mount')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c26
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c6
-rw-r--r--xlators/mount/fuse/src/fuse-resolve.c30
3 files changed, 31 insertions, 31 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index b517475ef06..ece089976f3 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -409,7 +409,7 @@ fuse_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (op_ret == 0) {
if (__is_root_gfid (state->loc.inode->gfid))
buf->ia_ino = 1;
- if (uuid_is_null (buf->ia_gfid)) {
+ if (gf_uuid_is_null (buf->ia_gfid)) {
/* With a NULL gfid inode linking is
not possible. Let's not pretend this
call was a "success".
@@ -535,8 +535,8 @@ fuse_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
inode_unref (state->loc.inode);
state->loc.inode = inode_new (itable);
state->is_revalidate = 2;
- if (uuid_is_null (state->gfid))
- uuid_generate (state->gfid);
+ if (gf_uuid_is_null (state->gfid))
+ gf_uuid_generate (state->gfid);
fuse_gfid_set (state);
STACK_WIND (frame, fuse_lookup_cbk,
@@ -599,8 +599,8 @@ fuse_lookup_resume (fuse_state_t *state)
"%"PRIu64": LOOKUP %s", state->finh->unique,
state->loc.path);
state->loc.inode = inode_new (state->loc.parent->table);
- if (uuid_is_null (state->gfid))
- uuid_generate (state->gfid);
+ if (gf_uuid_is_null (state->gfid))
+ gf_uuid_generate (state->gfid);
fuse_gfid_set (state);
}
@@ -1496,7 +1496,7 @@ fuse_mknod (xlator_t *this, fuse_in_header_t *finh, void *msg)
GET_STATE (this, finh, state);
- uuid_generate (state->gfid);
+ gf_uuid_generate (state->gfid);
fuse_resolve_entry_init (state, &state->resolve, finh->nodeid, name);
@@ -1562,7 +1562,7 @@ fuse_mkdir (xlator_t *this, fuse_in_header_t *finh, void *msg)
GET_STATE (this, finh, state);
- uuid_generate (state->gfid);
+ gf_uuid_generate (state->gfid);
fuse_resolve_entry_init (state, &state->resolve, finh->nodeid, name);
@@ -1696,7 +1696,7 @@ fuse_symlink (xlator_t *this, fuse_in_header_t *finh, void *msg)
GET_STATE (this, finh, state);
- uuid_generate (state->gfid);
+ gf_uuid_generate (state->gfid);
fuse_resolve_entry_init (state, &state->resolve, finh->nodeid, name);
@@ -2067,7 +2067,7 @@ fuse_create (xlator_t *this, fuse_in_header_t *finh, void *msg)
GET_STATE (this, finh, state);
- uuid_generate (state->gfid);
+ gf_uuid_generate (state->gfid);
fuse_resolve_entry_init (state, &state->resolve, finh->nodeid, name);
@@ -4086,7 +4086,7 @@ fuse_first_lookup (xlator_t *this)
loc.path = "/";
loc.name = "";
loc.inode = fuse_ino_to_inode (1, this);
- uuid_copy (loc.gfid, loc.inode->gfid);
+ gf_uuid_copy (loc.gfid, loc.inode->gfid);
loc.parent = NULL;
dict = dict_new ();
@@ -4155,7 +4155,7 @@ fuse_nameless_lookup (xlator_t *xl, uuid_t gfid, loc_t *loc)
}
}
- uuid_copy (loc->gfid, gfid);
+ gf_uuid_copy (loc->gfid, gfid);
xattr_req = dict_new ();
if (xattr_req == NULL) {
@@ -4202,7 +4202,7 @@ fuse_migrate_fd_open (xlator_t *this, fd_t *basefd, fd_t *oldfd,
goto out;
}
- uuid_copy (loc.gfid, basefd->inode->gfid);
+ gf_uuid_copy (loc.gfid, basefd->inode->gfid);
loc.inode = inode_find (new_subvol->itable, basefd->inode->gfid);
@@ -4394,7 +4394,7 @@ fuse_migrate_fd (xlator_t *this, fd_t *basefd, xlator_t *old_subvol,
LOCK (&oldfd->inode->lock);
{
- if (uuid_is_null (oldfd->inode->gfid)) {
+ if (gf_uuid_is_null (oldfd->inode->gfid)) {
create_in_progress = 1;
} else {
create_in_progress = 0;
diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c
index a28169a0021..a8d387fdd4b 100644
--- a/xlators/mount/fuse/src/fuse-helpers.c
+++ b/xlators/mount/fuse/src/fuse-helpers.c
@@ -386,7 +386,7 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino,
parent = fuse_ino_to_inode (par, state->this);
loc->parent = parent;
if (parent)
- uuid_copy (loc->pargfid, parent->gfid);
+ gf_uuid_copy (loc->pargfid, parent->gfid);
}
inode = loc->inode;
@@ -409,7 +409,7 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino,
inode = fuse_ino_to_inode (ino, state->this);
loc->inode = inode;
if (inode)
- uuid_copy (loc->gfid, inode->gfid);
+ gf_uuid_copy (loc->gfid, inode->gfid);
}
parent = loc->parent;
@@ -417,7 +417,7 @@ fuse_loc_fill (loc_t *loc, fuse_state_t *state, ino_t ino,
parent = inode_parent (inode, null_gfid, NULL);
loc->parent = parent;
if (parent)
- uuid_copy (loc->pargfid, parent->gfid);
+ gf_uuid_copy (loc->pargfid, parent->gfid);
}
diff --git a/xlators/mount/fuse/src/fuse-resolve.c b/xlators/mount/fuse/src/fuse-resolve.c
index 5aaa32ea660..2ddb31cd076 100644
--- a/xlators/mount/fuse/src/fuse-resolve.c
+++ b/xlators/mount/fuse/src/fuse-resolve.c
@@ -93,7 +93,7 @@ fuse_resolve_entry (fuse_state_t *state)
resolve_loc = &resolve->resolve_loc;
resolve_loc->parent = inode_ref (state->loc_now->parent);
- uuid_copy (resolve_loc->pargfid, state->loc_now->pargfid);
+ gf_uuid_copy (resolve_loc->pargfid, state->loc_now->pargfid);
resolve_loc->name = resolve->bname;
resolve_loc->inode = inode_new (state->itable);
@@ -137,7 +137,7 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
* -2: entry (inode corresponding to path) could not be resolved
*/
- if (uuid_is_null (resolve->gfid)) {
+ if (gf_uuid_is_null (resolve->gfid)) {
resolve->op_ret = -1;
} else {
resolve->op_ret = -2;
@@ -154,13 +154,13 @@ fuse_resolve_gfid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (!link_inode)
goto out;
- if (!uuid_is_null (resolve->gfid)) {
+ if (!gf_uuid_is_null (resolve->gfid)) {
loc_now->inode = link_inode;
goto out;
}
loc_now->parent = link_inode;
- uuid_copy (loc_now->pargfid, link_inode->gfid);
+ gf_uuid_copy (loc_now->pargfid, link_inode->gfid);
fuse_resolve_entry (state);
@@ -181,10 +181,10 @@ fuse_resolve_gfid (fuse_state_t *state)
resolve = state->resolve_now;
resolve_loc = &resolve->resolve_loc;
- if (!uuid_is_null (resolve->pargfid)) {
- uuid_copy (resolve_loc->gfid, resolve->pargfid);
- } else if (!uuid_is_null (resolve->gfid)) {
- uuid_copy (resolve_loc->gfid, resolve->gfid);
+ if (!gf_uuid_is_null (resolve->pargfid)) {
+ gf_uuid_copy (resolve_loc->gfid, resolve->pargfid);
+ } else if (!gf_uuid_is_null (resolve->gfid)) {
+ gf_uuid_copy (resolve_loc->gfid, resolve->gfid);
}
/* inode may already exist in case we are looking up an inode which was
@@ -234,7 +234,7 @@ fuse_resolve_parent_simple (fuse_state_t *state)
/* no graph switches since */
loc->parent = inode_ref (parent);
- uuid_copy (loc->pargfid, parent->gfid);
+ gf_uuid_copy (loc->pargfid, parent->gfid);
loc->inode = inode_grep (state->itable, parent, loc->name);
/* nodeid for root is 1 and we blindly take the latest graph's
@@ -264,7 +264,7 @@ fuse_resolve_parent_simple (fuse_state_t *state)
}
loc->parent = parent;
- uuid_copy (loc->pargfid, resolve->pargfid);
+ gf_uuid_copy (loc->pargfid, resolve->pargfid);
inode = inode_grep (state->itable, parent, loc->name);
if (inode) {
@@ -555,7 +555,7 @@ fuse_gfid_set (fuse_state_t *state)
{
int ret = 0;
- if (uuid_is_null (state->gfid))
+ if (gf_uuid_is_null (state->gfid))
goto out;
if (!state->xdata)
@@ -580,7 +580,7 @@ fuse_resolve_entry_init (fuse_state_t *state, fuse_resolve_t *resolve,
inode_t *parent = NULL;
parent = fuse_ino_to_inode (par, state->this);
- uuid_copy (resolve->pargfid, parent->gfid);
+ gf_uuid_copy (resolve->pargfid, parent->gfid);
resolve->parhint = parent;
resolve->bname = gf_strdup (name);
@@ -595,7 +595,7 @@ fuse_resolve_inode_init (fuse_state_t *state, fuse_resolve_t *resolve,
inode_t *inode = NULL;
inode = fuse_ino_to_inode (ino, state->this);
- uuid_copy (resolve->gfid, inode->gfid);
+ gf_uuid_copy (resolve->gfid, inode->gfid);
resolve->hint = inode;
return 0;
@@ -623,11 +623,11 @@ fuse_resolve (fuse_state_t *state)
fuse_resolve_fd (state);
- } else if (!uuid_is_null (resolve->pargfid)) {
+ } else if (!gf_uuid_is_null (resolve->pargfid)) {
fuse_resolve_parent (state);
- } else if (!uuid_is_null (resolve->gfid)) {
+ } else if (!gf_uuid_is_null (resolve->gfid)) {
fuse_resolve_inode (state);