summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2014-11-05 10:26:46 -0500
committerVijay Bellur <vbellur@redhat.com>2014-11-07 02:17:56 -0800
commit1ffdf112f707a13c9fd74bbf17f99d28f84f0f0c (patch)
treeb85c779a7c7c789bee66ab206f73b56db2df3371 /api/src/glfs.c
parent3867bdb496b9a34ab3db06c151e822aa9379b3e9 (diff)
api: versioned symbols in libgfapi.so for compatibilityv3.6.1
Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0 Some nits uncovered: + there are a couple functions declared that do not have an associated definition, e.g. glfs_truncate(), glfs_caller_specific_init() + there are seven private/internal functions used by heal/src/glfsheal and the gfapi master xlator (glfs-master.c): glfs_loc_touchup(), glfs_active_subvol(), and glfs_subvol_done(), glfs_init_done(), glfs_resolve_at(), glfs_free_from_ctx(), and glfs_new_from_ctx(); which are not declared in glfs.h; + for this initial pass at versioned symbols, we use the earliest version of all public symbols, i.e. those for which there are declarations in glfs.h or glfs-handles.h. Further investigation as we do backports to 3.6, 3.4, and 3.4 will be required to determine if older implementations need to be preserved (forward ported) and their associated alias(es) and symbol version(s) defined. FWIW, we should consider linking all of our libraries with a map, it'll result in a cleaner ABI. Perhaps something for an intern to do or a Google Summer of Code project. Change-Id: Ie3323e62bb125a3b26214153278b4e998804de0e BUG: 1160710 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9055 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r--api/src/glfs.c82
1 files changed, 62 insertions, 20 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index bcabb29f857..41c6da576a7 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -282,8 +282,8 @@ out:
int
-glfs_set_xlator_option (struct glfs *fs, const char *xlator, const char *key,
- const char *value)
+pub_glfs_set_xlator_option (struct glfs *fs, const char *xlator,
+ const char *key, const char *value)
{
xlator_cmdline_option_t *option = NULL;
@@ -321,9 +321,12 @@ enomem:
return -1;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_set_xlator_option, 3.4.0);
+
+
int
-glfs_unset_volfile_server (struct glfs *fs, const char *transport,
- const char *host, const int port)
+pub_glfs_unset_volfile_server (struct glfs *fs, const char *transport,
+ const char *host, const int port)
{
cmd_args_t *cmd_args = NULL;
server_cmdline_t *server = NULL;
@@ -349,9 +352,12 @@ out:
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_unset_volfile_server, 3.5.1);
+
+
int
-glfs_set_volfile_server (struct glfs *fs, const char *transport,
- const char *host, int port)
+pub_glfs_set_volfile_server (struct glfs *fs, const char *transport,
+ const char *host, int port)
{
cmd_args_t *cmd_args = NULL;
server_cmdline_t *server = NULL;
@@ -423,27 +429,44 @@ out:
return ret;
}
-int glfs_setfsuid (uid_t fsuid)
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_set_volfile_server, 3.4.0);
+
+
+int
+pub_glfs_setfsuid (uid_t fsuid)
{
return syncopctx_setfsuid (&fsuid);
}
-int glfs_setfsgid (gid_t fsgid)
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setfsuid, 3.4.2);
+
+
+int
+pub_glfs_setfsgid (gid_t fsgid)
{
return syncopctx_setfsgid (&fsgid);
}
-int glfs_setfsgroups (size_t size, const gid_t *list)
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setfsgid, 3.4.2);
+
+
+int
+pub_glfs_setfsgroups (size_t size, const gid_t *list)
{
return syncopctx_setfsgroups(size, list);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setfsgroups, 3.4.2);
+
+
struct glfs *
-glfs_from_glfd (struct glfs_fd *glfd)
+pub_glfs_from_glfd (struct glfs_fd *glfd)
{
return glfd->fs;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_from_glfd, 3.4.0);
+
struct glfs_fd *
glfs_fd_new (struct glfs *fs)
@@ -511,7 +534,7 @@ glfs_poller (void *data)
struct glfs *
-glfs_new (const char *volname)
+pub_glfs_new (const char *volname)
{
struct glfs *fs = NULL;
int ret = -1;
@@ -553,9 +576,11 @@ glfs_new (const char *volname)
return fs;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_new, 3.4.0);
+
int
-glfs_set_volfile (struct glfs *fs, const char *volfile)
+pub_glfs_set_volfile (struct glfs *fs, const char *volfile)
{
cmd_args_t *cmd_args = NULL;
@@ -569,9 +594,11 @@ glfs_set_volfile (struct glfs *fs, const char *volfile)
return 0;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_set_volfile, 3.4.0);
+
int
-glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel)
+pub_glfs_set_logging (struct glfs *fs, const char *logfile, int loglevel)
{
int ret = 0;
char *tmplog = NULL;
@@ -601,6 +628,8 @@ out:
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_set_logging, 3.4.0);
+
int
glfs_init_wait (struct glfs *fs)
@@ -623,7 +652,7 @@ glfs_init_wait (struct glfs *fs)
void
-glfs_init_done (struct glfs *fs, int ret)
+priv_glfs_init_done (struct glfs *fs, int ret)
{
glfs_init_cbk init_cbk;
@@ -653,6 +682,8 @@ out:
return;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_init_done, 3.4.0);
+
int
glfs_init_common (struct glfs *fs)
@@ -697,7 +728,7 @@ glfs_init_async (struct glfs *fs, glfs_init_cbk cbk)
int
-glfs_init (struct glfs *fs)
+pub_glfs_init (struct glfs *fs)
{
int ret = -1;
@@ -717,9 +748,14 @@ glfs_init (struct glfs *fs)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_init, 3.4.0);
+
+
+extern xlator_t *
+priv_glfs_active_subvol (struct glfs *);
int
-glfs_fini (struct glfs *fs)
+pub_glfs_fini (struct glfs *fs)
{
int ret = -1;
int countdown = 100;
@@ -758,9 +794,9 @@ glfs_fini (struct glfs *fs)
pthread_mutex_unlock (&fs->mutex);
if (fs_init != 0) {
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (subvol) {
- /* PARENT_DOWN within glfs_subvol_done() is issued only
+ /* PARENT_DOWN within priv_glfs_subvol_done() is issued only
on graph switch (new graph should activiate and
decrement the extra @winds count taken in glfs_graph_setup()
@@ -772,7 +808,7 @@ glfs_fini (struct glfs *fs)
disconnection in the future.
*/
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
}
if (gf_log_fini(ctx) != 0)
@@ -781,8 +817,11 @@ glfs_fini (struct glfs *fs)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fini, 3.4.0);
+
+
ssize_t
-glfs_get_volfile (struct glfs *fs, void *buf, size_t len)
+pub_glfs_get_volfile (struct glfs *fs, void *buf, size_t len)
{
ssize_t res;
@@ -800,3 +839,6 @@ glfs_get_volfile (struct glfs *fs, void *buf, size_t len)
return res;
}
+
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_get_volfile, 3.6.0);
+