summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/src/Makefile.am4
-rw-r--r--api/src/README.Symbol_Versions228
-rw-r--r--api/src/gfapi.aliases131
-rw-r--r--api/src/gfapi.map (renamed from api/src/gfapi.map.in)0
-rw-r--r--api/src/glfs-fops.c170
-rw-r--r--api/src/glfs-handleops.c93
-rw-r--r--api/src/glfs-handles.h69
-rw-r--r--api/src/glfs-internal.h68
-rw-r--r--api/src/glfs-master.c6
-rw-r--r--api/src/glfs-mgmt.c14
-rw-r--r--api/src/glfs-resolve.c50
-rw-r--r--api/src/glfs.c7
-rw-r--r--api/src/glfs.h287
-rw-r--r--configure.ac11
-rw-r--r--heal/src/glfs-heal.c3
15 files changed, 828 insertions, 313 deletions
diff --git a/api/src/Makefile.am b/api/src/Makefile.am
index 0a2101fe549..5117428d4df 100644
--- a/api/src/Makefile.am
+++ b/api/src/Makefile.am
@@ -3,6 +3,8 @@ noinst_HEADERS = glfs-mem-types.h glfs-internal.h
libgfapi_HEADERS = glfs.h glfs-handles.h
libgfapidir = $(includedir)/glusterfs/api
+EXTRA_DIST = gfapi.map gfapi.aliases
+
libgfapi_la_SOURCES = glfs.c glfs-mgmt.c glfs-fops.c glfs-resolve.c \
glfs-handleops.c
libgfapi_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
@@ -16,7 +18,7 @@ libgfapi_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
-I$(top_srcdir)/rpc/xdr/src
libgfapi_la_LDFLAGS = -version-info $(GFAPI_LT_VERSION) \
- -Wl,--version-script=gfapi.map
+ $(GFAPI_EXTRA_LDFLAGS)
xlator_LTLIBRARIES = api.la
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/mount
diff --git a/api/src/README.Symbol_Versions b/api/src/README.Symbol_Versions
new file mode 100644
index 00000000000..d69c364bb07
--- /dev/null
+++ b/api/src/README.Symbol_Versions
@@ -0,0 +1,228 @@
+
+1. Symbol Versions and SO_NAMEs
+
+ In general, adding new APIs to a shared library does not require that
+symbol versions be used or the the SO_NAME be "bumped." These actions
+are usually reserved for when a major change is introduced, e.g. many
+APIs change or a signficant change in the functionality occurs.
+
+ Over the normal lifetime of a When a new API is added, the library is
+recompiled, consumers of the new API are able to do so, and existing,
+legacy consumers of the original API continue as before. If by some
+chance an old copy of the library is installed on a system, it's unlikely
+that most applications will be affected. New applications that use the
+new API will incur a run-time error terminate.
+
+ Bumping the SO_NAME, i.e. changing the shared lib's file name, e.g.
+from libfoo.so.0 to libfoo.so.1, which also changes the ELF SO_NAME
+attribute inside the file, works a little differently. libfoo.so.0
+contains only the old APIs. libfoo.so.1 contains both the old and new
+APIs. Legacy software that was linked with libfoo.so.0 continues to work
+as libfoo.so.0 is usually left installed on the system. New software that
+uses the new APIs is linked with libfoo.so.1, and works as long as
+long as libfoo.so.1 is installed on the system. Accidentally (re)installing
+libfoo.so.0 doesn't break new software as long as reinstalling doesn't
+erase libfoo.so.1.
+
+ Using symbol versions is somewhere in the middle. The shared library
+file remains libfoo.so.0 forever. Legacy APIs may or may not have an
+associated symbol version. New APIs may or may not have an associated
+symbol version either. In general symbol versions are reserved for APIs
+that have changed. Either the function's signature has changed, i.e. the
+return time or the number of paramaters, and/or the parameter types have
+changed. Another reason for using symbol versions on an API is when the
+behaviour or functionality of the API changes dramatically. As with a
+library that doesn't use versioned symbols, old and new applications
+either find or don't find the versioned symbols they need. If the versioned
+symbol doesn't exist in the installed library, the application incurs a
+run-time error and terminates.
+
+ GlusterFS wanted to keep tight control over the APIs in libgfapi.
+Originally bumping the SO_NAME was considered, and GlusterFS-3.6.0 was
+released with libgfapi.so.7. Not only was "7" a mistake (it should have
+been "6"), but it was quickly pointed out that many dependent packages
+that use libgfapi would be forced to be recompiled/relinked. Thus no
+packages of 3.6.0 were ever released and 3.6.1 was quickly released with
+libgfapi.so.0, but with symbol versions. There's no strong technical
+reason for either; the APIs have not changed, only new APIs have been
+added. It's merely being done in anticipation that some APIs might change
+sometime in the future.
+
+ Enough about that now, let's get into the nitty gritty——
+
+2. Adding new APIs
+
+2.1. Adding a public API.
+
+ This is the default, and the easiest thing to do. Public APIs have
+declarations in either glfs.h, glfs-handles.h, or, at your discretion,
+in a new header file intended for consumption by other developers.
+
+Here's what you need to do to add a new public API:
+
++ Write the declaration, e.g. in glfs.h:
+
+ int glfs_dtrt (const char *volname, void *stuff) __THROW
+
++ Write the definition, e.g. in glfs-dtrt.c:
+
+ int
+ pub_glfs_dtrt (const char *volname, void *stuff)
+ {
+ ...
+ return 0;
+ }
+
++ Add the symbol version magic for ELF, gnu toolchain to the definition.
+
+ following the definition of your new function in glfs-dtrtops.c, add a
+ line like this:
+
+ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_dtrt, 3.7.0)
+
+ The whole thing should look like:
+
+ int
+ pub_glfs_dtrt (const char *volname, void *stuff)
+ {
+ ...
+ }
+ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_dtrt, 3.7.0);
+
+ In this example, 3.7.0 refers to the Version the symbol will first
+ appear in. There's nothing magic about it, it's just a string token.
+ The current versions we have are 3.4.0, 3.4.2, 3.5.0, 3.5.1, and 3.6.0.
+ They are to be considered locked or closed. You can not, must not add
+ any new APIs and use these versions. Most new APIs will use 3.7.0. If
+ you add a new API appearing in 3.6.2 (and mainline) then you would use
+ 3.6.2.
+
++ Add the symbol version magic for OS X to the declaration.
+
+ following the declaration in glfs.h, add a line like this:
+
+ GFAPI_PUBLIC(glfs_dtrt, 3.7.0)
+
+ The whole thing should look like:
+
+ int glfs_dtrt (const char *volname, void *stuff) __THROW
+ GFAPI_PUBLIC(glfs_dtrt, 3.7.0);
+
+ The version here must match the version associated with the definition.
+
++ Add the new API to the ELF, gnu toolchain link map file, gfapi.map
+
+ Most new public APIs will probably be added to a new section that
+ looks like this:
+
+ GFAPI_3.7.0 {
+ global:
+ glfs_dtrt;
+ } GFAPI_PRIVATE_3.7.0;
+
+ if you're adding your new API to, e.g. 3.6.2, it'll look like this:
+
+ GFAPI_3.6.2 {
+ global:
+ glfs_dtrt;
+ } GFAPI_3.6.0;
+
+ and you must change the
+ GFAPI_PRIVATE_3.7.0 { ...} GFAPI_3.6.0;
+ section to:
+ GFAPI_PRIVATE_3.7.0 { ...} GFAPI_3.6.2;
+
++ Add the new API to the OS X alias list file, gfapi.aliases.
+
+ Most new APIs will use a line that looks like this:
+
+ _pub_glfs_dtrt _glfs_dtrt$GFAPI_3.7.0
+
+ if you're adding your new API to, e.g. 3.6.2, it'll look like this:
+
+ _pub_glfs_dtrt _glfs_dtrt$GFAPI_3.6.2
+
+And that's it.
+
+
+2.2. Adding a private API.
+
+ If you're thinking about adding a private API that isn't declared in
+one of the header files, then you should seriously rethink what you're
+doing and figure out how to put it in libglusterfs instead.
+
+If that hasn't convinced you, follow the instructions above, but use the
+_PRIVATE versions of macros, symbol versions, and aliases. If you're 1337
+enough to ignore this advice, then you're 1337 enough to figure out how
+to do it.
+
+
+3. Changing an API.
+
+3.1 Changing a public API.
+
+ There are two ways an API might change, 1) its signature has changed, or
+2) its new functionality or behavior is substantially different than the
+old. An APIs signature consists of the function return type, and the number
+and/or type of its parameters. E.g. the original API:
+
+ int glfs_dtrt (const char *volname, void *stuff);
+
+and the changed API:
+
+ void *glfs_dtrt (const char *volname, glfs_t *ctx, void *stuff);
+
+ One way to avoid a change like this, and which is preferable in many
+ways, is to leave the legacy glfs_dtrt() function alone, document it as
+deprecated, and simply add a new API, e.g. glfs_dtrt2(). Practically
+speaking, that's effectively what we'll be doing anyway, the difference
+is only that we'll use a versioned symbol to do it.
+
+ On the assumption that adding a new API is undesirable for some reason,
+perhaps the use of glfs_gnu() is just so pervasive that we really don't
+want to add glfs_gnu2().
+
++ change the declaration in glfs.h:
+
+ glfs_t *glfs_gnu (const char *volname, void *stuff) __THROW
+ GFAPI_PUBLIC(glfs_gnu, 3.7.0);
+
+Note that there is only the single, new declaration.
+
++ change the old definition of glfs_gnu() in glfs.c:
+
+ struct glfs *
+ pub_glfs_gnu340 (const char * volname)
+ {
+ ...
+ }
+ GFAPI_SYMVER_PUBLIC(glfs_gnu340, glfs_gnu, 3.4.0);
+
++ create the new definition of glfs_gnu in glfs.c:
+
+ struct glfs *
+ pub_glfs_gnu (const char * volname, void *stuff)
+ {
+ ...
+ }
+ GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_gnu, 3.7.0);
+
++ Add the new API to the ELF, gnu toolchain link map file, gfapi.map
+
+ GFAPI_3.7.0 {
+ global:
+ glfs_gnu;
+ } GFAPI_PRIVATE_3.7.0;
+
++ Update the OS X alias list file, gfapi.aliases, for both versions:
+
+Change the old line:
+ _pub_glfs_gnu _glfs_gnu$GFAPI_3.4.0
+to:
+ _pub_glfs_gnu340 _glfs_gnu$GFAPI_3.4.0
+
+Add a new line:
+ _pub_glfs_gnu _glfs_gnu$GFAPI_3.7.0
+
++ Lastly, change all gfapi internal calls glfs_gnu to the new API.
+
diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases
new file mode 100644
index 00000000000..6c0a6413098
--- /dev/null
+++ b/api/src/gfapi.aliases
@@ -0,0 +1,131 @@
+
+_priv_glfs_loc_touchup _glfs_loc_touchup$GFAPI_PRIVATE_3.4.0
+_priv_glfs_active_subvol _glfs_active_subvol$GFAPI_PRIVATE_3.4.0
+_priv_glfs_subvol_done _glfs_subvol_done$GFAPI_PRIVATE_3.4.0
+_priv_glfs_init_done _glfs_init_done$GFAPI_PRIVATE_3.4.0
+_priv_glfs_resolve_at _glfs_resolve_at$GFAPI_PRIVATE_3.4.0
+
+_pub_glfs_new _glfs_new$GFAPI_3.4.0
+_pub_glfs_set_volfile _glfs_set_volfile$GFAPI_3.4.0
+_pub_glfs_set_volfile_server _glfs_set_volfile_server$GFAPI_3.4.0
+_pub_glfs_set_logging _glfs_set_logging$GFAPI_3.4.0
+_pub_glfs_init _glfs_init$GFAPI_3.4.0
+_pub_glfs_fini _glfs_fini$GFAPI_3.4.0
+_pub_glfs_open _glfs_open$GFAPI_3.4.0
+_pub_glfs_creat _glfs_creat$GFAPI_3.4.0
+_pub_glfs_close _glfs_close$GFAPI_3.4.0
+_pub_glfs_from_glfd _glfs_from_glfd$GFAPI_3.4.0
+_pub_glfs_set_xlator_option _glfs_set_xlator_option$GFAPI_3.4.0
+_pub_glfs_read _glfs_read$GFAPI_3.4.0
+_pub_glfs_write _glfs_write$GFAPI_3.4.0
+_pub_glfs_read_async _glfs_read_async$GFAPI_3.4.0
+_pub_glfs_write_async _glfs_write_async$GFAPI_3.4.0
+_pub_glfs_readv _glfs_readv$GFAPI_3.4.0
+_pub_glfs_writev _glfs_writev$GFAPI_3.4.0
+_pub_glfs_readv_async _glfs_readv_async$GFAPI_3.4.0
+_pub_glfs_writev_async _glfs_writev_async$GFAPI_3.4.0
+_pub_glfs_pread _glfs_pread$GFAPI_3.4.0
+_pub_glfs_pwrite _glfs_pwrite$GFAPI_3.4.0
+_pub_glfs_pread_async _glfs_pread_async$GFAPI_3.4.0
+_pub_glfs_pwrite_async _glfs_pwrite_async$GFAPI_3.4.0
+_pub_glfs_preadv _glfs_preadv$GFAPI_3.4.0
+_pub_glfs_pwritev _glfs_pwritev$GFAPI_3.4.0
+_pub_glfs_preadv_async _glfs_preadv_async$GFAPI_3.4.0
+_pub_glfs_pwritev_async _glfs_pwritev_async$GFAPI_3.4.0
+_pub_glfs_lseek _glfs_lseek$GFAPI_3.4.0
+_pub_glfs_truncate _glfs_truncate$GFAPI_3.4.0
+_pub_glfs_ftruncate _glfs_ftruncate$GFAPI_3.4.0
+_pub_glfs_ftruncate_async _glfs_ftruncate_async$GFAPI_3.4.0
+_pub_glfs_lstat _glfs_lstat$GFAPI_3.4.0
+_pub_glfs_stat _glfs_stat$GFAPI_3.4.0
+_pub_glfs_fstat _glfs_fstat$GFAPI_3.4.0
+_pub_glfs_fsync _glfs_fsync$GFAPI_3.4.0
+_pub_glfs_fsync_async _glfs_fsync_async$GFAPI_3.4.0
+_pub_glfs_fdatasync _glfs_fdatasync$GFAPI_3.4.0
+_pub_glfs_fdatasync_async _glfs_fdatasync_async$GFAPI_3.4.0
+_pub_glfs_access _glfs_access$GFAPI_3.4.0
+_pub_glfs_symlink _glfs_symlink$GFAPI_3.4.0
+_pub_glfs_readlink _glfs_readlink$GFAPI_3.4.0
+_pub_glfs_mknod _glfs_mknod$GFAPI_3.4.0
+_pub_glfs_mkdir _glfs_mkdir$GFAPI_3.4.0
+_pub_glfs_unlink _glfs_unlink$GFAPI_3.4.0
+_pub_glfs_rmdir _glfs_rmdir$GFAPI_3.4.0
+_pub_glfs_rename _glfs_rename$GFAPI_3.4.0
+_pub_glfs_link _glfs_link$GFAPI_3.4.0
+_pub_glfs_opendir _glfs_opendir$GFAPI_3.4.0
+_pub_glfs_readdir_r _glfs_readdir_r$GFAPI_3.4.0
+_pub_glfs_readdirplus_r _glfs_readdirplus_r$GFAPI_3.4.0
+_pub_glfs_telldir _glfs_telldir$GFAPI_3.4.0
+_pub_glfs_seekdir _glfs_seekdir$GFAPI_3.4.0
+_pub_glfs_closedir _glfs_closedir$GFAPI_3.4.0
+_pub_glfs_statvfs _glfs_statvfs$GFAPI_3.4.0
+_pub_glfs_chmod _glfs_chmod$GFAPI_3.4.0
+_pub_glfs_fchmod _glfs_fchmod$GFAPI_3.4.0
+_pub_glfs_chown _glfs_chown$GFAPI_3.4.0
+_pub_glfs_lchown _glfs_lchown$GFAPI_3.4.0
+_pub_glfs_fchown _glfs_fchown$GFAPI_3.4.0
+_pub_glfs_utimens _glfs_utimens$GFAPI_3.4.0
+_pub_glfs_lutimens _glfs_lutimens$GFAPI_3.4.0
+_pub_glfs_futimens _glfs_futimens$GFAPI_3.4.0
+_pub_glfs_getxattr _glfs_getxattr$GFAPI_3.4.0
+_pub_glfs_lgetxattr _glfs_lgetxattr$GFAPI_3.4.0
+_pub_glfs_fgetxattr _glfs_fgetxattr$GFAPI_3.4.0
+_pub_glfs_listxattr _glfs_listxattr$GFAPI_3.4.0
+_pub_glfs_llistxattr _glfs_llistxattr$GFAPI_3.4.0
+_pub_glfs_flistxattr _glfs_flistxattr$GFAPI_3.4.0
+_pub_glfs_setxattr _glfs_setxattr$GFAPI_3.4.0
+_pub_glfs_lsetxattr _glfs_lsetxattr$GFAPI_3.4.0
+_pub_glfs_fsetxattr _glfs_fsetxattr$GFAPI_3.4.0
+_pub_glfs_removexattr _glfs_removexattr$GFAPI_3.4.0
+_pub_glfs_lremovexattr _glfs_lremovexattr$GFAPI_3.4.0
+_pub_glfs_fremovexattr _glfs_fremovexattr$GFAPI_3.4.0
+_pub_glfs_getcwd _glfs_getcwd$GFAPI_3.4.0
+_pub_glfs_chdir _glfs_chdir$GFAPI_3.4.0
+_pub_glfs_fchdir _glfs_fchdir$GFAPI_3.4.0
+_pub_glfs_realpath _glfs_realpath$GFAPI_3.4.0
+_pub_glfs_posix_lock _glfs_posix_lock$GFAPI_3.4.0
+_pub_glfs_dup _glfs_dup$GFAPI_3.4.0
+
+_pub_glfs_setfsuid _glfs_setfsuid$GFAPI_3.4.2
+_pub_glfs_setfsgid _glfs_setfsgid$GFAPI_3.4.2
+_pub_glfs_setfsgroups _glfs_setfsgroups$GFAPI_3.4.2
+_pub_glfs_h_lookupat _glfs_h_lookupat$GFAPI_3.4.2
+_pub_glfs_h_creat _glfs_h_creat$GFAPI_3.4.2
+_pub_glfs_h_mkdir _glfs_h_mkdir$GFAPI_3.4.2
+_pub_glfs_h_mknod _glfs_h_mknod$GFAPI_3.4.2
+_pub_glfs_h_symlink _glfs_h_symlink$GFAPI_3.4.2
+_pub_glfs_h_unlink _glfs_h_unlink$GFAPI_3.4.2
+_pub_glfs_h_close _glfs_h_close$GFAPI_3.4.2
+_pub_glfs_h_truncate _glfs_h_truncate$GFAPI_3.4.2
+_pub_glfs_h_stat _glfs_h_stat$GFAPI_3.4.2
+_pub_glfs_h_getattrs _glfs_h_getattrs$GFAPI_3.4.2
+_pub_glfs_h_setattrs _glfs_h_setattrs$GFAPI_3.4.2
+_pub_glfs_h_readlink _glfs_h_readlink$GFAPI_3.4.2
+_pub_glfs_h_link _glfs_h_link$GFAPI_3.4.2
+_pub_glfs_h_rename _glfs_h_rename$GFAPI_3.4.2
+_pub_glfs_h_extract_handle _glfs_h_extract_handle$GFAPI_3.4.2
+_pub_glfs_h_create_from_handle _glfs_h_create_from_handle$GFAPI_3.4.2
+_pub_glfs_h_opendir _glfs_h_opendir$GFAPI_3.4.2
+_pub_glfs_h_open _glfs_h_open$GFAPI_3.4.2
+
+_pub_glfs_get_volumeid _glfs_get_volumeid$GFAPI_3.5.0
+_pub_glfs_readdir _glfs_readdir$GFAPI_3.5.0
+_pub_glfs_readdirplus _glfs_readdirplus$GFAPI_3.5.0
+_pub_glfs_fallocate _glfs_fallocate$GFAPI_3.5.0
+_pub_glfs_discard _glfs_discard$GFAPI_3.5.0
+_pub_glfs_discard_async _glfs_discard_async$GFAPI_3.5.0
+_pub_glfs_zerofill _glfs_zerofill$GFAPI_3.5.0
+_pub_glfs_zerofill_async _glfs_zerofill_async$GFAPI_3.5.0
+_pub_glfs_h_setxattrs _glfs_h_setxattrs$GFAPI_3.5.0
+
+_pub_glfs_unset_volfile_server _glfs_unset_volfile_server$GFAPI_3.5.1
+_pub_glfs_h_getxattrs _glfs_h_getxattrs$GFAPI_3.5.1
+_pub_glfs_h_removexattrs _glfs_h_removexattrs$GFAPI_3.5.1
+
+_pub_glfs_get_volfile _glfs_get_volfile$GFAPI_3.6.0
+_pub_glfs_h_access _glfs_h_access$GFAPI_3.6.0
+
+_priv_glfs_free_from_ctx _glfs_free_from_ctx$GFAPI_PRIVATE_3.7.0
+_priv_glfs_new_from_ctx _glfs_new_from_ctx$GFAPI_PRIVATE_3.7.0
+_priv_glfs_resolve _glfs_resolve$GFAPI_PRIVATE_3.7.0
+
diff --git a/api/src/gfapi.map.in b/api/src/gfapi.map
index a29f392dc53..a29f392dc53 100644
--- a/api/src/gfapi.map.in
+++ b/api/src/gfapi.map
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index d35508e6f38..e13f53e04c5 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -79,7 +79,7 @@ pub_glfs_open (struct glfs *fs, const char *path, int flags)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -141,7 +141,7 @@ out:
glfs_fd_bind (glfd);
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return glfd;
}
@@ -159,7 +159,7 @@ pub_glfs_close (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -182,7 +182,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -201,7 +201,7 @@ pub_glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -217,7 +217,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -236,7 +236,7 @@ pub_glfs_stat (struct glfs *fs, const char *path, struct stat *stat)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -252,7 +252,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -270,7 +270,7 @@ pub_glfs_fstat (struct glfs_fd *glfd, struct stat *stat)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -293,7 +293,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -315,7 +315,7 @@ pub_glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -433,7 +433,7 @@ out:
glfs_fd_bind (glfd);
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return glfd;
}
@@ -486,7 +486,7 @@ pub_glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -521,7 +521,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -684,7 +684,7 @@ out:
GF_FREE (gio->iov);
GF_FREE (gio);
STACK_DESTROY (frame->root);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return 0;
}
@@ -704,7 +704,7 @@ pub_glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec,
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -764,7 +764,7 @@ out:
if (frame) {
STACK_DESTROY (frame->root);
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
}
if (fd)
@@ -840,7 +840,7 @@ pub_glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -900,7 +900,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -1062,7 +1062,7 @@ pub_glfs_fsync (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1082,7 +1082,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -1141,7 +1141,7 @@ pub_glfs_fdatasync (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1161,7 +1161,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -1187,7 +1187,7 @@ pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1207,7 +1207,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -1260,7 +1260,7 @@ pub_glfs_access (struct glfs *fs, const char *path, int mode)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1281,7 +1281,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1302,7 +1302,7 @@ pub_glfs_symlink (struct glfs *fs, const char *data, const char *path)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1365,7 +1365,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1385,7 +1385,7 @@ pub_glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1416,7 +1416,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1437,7 +1437,7 @@ pub_glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1500,7 +1500,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1521,7 +1521,7 @@ pub_glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1584,7 +1584,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1603,7 +1603,7 @@ pub_glfs_unlink (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1633,7 +1633,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1652,7 +1652,7 @@ pub_glfs_rmdir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1682,7 +1682,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1703,7 +1703,7 @@ pub_glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1758,7 +1758,7 @@ out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1779,7 +1779,7 @@ pub_glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1834,7 +1834,7 @@ out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1854,7 +1854,7 @@ pub_glfs_opendir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1910,7 +1910,7 @@ out:
glfs_fd_bind (glfd);
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return glfd;
}
@@ -2072,7 +2072,7 @@ glfd_entry_refresh (struct glfs_fd *glfd, int plus)
int ret = -1;
fd_t *fd = NULL;
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2121,7 +2121,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2273,7 +2273,7 @@ pub_glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2294,7 +2294,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2314,7 +2314,7 @@ glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt,
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2338,7 +2338,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2353,7 +2353,7 @@ glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2373,7 +2373,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2604,7 +2604,7 @@ glfs_getxattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2633,7 +2633,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2670,7 +2670,7 @@ pub_glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2694,7 +2694,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2743,7 +2743,7 @@ glfs_listxattr_common (struct glfs *fs, const char *path, void *value,
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2773,7 +2773,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2807,7 +2807,7 @@ pub_glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2831,7 +2831,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2872,7 +2872,7 @@ glfs_setxattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2906,7 +2906,7 @@ out:
if (xattr)
dict_unref (xattr);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2943,7 +2943,7 @@ pub_glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2973,7 +2973,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2993,7 +2993,7 @@ glfs_removexattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3018,7 +3018,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -3051,7 +3051,7 @@ pub_glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3071,7 +3071,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3088,7 +3088,7 @@ pub_glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t le
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3108,7 +3108,7 @@ out:
if (fd)
fd_unref(fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3125,7 +3125,7 @@ pub_glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3145,7 +3145,7 @@ out:
if (fd)
fd_unref(fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3162,7 +3162,7 @@ pub_glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -3180,7 +3180,7 @@ out:
if (fd)
fd_unref(fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3199,7 +3199,7 @@ pub_glfs_chdir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3224,7 +3224,7 @@ retry:
out:
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -3242,7 +3242,7 @@ pub_glfs_fchdir (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3270,7 +3270,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3302,7 +3302,7 @@ pub_glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)
goto out;
}
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3330,7 +3330,7 @@ out:
retpath = NULL;
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return retpath;
}
@@ -3418,7 +3418,7 @@ pub_glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)
__glfs_entry_fd (glfd);
- subvol = priv_glfs_active_subvol (glfd->fs);
+ subvol = glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3444,7 +3444,7 @@ out:
if (fd)
fd_unref (fd);
- priv_glfs_subvol_done (glfd->fs, subvol);
+ glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -3463,7 +3463,7 @@ pub_glfs_dup (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
fs = glfd->fs;
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -3488,7 +3488,7 @@ out:
if (dupfd)
glfs_fd_bind (dupfd);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return dupfd;
}
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 706c00f98eb..631af01d97b 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -80,7 +80,7 @@ pub_glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -96,7 +96,7 @@ pub_glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
}
/* fop/op */
- ret = priv_glfs_resolve_at (fs, subvol, inode, path, &loc, &iatt,
+ ret = glfs_resolve_at (fs, subvol, inode, path, &loc, &iatt,
0 /*TODO: links? */, 0);
/* populate out args */
@@ -113,7 +113,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -139,7 +139,7 @@ pub_glfs_h_stat (struct glfs *fs, struct glfs_object *object, struct stat *stat)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -170,7 +170,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -196,7 +196,7 @@ pub_glfs_h_getattrs (struct glfs *fs, struct glfs_object *object,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -222,7 +222,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -249,7 +249,7 @@ pub_glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -284,7 +284,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -311,7 +311,7 @@ pub_glfs_h_setattrs (struct glfs *fs, struct glfs_object *object,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -340,7 +340,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -369,7 +369,7 @@ pub_glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -406,7 +406,7 @@ out:
if (xattr)
dict_unref (xattr);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -432,7 +432,7 @@ pub_glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -459,7 +459,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -485,7 +485,7 @@ pub_glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -548,7 +548,7 @@ out:
glfd = NULL;
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return glfd;
}
@@ -579,7 +579,7 @@ pub_glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -671,7 +671,7 @@ out:
glfd = NULL;
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -701,7 +701,7 @@ pub_glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -763,7 +763,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -793,7 +793,7 @@ pub_glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -854,7 +854,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -879,7 +879,7 @@ pub_glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if ( !subvol ) {
ret = -1;
errno = EIO;
@@ -893,7 +893,7 @@ pub_glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path
goto out;
}
- ret = priv_glfs_resolve_at (fs, subvol, inode, path, &loc, NULL, 0 , 0);
+ ret = glfs_resolve_at (fs, subvol, inode, path, &loc, NULL, 0 , 0);
if (ret != 0) {
goto out;
}
@@ -921,7 +921,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -947,7 +947,7 @@ pub_glfs_h_opendir (struct glfs *fs, struct glfs_object *object)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1000,7 +1000,7 @@ out:
glfs_fd_bind (glfd);
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return glfd;
}
@@ -1025,7 +1025,7 @@ pub_glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1054,7 +1054,7 @@ out:
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1116,7 +1116,7 @@ pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -1175,7 +1175,7 @@ out:
/* TODO: Check where the inode ref is being held? */
loc_wipe (&loc);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -1213,7 +1213,7 @@ pub_glfs_h_truncate (struct glfs *fs, struct glfs_object *object, off_t offset)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1243,7 +1243,7 @@ out:
if (inode)
inode_unref (inode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1274,7 +1274,7 @@ pub_glfs_h_symlink (struct glfs *fs, struct glfs_object *parent,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1341,7 +1341,7 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return object;
}
@@ -1368,7 +1368,7 @@ pub_glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1401,7 +1401,7 @@ out:
if (linkval)
GF_FREE (linkval);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1409,9 +1409,6 @@ out:
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_readlink, 3.4.2);
-extern int
-priv_glfs_loc_touchup (loc_t *);
-
int
pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
struct glfs_object *parent, const char *name)
@@ -1433,7 +1430,7 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1465,7 +1462,7 @@ pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
/* setup newloc based on parent */
newloc.parent = inode_ref (pinode);
newloc.name = name;
- ret = priv_glfs_loc_touchup (&newloc);
+ ret = glfs_loc_touchup (&newloc);
if (ret != 0) {
errno = EINVAL;
goto out;
@@ -1493,7 +1490,7 @@ out:
if (pinode)
inode_unref (pinode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
@@ -1525,7 +1522,7 @@ pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if ( !subvol ) {
ret = -1;
errno = EIO;
@@ -1539,7 +1536,7 @@ pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
goto out;
}
- ret = priv_glfs_resolve_at (fs, subvol, oldpinode, oldname, &oldloc,
+ ret = glfs_resolve_at (fs, subvol, oldpinode, oldname, &oldloc,
&oldiatt, 0 , 0);
if (ret != 0) {
goto out;
@@ -1552,7 +1549,7 @@ pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
goto out;
}
- ret = priv_glfs_resolve_at (fs, subvol, newpinode, newname, &newloc,
+ ret = glfs_resolve_at (fs, subvol, newpinode, newname, &newloc,
&newiatt, 0, 0);
if (ret && errno != ENOENT && newloc.parent)
@@ -1590,7 +1587,7 @@ out:
if (newpinode)
inode_unref (newpinode);
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
return ret;
}
diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h
index ad963455e85..12bae6d6e86 100644
--- a/api/src/glfs-handles.h
+++ b/api/src/glfs-handles.h
@@ -87,83 +87,106 @@ typedef struct glfs_object glfs_object_t;
struct glfs_object *glfs_h_lookupat (struct glfs *fs,
struct glfs_object *parent,
const char *path,
- struct stat *stat) __THROW;
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_lookupat, 3.4.0);
struct glfs_object *glfs_h_creat (struct glfs *fs, struct glfs_object *parent,
const char *path, int flags, mode_t mode,
- struct stat *sb) __THROW;
+ struct stat *sb) __THROW
+ GFAPI_PUBLIC(glfs_h_create, 3.4.0);
struct glfs_object *glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent,
const char *path, mode_t flags,
- struct stat *sb) __THROW;
+ struct stat *sb) __THROW
+ GFAPI_PUBLIC(glfs_h_mkdir, 3.4.0);
struct glfs_object *glfs_h_mknod (struct glfs *fs, struct glfs_object *parent,
const char *path, mode_t mode, dev_t dev,
- struct stat *sb) __THROW;
+ struct stat *sb) __THROW
+ GFAPI_PUBLIC(glfs_h_mknod, 3.4.0);
struct glfs_object *glfs_h_symlink (struct glfs *fs, struct glfs_object *parent,
const char *name, const char *data,
- struct stat *stat) __THROW;
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_symlink, 3.4.0);
/* Operations on the actual objects */
int glfs_h_unlink (struct glfs *fs, struct glfs_object *parent,
- const char *path) __THROW;
+ const char *path) __THROW
+ GFAPI_PUBLIC(glfs_h_unlink, 3.4.0);
-int glfs_h_close (struct glfs_object *object) __THROW;
+int glfs_h_close (struct glfs_object *object) __THROW
+ GFAPI_PUBLIC(glfs_h_close, 3.4.0);
int glfs_caller_specific_init (void *uid_caller_key, void *gid_caller_key,
- void *future) __THROW;
+ void *future) __THROW
+ GFAPI_PUBLIC(glfs_h_lookupat, 3.5.0);
int glfs_h_truncate (struct glfs *fs, struct glfs_object *object,
- off_t offset) __THROW;
+ off_t offset) __THROW
+ GFAPI_PUBLIC(glfs_h_truncate, 3.4.0);
int glfs_h_stat(struct glfs *fs, struct glfs_object *object,
- struct stat *stat) __THROW;
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_stat, 3.4.0);
int glfs_h_getattrs (struct glfs *fs, struct glfs_object *object,
- struct stat *stat) __THROW;
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_getattrs, 3.4.0);
int glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object,
const char *name, void *value,
- size_t size) __THROW;
+ size_t size) __THROW
+ GFAPI_PUBLIC(glfs_h_lookupat, 3.5.1);
int glfs_h_setattrs (struct glfs *fs, struct glfs_object *object,
- struct stat *sb, int valid) __THROW;
+ struct stat *sb, int valid) __THROW
+ GFAPI_PUBLIC(glfs_h_setattrs, 3.4.0);
int glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object,
const char *name, const void *value,
- size_t size, int flags) __THROW;
+ size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_h_setxattrs, 3.5.0);
int glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,
- size_t bufsiz) __THROW;
+ size_t bufsiz) __THROW
+ GFAPI_PUBLIC(glfs_h_readlink, 3.4.0);
int glfs_h_link (struct glfs *fs, struct glfs_object *linktgt,
- struct glfs_object *parent, const char *name) __THROW;
+ struct glfs_object *parent, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_h_link, 3.4.0);
int glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
const char *oldname, struct glfs_object *newdir,
- const char *newname) __THROW;
+ const char *newname) __THROW
+ GFAPI_PUBLIC(glfs_h_rename, 3.4.0);
int glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object,
- const char *name) __THROW;
+ const char *name) __THROW
+ GFAPI_PUBLIC(glfs_h_removexattrs, 3.5.1);
/* Operations enabling opaque invariant handle to object transitions */
ssize_t glfs_h_extract_handle (struct glfs_object *object,
- unsigned char *handle, int len) __THROW;
+ unsigned char *handle, int len) __THROW
+ GFAPI_PUBLIC(glfs_h_extract_handle, 3.4.0);
struct glfs_object *glfs_h_create_from_handle (struct glfs *fs,
unsigned char *handle, int len,
- struct stat *stat) __THROW;
+ struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_h_create_from_handle, 3.4.0);
/* Operations enabling object handles to fd transitions */
struct glfs_fd *glfs_h_opendir (struct glfs *fs,
- struct glfs_object *object) __THROW;
+ struct glfs_object *object) __THROW
+ GFAPI_PUBLIC(glfs_h_opendir, 3.4.0);
struct glfs_fd *glfs_h_open (struct glfs *fs, struct glfs_object *object,
- int flags) __THROW;
+ int flags) __THROW
+ GFAPI_PUBLIC(glfs_h_open, 3.4.0);
int
-glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask) __THROW;
+glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask) __THROW
+ GFAPI_PUBLIC(glfs_h_access, 3.6.0);
__END_DECLS
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
index 25571f7f11c..684636c360b 100644
--- a/api/src/glfs-internal.h
+++ b/api/src/glfs-internal.h
@@ -18,6 +18,38 @@
#define DEFAULT_REVAL_COUNT 1
+#ifndef GF_DARWIN_HOST_OS
+#ifndef GFAPI_PUBLIC
+#define GFAPI_PUBLIC(sym, ver) /**/
+#endif
+#ifndef GFAPI_PRIVATE
+#define GFAPI_PRIVATE(sym, ver) /**/
+#endif
+#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, ver) \
+ asm(".symver pub_"STR(fn)", "STR(fn)"@@GFAPI_"STR(ver))
+
+#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, ver) \
+ asm(".symver priv_"STR(fn)", "STR(fn)"@@GFAPI_PRIVATE_"STR(ver))
+
+#define GFAPI_SYMVER_PUBLIC(fn1, fn2, ver) \
+ asm(".symver pub_"STR(fn1)", "STR(fn2)"@@GFAPI_"STR(ver))
+
+#define GFAPI_SYMVER_PRIVATE(fn1, fn2, ver) \
+ asm(".symver priv_"STR(fn1)", "STR(fn2)"@@GFAPI_PRIVATE_"STR(ver))
+#define STR(str) #str
+#else
+#ifndef GFAPI_PUBLIC
+#define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver))
+#endif
+#ifndef GFAPI_PRIVATE
+#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
+#endif
+#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) /**/
+#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, dotver) /**/
+#define GFAPI_SYMVER_PUBLIC(fn1, fn2, dotver) /**/
+#define GFAPI_SYMVER_PRIVATE(fn1, fn2, dotver) /**/
+#endif
+
/*
* syncop_xxx() calls are executed in two ways, one is inside a synctask where
* the executing function will do 'swapcontext' and the other is without
@@ -51,7 +83,7 @@
#define GLFS_LOC_FILL_INODE(oinode, loc, label) do { \
loc.inode = inode_ref (oinode); \
uuid_copy (loc.gfid, oinode->gfid); \
- ret = priv_glfs_loc_touchup (&loc); \
+ ret = glfs_loc_touchup (&loc); \
if (ret != 0) { \
errno = EINVAL; \
goto label; \
@@ -67,7 +99,7 @@
} \
loc.parent = inode_ref (pinode); \
loc.name = path; \
- ret = priv_glfs_loc_touchup (&loc); \
+ ret = glfs_loc_touchup (&loc); \
if (ret != 0) { \
errno = EINVAL; \
goto label; \
@@ -136,10 +168,12 @@ struct glfs_object {
#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
int glfs_mgmt_init (struct glfs *fs);
-void priv_glfs_init_done (struct glfs *fs, int ret);
+void glfs_init_done (struct glfs *fs, int ret)
+ GFAPI_PRIVATE(glfs_init_done, 3.4.0);
int glfs_process_volfp (struct glfs *fs, FILE *fp);
int priv_glfs_resolve (struct glfs *fs, xlator_t *subvol, const char *path,
- loc_t *loc, struct iatt *iatt, int reval);
+ loc_t *loc, struct iatt *iatt, int reval)
+ GFAPI_PRIVATE(glfs_resolve, 3.7.0);
int glfs_lresolve (struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc,
struct iatt *iatt, int reval);
fd_t *glfs_resolve_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd);
@@ -198,9 +232,11 @@ void glfs_fd_destroy (struct glfs_fd *glfd);
struct glfs_fd *glfs_fd_new (struct glfs *fs);
void glfs_fd_bind (struct glfs_fd *glfd);
-xlator_t *priv_glfs_active_subvol (struct glfs *fs);
+xlator_t *glfs_active_subvol (struct glfs *fs)
+ GFAPI_PRIVATE(glfs_active_subvol, 3.4.0);
xlator_t *__glfs_active_subvol (struct glfs *fs);
-void priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol);
+void glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
+ GFAPI_PRIVATE(glfs_subvol_done, 3.4.0);
inode_t *glfs_refresh_inode (xlator_t *subvol, inode_t *inode);
@@ -213,10 +249,12 @@ int __glfs_cwd_set (struct glfs *fs, inode_t *inode);
int glfs_resolve_base (struct glfs *fs, xlator_t *subvol, inode_t *inode,
struct iatt *iatt);
-int priv_glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
+int glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
const char *origpath, loc_t *loc, struct iatt *iatt,
- int follow, int reval);
-int priv_glfs_loc_touchup (loc_t *loc);
+ int follow, int reval)
+ GFAPI_PRIVATE(glfs_resolve_at, 3.4.0);
+int glfs_loc_touchup (loc_t *loc)
+ GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0);
void glfs_iatt_to_stat (struct glfs *fs, struct iatt *iatt, struct stat *stat);
int glfs_loc_link (loc_t *loc, struct iatt *iatt);
int glfs_loc_unlink (loc_t *loc);
@@ -251,7 +289,8 @@ int glfs_get_volume_info (struct glfs *fs);
NULL : Otherwise.
*/
-struct glfs *priv_glfs_new_from_ctx (glusterfs_ctx_t *ctx);
+struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx)
+ GFAPI_PRIVATE(glfs_new_from_ctx, 3.7.0);
/*
SYNOPSIS
@@ -276,13 +315,8 @@ struct glfs *priv_glfs_new_from_ctx (glusterfs_ctx_t *ctx);
void
*/
-void priv_glfs_free_from_ctx (struct glfs *fs);
+void glfs_free_from_ctx (struct glfs *fs)
+ GFAPI_PRIVATE(glfs_free_from_ctx, 3.7.0);
-#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) \
- asm(".symver pub_"STR(fn)", "STR(fn)"@@GFAPI_"STR(dotver))
-
-#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, dotver) \
- asm(".symver priv_"STR(fn)", "STR(fn)"@@GFAPI_PRIVATE_"STR(dotver))
-#define STR(str) #str
#endif /* !_GLFS_INTERNAL_H */
diff --git a/api/src/glfs-master.c b/api/src/glfs-master.c
index edf9aae37e9..0e54719d72c 100644
--- a/api/src/glfs-master.c
+++ b/api/src/glfs-master.c
@@ -27,9 +27,6 @@
#include "glfs-mem-types.h"
-extern void
-glfs_subvol_done (struct glfs *, xlator_t *);
-
int
graph_setup (struct glfs *fs, glusterfs_graph_t *graph)
{
@@ -80,9 +77,6 @@ unlock:
}
-extern void
-glfs_init_done (struct glfs *fs, int ret);
-
int
notify (xlator_t *this, int event, void *data, ...)
{
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 013be2333dd..1cba1ed1109 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -587,7 +587,7 @@ out:
gf_log ("mgmt", GF_LOG_ERROR, "Server is operating at an "
"op-version which is not supported");
errno = ENOTSUP;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
}
if (ret && ctx && !ctx->active) {
@@ -600,7 +600,7 @@ out:
if (!need_retry) {
if (!errno)
errno = EINVAL;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
}
}
@@ -699,7 +699,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
errno = ENOTCONN;
gf_log("glfs-mgmt", GF_LOG_INFO,
"Exhausted all volfile servers");
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
break;
}
server = list_entry (server->list.next, typeof(*server),
@@ -717,7 +717,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
"failed to set remote-port: %d",
server->port);
errno = ENOTCONN;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
break;
}
@@ -729,7 +729,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
"failed to set remote-host: %s",
server->volfile_server);
errno = ENOTCONN;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
break;
}
@@ -741,7 +741,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
"failed to set transport-type: %s",
server->transport);
errno = ENOTCONN;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
break;
}
gf_log ("glfs-mgmt", GF_LOG_INFO,
@@ -762,7 +762,7 @@ mgmt_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
"failed to fetch volume file (key:%s)",
ctx->cmd_args.volfile_id);
errno = EINVAL;
- priv_glfs_init_done (fs, -1);
+ glfs_init_done (fs, -1);
}
break;
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index efc08cde741..5efe91b8d5b 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -837,6 +837,32 @@ __glfs_active_subvol (struct glfs *fs)
return new_subvol;
}
+
+void
+priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
+{
+ int ref = 0;
+ xlator_t *active_subvol = NULL;
+
+ if (!subvol)
+ return;
+
+ glfs_lock (fs);
+ {
+ ref = (--subvol->winds);
+ active_subvol = fs->active_subvol;
+ }
+ glfs_unlock (fs);
+
+ if (ref == 0) {
+ assert (subvol != active_subvol);
+ xlator_notify (subvol, GF_EVENT_PARENT_DOWN, subvol, NULL);
+ }
+}
+
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_subvol_done, 3.4.0);
+
+
xlator_t *
priv_glfs_active_subvol (struct glfs *fs)
{
@@ -866,30 +892,6 @@ priv_glfs_active_subvol (struct glfs *fs)
GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_active_subvol, 3.4.0);
-void
-priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
-{
- int ref = 0;
- xlator_t *active_subvol = NULL;
-
- if (!subvol)
- return;
-
- glfs_lock (fs);
- {
- ref = (--subvol->winds);
- active_subvol = fs->active_subvol;
- }
- glfs_unlock (fs);
-
- if (ref == 0) {
- assert (subvol != active_subvol);
- xlator_notify (subvol, GF_EVENT_PARENT_DOWN, subvol, NULL);
- }
-}
-
-GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_subvol_done, 3.4.0);
-
int
__glfs_cwd_set (struct glfs *fs, inode_t *inode)
{
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 04ca7129e8e..ee1e90d75b6 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -805,9 +805,6 @@ pub_glfs_init (struct glfs *fs)
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_init, 3.4.0);
-extern xlator_t *
-priv_glfs_active_subvol (struct glfs *);
-
int
pub_glfs_fini (struct glfs *fs)
{
@@ -849,7 +846,7 @@ pub_glfs_fini (struct glfs *fs)
pthread_mutex_unlock (&fs->mutex);
if (fs_init != 0) {
- subvol = priv_glfs_active_subvol (fs);
+ subvol = glfs_active_subvol (fs);
if (subvol) {
/* PARENT_DOWN within glfs_subvol_done() is issued
only on graph switch (new graph should activiate
@@ -892,7 +889,7 @@ pub_glfs_fini (struct glfs *fs)
goto fail;
}
}
- priv_glfs_subvol_done (fs, subvol);
+ glfs_subvol_done (fs, subvol);
}
if (gf_log_fini(ctx) != 0)
diff --git a/api/src/glfs.h b/api/src/glfs.h
index 6d896f0ea13..3ef822ed3f1 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -51,6 +51,14 @@
# endif
#endif
+#ifndef GF_DARWIN_HOST_OS
+#define GFAPI_PUBLIC(sym, ver) /**/
+#define GFAPI_PRIVATE(sym, ver) /**/
+#else
+#define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver))
+#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver))
+#endif
+
__BEGIN_DECLS
/* The filesystem object. One object per 'virtual mount' */
@@ -88,7 +96,8 @@ typedef struct glfs glfs_t;
*/
-glfs_t *glfs_new (const char *volname) __THROW;
+glfs_t *glfs_new (const char *volname) __THROW
+ GFAPI_PUBLIC(glfs_new, 3.4.0);
/*
@@ -118,7 +127,8 @@ glfs_t *glfs_new (const char *volname) __THROW;
*/
-int glfs_set_volfile (glfs_t *fs, const char *volfile);
+int glfs_set_volfile (glfs_t *fs, const char *volfile) __THROW
+ GFAPI_PUBLIC(glfs_set_volfile, 3.4.0);
/*
@@ -170,9 +180,11 @@ int glfs_set_volfile (glfs_t *fs, const char *volfile);
*/
int glfs_set_volfile_server (glfs_t *fs, const char *transport,
- const char *host, int port) __THROW;
+ const char *host, int port) __THROW
+ GFAPI_PUBLIC(glfs_set_volfile_server, 3.4.0);
int glfs_unset_volfile_server (glfs_t *fs, const char *transport,
- const char *host, int port) __THROW;
+ const char *host, int port) __THROW
+ GFAPI_PUBLIC(glfs_unset_volfile_server, 3.5.1);
/*
SYNOPSIS
@@ -202,7 +214,8 @@ int glfs_unset_volfile_server (glfs_t *fs, const char *transport,
*/
-int glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW;
+int glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW
+ GFAPI_PUBLIC(glfs_set_logging, 3.4.0);
/*
@@ -229,7 +242,8 @@ int glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW;
*/
-int glfs_init (glfs_t *fs) __THROW;
+int glfs_init (glfs_t *fs) __THROW
+ GFAPI_PUBLIC(glfs_init, 3.4.0);
/*
@@ -262,7 +276,8 @@ int glfs_init (glfs_t *fs) __THROW;
0 : Success.
*/
-int glfs_fini (glfs_t *fs) __THROW;
+int glfs_fini (glfs_t *fs) __THROW
+ GFAPI_PUBLIC(glfs_fini, 3.4.0);
/*
SYNOPSIS
@@ -292,7 +307,8 @@ int glfs_fini (glfs_t *fs) __THROW;
<0: volfile length exceeds @len by N bytes (@buf unchanged)
*/
-ssize_t glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW;
+ssize_t glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW
+ GFAPI_PUBLIC(glfs_get_volfile, 3.6.0);
/*
@@ -323,7 +339,8 @@ ssize_t glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW;
Others : length of the volume UUID stored.
*/
-int glfs_get_volumeid (struct glfs *fs, char *volid, size_t size);
+int glfs_get_volumeid (struct glfs *fs, char *volid, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_get_volumeid, 3.5.0);
/*
@@ -368,9 +385,12 @@ typedef struct glfs_fd glfs_fd_t;
* reverted to global process defaults as required.
*
*/
-int glfs_setfsuid (uid_t fsuid) __THROW;
-int glfs_setfsgid (gid_t fsgid) __THROW;
-int glfs_setfsgroups (size_t size, const gid_t *list) __THROW;
+int glfs_setfsuid (uid_t fsuid) __THROW
+ GFAPI_PUBLIC(glfs_setfsuid, 3.4.2);
+int glfs_setfsgid (gid_t fsgid) __THROW
+ GFAPI_PUBLIC(glfs_setfsgid, 3.4.2);
+int glfs_setfsgroups (size_t size, const gid_t *list) __THROW
+ GFAPI_PUBLIC(glfs_setfsgroups, 3.4.2);
/*
SYNOPSIS
@@ -397,7 +417,8 @@ int glfs_setfsgroups (size_t size, const gid_t *list) __THROW;
*/
-glfs_fd_t *glfs_open (glfs_t *fs, const char *path, int flags) __THROW;
+glfs_fd_t *glfs_open (glfs_t *fs, const char *path, int flags) __THROW
+ GFAPI_PUBLIC(glfs_open, 3.4.0);
/*
@@ -427,14 +448,18 @@ glfs_fd_t *glfs_open (glfs_t *fs, const char *path, int flags) __THROW;
*/
glfs_fd_t *glfs_creat (glfs_t *fs, const char *path, int flags,
- mode_t mode) __THROW;
+ mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_creat, 3.4.0);
-int glfs_close (glfs_fd_t *fd) __THROW;
+int glfs_close (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_close, 3.4.0);
-glfs_t *glfs_from_glfd (glfs_fd_t *fd) __THROW;
+glfs_t *glfs_from_glfd (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_from_glfd, 3.4.0);
int glfs_set_xlator_option (glfs_t *fs, const char *xlator, const char *key,
- const char *value) __THROW;
+ const char *value) __THROW
+ GFAPI_PUBLIC(glfs_set_xlator_options, 3.4.0);
/*
@@ -464,88 +489,125 @@ typedef void (*glfs_io_cbk) (glfs_fd_t *fd, ssize_t ret, void *data);
// glfs_{read,write}[_async]
ssize_t glfs_read (glfs_fd_t *fd, void *buf,
- size_t count, int flags) __THROW;
+ size_t count, int flags) __THROW
+ GFAPI_PUBLIC(glfs_read, 3.4.0);
ssize_t glfs_write (glfs_fd_t *fd, const void *buf,
- size_t count, int flags) __THROW;
+ size_t count, int flags) __THROW
+ GFAPI_PUBLIC(glfs_write, 3.4.0);
int glfs_read_async (glfs_fd_t *fd, void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_read_async, 3.4.0);
int glfs_write_async (glfs_fd_t *fd, const void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_write_async, 3.4.0);
// glfs_{read,write}v[_async]
ssize_t glfs_readv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- int flags) __THROW;
+ int flags) __THROW
+ GFAPI_PUBLIC(glfs_readv, 3.4.0);
ssize_t glfs_writev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- int flags) __THROW;
+ int flags) __THROW
+ GFAPI_PUBLIC(glfs_writev, 3.4.0);
int glfs_readv_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data) __THROW;
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_readv_async, 3.4.0);
int glfs_writev_async (glfs_fd_t *fd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data) __THROW;
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_writev_async, 3.4.0);
// glfs_p{read,write}[_async]
ssize_t glfs_pread (glfs_fd_t *fd, void *buf, size_t count, off_t offset,
- int flags) __THROW;
+ int flags) __THROW
+ GFAPI_PUBLIC(glfs_pread, 3.4.0);
ssize_t glfs_pwrite (glfs_fd_t *fd, const void *buf, size_t count,
- off_t offset, int flags) __THROW;
+ off_t offset, int flags) __THROW
+ GFAPI_PUBLIC(glfs_pwrite, 3.4.0);
int glfs_pread_async (glfs_fd_t *fd, void *buf, size_t count, off_t offset,
- int flags, glfs_io_cbk fn, void *data) __THROW;
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pread_async, 3.4.0);
int glfs_pwrite_async (glfs_fd_t *fd, const void *buf, int count, off_t offset,
- int flags, glfs_io_cbk fn, void *data) __THROW;
+ int flags, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pwrite_async, 3.4.0);
// glfs_p{read,write}v[_async]
ssize_t glfs_preadv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- off_t offset, int flags) __THROW;
+ off_t offset, int flags) __THROW
+ GFAPI_PUBLIC(glfs_preadv, 3.4.0);
ssize_t glfs_pwritev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt,
- off_t offset, int flags) __THROW;
+ off_t offset, int flags) __THROW
+ GFAPI_PUBLIC(glfs_pwritev, 3.4.0);
int glfs_preadv_async (glfs_fd_t *fd, const struct iovec *iov,
int count, off_t offset, int flags,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_preadv_async, 3.4.0);
int glfs_pwritev_async (glfs_fd_t *fd, const struct iovec *iov,
int count, off_t offset, int flags,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_pwritev_async, 3.4.0);
-off_t glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW;
+off_t glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW
+ GFAPI_PUBLIC(glfs_lseek, 3.4.0);
-int glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW;
+int glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW
+ GFAPI_PUBLIC(glfs_truncate, 3.4.0);
-int glfs_ftruncate (glfs_fd_t *fd, off_t length) __THROW;
+int glfs_ftruncate (glfs_fd_t *fd, off_t length) __THROW
+ GFAPI_PUBLIC(glfs_ftruncate, 3.4.0);
int glfs_ftruncate_async (glfs_fd_t *fd, off_t length, glfs_io_cbk fn,
- void *data) __THROW;
+ void *data) __THROW
+ GFAPI_PUBLIC(glfs_ftruncate_async, 3.4.0);
-int glfs_lstat (glfs_t *fs, const char *path, struct stat *buf) __THROW;
-int glfs_stat (glfs_t *fs, const char *path, struct stat *buf) __THROW;
-int glfs_fstat (glfs_fd_t *fd, struct stat *buf) __THROW;
+int glfs_lstat (glfs_t *fs, const char *path, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_lstat, 3.4.0);
+int glfs_stat (glfs_t *fs, const char *path, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_stat, 3.4.0);
+int glfs_fstat (glfs_fd_t *fd, struct stat *buf) __THROW
+ GFAPI_PUBLIC(glfs_fstat, 3.4.0);
-int glfs_fsync (glfs_fd_t *fd) __THROW;
-int glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW;
+int glfs_fsync (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_fsync, 3.4.0);
+int glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_fsync_async, 3.4.0);
-int glfs_fdatasync (glfs_fd_t *fd) __THROW;
-int glfs_fdatasync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW;
+int glfs_fdatasync (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_fdatasync, 3.4.0);
+int glfs_fdatasync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_fdatasync_async, 3.4.0);
-int glfs_access (glfs_t *fs, const char *path, int mode) __THROW;
+int glfs_access (glfs_t *fs, const char *path, int mode) __THROW
+ GFAPI_PUBLIC(glfs_access, 3.4.0);
-int glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) __THROW;
+int glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_symlink, 3.4.0);
int glfs_readlink (glfs_t *fs, const char *path,
- char *buf, size_t bufsiz) __THROW;
+ char *buf, size_t bufsiz) __THROW
+ GFAPI_PUBLIC(glfs_readlink, 3.4.0);
-int glfs_mknod (glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW;
+int glfs_mknod (glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW
+ GFAPI_PUBLIC(glfs_mknod, 3.4.0);
-int glfs_mkdir (glfs_t *fs, const char *path, mode_t mode) __THROW;
+int glfs_mkdir (glfs_t *fs, const char *path, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_mkdir, 3.4.0);
-int glfs_unlink (glfs_t *fs, const char *path) __THROW;
+int glfs_unlink (glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_unlink, 3.4.0);
-int glfs_rmdir (glfs_t *fs, const char *path) __THROW;
+int glfs_rmdir (glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_rmdir, 3.4.0);
-int glfs_rename (glfs_t *fs, const char *oldpath, const char *newpath) __THROW;
+int glfs_rename (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_rename, 3.4.0);
-int glfs_link (glfs_t *fs, const char *oldpath, const char *newpath) __THROW;
+int glfs_link (glfs_t *fs, const char *oldpath, const char *newpath) __THROW
+ GFAPI_PUBLIC(glfs_link, 3.4.0);
-glfs_fd_t *glfs_opendir (glfs_t *fs, const char *path) __THROW;
+glfs_fd_t *glfs_opendir (glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_opendir, 3.4.0);
/*
* @glfs_readdir_r and @glfs_readdirplus_r ARE thread safe AND re-entrant,
@@ -556,10 +618,12 @@ glfs_fd_t *glfs_opendir (glfs_t *fs, const char *path) __THROW;
*/
int glfs_readdir_r (glfs_fd_t *fd, struct dirent *dirent,
- struct dirent **result) __THROW;
+ struct dirent **result) __THROW
+ GFAPI_PUBLIC(glfs_readdir_r, 3.4.0);
int glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent,
- struct dirent **result) __THROW;
+ struct dirent **result) __THROW
+ GFAPI_PUBLIC(glfs_readdirplus_r, 3.4.0);
/*
* @glfs_readdir and @glfs_readdirplus are NEITHER thread safe NOR re-entrant
@@ -568,96 +632,133 @@ int glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent,
* referring to the same directory too.)
*/
-struct dirent *glfs_readdir (glfs_fd_t *fd) __THROW;
+struct dirent *glfs_readdir (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_readdir, 3.5.0);
-struct dirent *glfs_readdirplus (glfs_fd_t *fd, struct stat *stat) __THROW;
+struct dirent *glfs_readdirplus (glfs_fd_t *fd, struct stat *stat) __THROW
+ GFAPI_PUBLIC(glfs_readdirplus, 3.5.0);
-long glfs_telldir (glfs_fd_t *fd) __THROW;
+long glfs_telldir (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_telldir, 3.4.0);
-void glfs_seekdir (glfs_fd_t *fd, long offset) __THROW;
+void glfs_seekdir (glfs_fd_t *fd, long offset) __THROW
+ GFAPI_PUBLIC(glfs_seekdir, 3.4.0);
-int glfs_closedir (glfs_fd_t *fd) __THROW;
+int glfs_closedir (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_closedir, 3.4.0);
-int glfs_statvfs (glfs_t *fs, const char *path, struct statvfs *buf) __THROW;
+int glfs_statvfs (glfs_t *fs, const char *path, struct statvfs *buf) __THROW
+ GFAPI_PUBLIC(glfs_statvfs, 3.4.0);
-int glfs_chmod (glfs_t *fs, const char *path, mode_t mode) __THROW;
+int glfs_chmod (glfs_t *fs, const char *path, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_chmod, 3.4.0);
-int glfs_fchmod (glfs_fd_t *fd, mode_t mode) __THROW;
+int glfs_fchmod (glfs_fd_t *fd, mode_t mode) __THROW
+ GFAPI_PUBLIC(glfs_fchmod, 3.4.0);
-int glfs_chown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW;
+int glfs_chown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_chown, 3.4.0);
-int glfs_lchown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW;
+int glfs_lchown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_lchown, 3.4.0);
-int glfs_fchown (glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW;
+int glfs_fchown (glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW
+ GFAPI_PUBLIC(glfs_fchown, 3.4.0);
int glfs_utimens (glfs_t *fs, const char *path,
- struct timespec times[2]) __THROW;
+ struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_utimens, 3.4.0);
int glfs_lutimens (glfs_t *fs, const char *path,
- struct timespec times[2]) __THROW;
+ struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_lutimens, 3.4.0);
-int glfs_futimens (glfs_fd_t *fd, struct timespec times[2]) __THROW;
+int glfs_futimens (glfs_fd_t *fd, struct timespec times[2]) __THROW
+ GFAPI_PUBLIC(glfs_futimens, 3.4.0);
ssize_t glfs_getxattr (glfs_t *fs, const char *path, const char *name,
- void *value, size_t size) __THROW;
+ void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_getxattr, 3.4.0);
ssize_t glfs_lgetxattr (glfs_t *fs, const char *path, const char *name,
- void *value, size_t size) __THROW;
+ void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_lgetxattr, 3.4.0);
ssize_t glfs_fgetxattr (glfs_fd_t *fd, const char *name,
- void *value, size_t size) __THROW;
+ void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_fgetxattr, 3.4.0);
ssize_t glfs_listxattr (glfs_t *fs, const char *path,
- void *value, size_t size) __THROW;
+ void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_listxattr, 3.4.0);
ssize_t glfs_llistxattr (glfs_t *fs, const char *path, void *value,
- size_t size) __THROW;
+ size_t size) __THROW
+ GFAPI_PUBLIC(glfs_llistxattr, 3.4.0);
-ssize_t glfs_flistxattr (glfs_fd_t *fd, void *value, size_t size) __THROW;
+ssize_t glfs_flistxattr (glfs_fd_t *fd, void *value, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_flistxattr, 3.4.0);
int glfs_setxattr (glfs_t *fs, const char *path, const char *name,
- const void *value, size_t size, int flags) __THROW;
+ const void *value, size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_setxattr, 3.4.0);
int glfs_lsetxattr (glfs_t *fs, const char *path, const char *name,
- const void *value, size_t size, int flags) __THROW;
+ const void *value, size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_lsetxattr, 3.4.0);
int glfs_fsetxattr (glfs_fd_t *fd, const char *name,
- const void *value, size_t size, int flags) __THROW;
+ const void *value, size_t size, int flags) __THROW
+ GFAPI_PUBLIC(glfs_fsetxattr, 3.4.0);
-int glfs_removexattr (glfs_t *fs, const char *path, const char *name) __THROW;
+int glfs_removexattr (glfs_t *fs, const char *path, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_removexattr, 3.4.0);
-int glfs_lremovexattr (glfs_t *fs, const char *path, const char *name) __THROW;
+int glfs_lremovexattr (glfs_t *fs, const char *path, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_lremovexattr, 3.4.0);
-int glfs_fremovexattr (glfs_fd_t *fd, const char *name) __THROW;
+int glfs_fremovexattr (glfs_fd_t *fd, const char *name) __THROW
+ GFAPI_PUBLIC(glfs_fremovexattr, 3.4.0);
int glfs_fallocate(glfs_fd_t *fd, int keep_size,
- off_t offset, size_t len) __THROW;
+ off_t offset, size_t len) __THROW
+ GFAPI_PUBLIC(glfs_fallocate, 3.5.0);
-int glfs_discard(glfs_fd_t *fd, off_t offset, size_t len) __THROW;
+int glfs_discard(glfs_fd_t *fd, off_t offset, size_t len) __THROW
+ GFAPI_PUBLIC(glfs_discard, 3.5.0);
int glfs_discard_async (glfs_fd_t *fd, off_t length, size_t lent,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_discard_async, 3.5.0);
-int glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW;
+int glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW
+ GFAPI_PUBLIC(glfs_zerofill, 3.5.0);
int glfs_zerofill_async (glfs_fd_t *fd, off_t length, off_t len,
- glfs_io_cbk fn, void *data) __THROW;
+ glfs_io_cbk fn, void *data) __THROW
+ GFAPI_PUBLIC(glfs_zerofill_async, 3.5.0);
-char *glfs_getcwd (glfs_t *fs, char *buf, size_t size) __THROW;
+char *glfs_getcwd (glfs_t *fs, char *buf, size_t size) __THROW
+ GFAPI_PUBLIC(glfs_getcwd, 3.4.0);
-int glfs_chdir (glfs_t *fs, const char *path) __THROW;
+int glfs_chdir (glfs_t *fs, const char *path) __THROW
+ GFAPI_PUBLIC(glfs_chdir, 3.4.0);
-int glfs_fchdir (glfs_fd_t *fd) __THROW;
+int glfs_fchdir (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_fchdir, 3.4.0);
-char *glfs_realpath (glfs_t *fs, const char *path, char *resolved_path) __THROW;
+char *glfs_realpath (glfs_t *fs, const char *path, char *resolved_path) __THROW
+ GFAPI_PUBLIC(glfs_realpath, 3.4.0);
/*
* @cmd and @flock are as specified in man fcntl(2).
*/
-int glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW;
+int glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW
+ GFAPI_PUBLIC(glfs_posix_lock, 3.4.0);
-glfs_fd_t *glfs_dup (glfs_fd_t *fd) __THROW;
+glfs_fd_t *glfs_dup (glfs_fd_t *fd) __THROW
+ GFAPI_PUBLIC(glfs_dup, 3.4.0);
__END_DECLS
diff --git a/configure.ac b/configure.ac
index b3e4a00e56a..a9326aa1a21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -206,7 +206,6 @@ AC_CONFIG_FILES([Makefile
libgfchangelog.pc
api/Makefile
api/src/Makefile
- api/src/gfapi.map
api/examples/Makefile
geo-replication/Makefile
geo-replication/src/Makefile
@@ -944,6 +943,15 @@ case $host_os in
;;
esac
+case $host_os in
+ darwin*)
+ GFAPI_EXTRA_LDFLAGS='-Wl,-alias_list,$(top_srcdir)/api/src/gfapi.aliases'
+ ;;
+ *)
+ GFAPI_EXTRA_LDFLAGS='-Wl,--version-script=$(top_srcdir)/api/src/gfapi.map'
+ ;;
+esac
+
# lazy umount emulation
UMOUNTD_SUBDIR=""
if test "x${GF_HOST_OS}" != "xGF_LINUX_HOST_OS" ; then
@@ -1141,6 +1149,7 @@ AC_SUBST(LIBGFRPC_LT_VERSION)
AC_SUBST(LIBGLUSTERFS_LT_VERSION)
AC_SUBST(LIBGFCHANGELOG_LT_VERSION)
AC_SUBST(GFAPI_LT_VERSION)
+AC_SUBST(GFAPI_EXTRA_LDFLAGS)
dnl this change necessary for run-tests.sh
AC_CONFIG_FILES([tests/env.rc],[ln -s ${ac_abs_builddir}/env.rc ${ac_abs_srcdir}/env.rc 2>/dev/null])
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 10607ea9155..a9baad3ac56 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -37,9 +37,6 @@ out:
return ret;
}
-extern int glfs_loc_touchup (loc_t *);
-xlator_t *glfs_active_subvol (struct glfs *);
-void glfs_subvol_done (struct glfs *, xlator_t *);
int
glfsh_get_index_dir_loc (loc_t *rootloc, xlator_t *xl, loc_t *dirloc,