summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/src/Makefile.am3
-rw-r--r--api/src/gfapi.map.in153
-rw-r--r--api/src/glfs-fops.c614
-rw-r--r--api/src/glfs-handleops.c238
-rw-r--r--api/src/glfs-internal.h35
-rw-r--r--api/src/glfs-master.c12
-rw-r--r--api/src/glfs-mgmt.c18
-rw-r--r--api/src/glfs-resolve.c29
-rw-r--r--api/src/glfs.c90
9 files changed, 831 insertions, 361 deletions
diff --git a/api/src/Makefile.am b/api/src/Makefile.am
index c9992d1d363..0a2101fe549 100644
--- a/api/src/Makefile.am
+++ b/api/src/Makefile.am
@@ -15,7 +15,8 @@ libgfapi_la_CPPFLAGS = $(GF_CPPFLAGS) -D__USE_FILE_OFFSET64 \
-I$(top_srcdir)/rpc/rpc-lib/src \
-I$(top_srcdir)/rpc/xdr/src
-libgfapi_la_LDFLAGS = -version-info $(GFAPI_LT_VERSION)
+libgfapi_la_LDFLAGS = -version-info $(GFAPI_LT_VERSION) \
+ -Wl,--version-script=gfapi.map
xlator_LTLIBRARIES = api.la
xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/mount
diff --git a/api/src/gfapi.map.in b/api/src/gfapi.map.in
new file mode 100644
index 00000000000..7fc95971f1b
--- /dev/null
+++ b/api/src/gfapi.map.in
@@ -0,0 +1,153 @@
+
+GFAPI_PRIVATE_3.4.0 {
+ global:
+ glfs_loc_touchup;
+ glfs_active_subvol;
+ glfs_subvol_done;
+ glfs_init_done;
+ glfs_resolve_at;
+ local: *;
+};
+
+GFAPI_3.4.0 {
+ global:
+ glfs_new;
+ glfs_set_volfile;
+ glfs_set_volfile_server;
+ glfs_set_logging;
+ glfs_init;
+ glfs_fini;
+ glfs_open;
+ glfs_creat;
+ glfs_close;
+ glfs_from_glfd;
+ glfs_set_xlator_option;
+ glfs_read;
+ glfs_write;
+ glfs_read_async;
+ glfs_write_async;
+ glfs_readv;
+ glfs_writev;
+ glfs_readv_async;
+ glfs_writev_async;
+ glfs_pread;
+ glfs_pwrite;
+ glfs_pread_async;
+ glfs_pwrite_async;
+ glfs_preadv;
+ glfs_pwritev;
+ glfs_preadv_async;
+ glfs_pwritev_async;
+ glfs_lseek;
+ glfs_truncate;
+ glfs_ftruncate;
+ glfs_ftruncate_async;
+ glfs_lstat;
+ glfs_stat;
+ glfs_fstat;
+ glfs_fsync;
+ glfs_fsync_async;
+ glfs_fdatasync;
+ glfs_fdatasync_async;
+ glfs_access;
+ glfs_symlink;
+ glfs_readlink;
+ glfs_mknod;
+ glfs_mkdir;
+ glfs_unlink;
+ glfs_rmdir;
+ glfs_rename;
+ glfs_link;
+ glfs_opendir;
+ glfs_readdir_r;
+ glfs_readdirplus_r;
+ glfs_telldir;
+ glfs_seekdir;
+ glfs_closedir;
+ glfs_statvfs;
+ glfs_chmod;
+ glfs_fchmod;
+ glfs_chown;
+ glfs_lchown;
+ glfs_fchown;
+ glfs_utimens;
+ glfs_lutimens;
+ glfs_futimens;
+ glfs_getxattr;
+ glfs_lgetxattr;
+ glfs_fgetxattr;
+ glfs_listxattr;
+ glfs_llistxattr;
+ glfs_flistxattr;
+ glfs_setxattr;
+ glfs_lsetxattr;
+ glfs_fsetxattr;
+ glfs_removexattr;
+ glfs_lremovexattr;
+ glfs_fremovexattr;
+ glfs_getcwd;
+ glfs_chdir;
+ glfs_fchdir;
+ glfs_realpath;
+ glfs_posix_lock;
+ glfs_dup;
+} GFAPI_PRIVATE_3.4.0;
+
+GFAPI_3.4.2 {
+ global:
+ glfs_setfsuid;
+ glfs_setfsgid;
+ glfs_setfsgroups;
+ glfs_h_lookupat;
+ glfs_h_creat;
+ glfs_h_mkdir;
+ glfs_h_mknod;
+ glfs_h_symlink;
+ glfs_h_unlink;
+ glfs_h_close;
+ glfs_h_truncate;
+ glfs_h_stat;
+ glfs_h_getattrs;
+ glfs_h_setattrs;
+ glfs_h_readlink;
+ glfs_h_link;
+ glfs_h_rename;
+ glfs_h_extract_handle;
+ glfs_h_create_from_handle;
+ glfs_h_opendir;
+ glfs_h_open;
+} GFAPI_3.4.0;
+
+GFAPI_3.5.0 {
+ global:
+ glfs_get_volumeid;
+ glfs_readdir;
+ glfs_readdirplus;
+ glfs_fallocate;
+ glfs_discard;
+ glfs_discard_async;
+ glfs_zerofill;
+ glfs_zerofill_async;
+ glfs_caller_specific_init;
+ glfs_h_setxattrs;
+} GFAPI_3.4.2;
+
+GFAPI_3.5.1 {
+ global:
+ glfs_unset_volfile_server;
+ glfs_h_getxattrs;
+ glfs_h_removexattrs;
+} GFAPI_3.5.0;
+
+GFAPI_3.6.0 {
+ global:
+ glfs_get_volfile;
+ glfs_h_access;
+} GFAPI_3.5.1;
+
+GFAPI_PRIVATE_3.7.0 {
+ global:
+ glfs_free_from_ctx;
+ glfs_new_from_ctx;
+} GFAPI_3.6.0;
+
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 66a3df2b2d1..b93a077fcdf 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -68,7 +68,7 @@ glfs_loc_unlink (loc_t *loc)
struct glfs_fd *
-glfs_open (struct glfs *fs, const char *path, int flags)
+pub_glfs_open (struct glfs *fs, const char *path, int flags)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -79,7 +79,7 @@ glfs_open (struct glfs *fs, const char *path, int flags)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -141,14 +141,16 @@ out:
glfs_fd_bind (glfd);
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return glfd;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_open, 3.4.0);
+
int
-glfs_close (struct glfs_fd *glfd)
+pub_glfs_close (struct glfs_fd *glfd)
{
xlator_t *subvol = NULL;
int ret = -1;
@@ -157,7 +159,7 @@ glfs_close (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -180,14 +182,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_close, 3.4.0);
+
int
-glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)
+pub_glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -197,7 +201,7 @@ glfs_lstat (struct glfs *fs, const char *path, struct stat *stat)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -213,14 +217,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lstat, 3.4.0);
+
int
-glfs_stat (struct glfs *fs, const char *path, struct stat *stat)
+pub_glfs_stat (struct glfs *fs, const char *path, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -230,7 +236,7 @@ glfs_stat (struct glfs *fs, const char *path, struct stat *stat)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -246,14 +252,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_stat, 3.4.0);
+
int
-glfs_fstat (struct glfs_fd *glfd, struct stat *stat)
+pub_glfs_fstat (struct glfs_fd *glfd, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -262,7 +270,7 @@ glfs_fstat (struct glfs_fd *glfd, struct stat *stat)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -285,14 +293,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fstat, 3.4.0);
+
struct glfs_fd *
-glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)
+pub_glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -305,7 +315,7 @@ glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -423,14 +433,16 @@ out:
glfs_fd_bind (glfd);
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return glfd;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_creat, 3.4.0);
+
off_t
-glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)
+pub_glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)
{
struct stat sb = {0, };
int ret = -1;
@@ -445,7 +457,7 @@ glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)
glfd->offset += offset;
break;
case SEEK_END:
- ret = glfs_fstat (glfd, &sb);
+ ret = pub_glfs_fstat (glfd, &sb);
if (ret) {
/* seek cannot fail :O */
break;
@@ -457,12 +469,12 @@ glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence)
return glfd->offset;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lseek, 3.4.0);
-//////////////
ssize_t
-glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags)
+pub_glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
+ off_t offset, int flags)
{
xlator_t *subvol = NULL;
ssize_t ret = -1;
@@ -474,7 +486,7 @@ glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -509,14 +521,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv, 3.4.0);
+
ssize_t
-glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags)
+pub_glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -524,15 +538,17 @@ glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags)
iov.iov_base = buf;
iov.iov_len = count;
- ret = glfs_preadv (glfd, &iov, 1, glfd->offset, flags);
+ ret = pub_glfs_preadv (glfd, &iov, 1, glfd->offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read, 3.4.0);
+
ssize_t
-glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
- int flags)
+pub_glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
+ int flags)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -540,23 +556,27 @@ glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
iov.iov_base = buf;
iov.iov_len = count;
- ret = glfs_preadv (glfd, &iov, 1, offset, flags);
+ ret = pub_glfs_preadv (glfd, &iov, 1, offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread, 3.4.0);
+
ssize_t
-glfs_readv (struct glfs_fd *glfd, const struct iovec *iov, int count,
- int flags)
+pub_glfs_readv (struct glfs_fd *glfd, const struct iovec *iov, int count,
+ int flags)
{
ssize_t ret = 0;
- ret = glfs_preadv (glfd, iov, count, glfd->offset, flags);
+ ret = pub_glfs_preadv (glfd, iov, count, glfd->offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv, 3.4.0);
+
struct glfs_io {
struct glfs_fd *glfd;
@@ -583,6 +603,23 @@ glfs_io_async_cbk (int ret, call_frame_t *frame, void *data)
return 0;
}
+ssize_t
+pub_glfs_pwritev (struct glfs_fd *, const struct iovec *, int, off_t, int);
+
+int
+pub_glfs_ftruncate (struct glfs_fd *, off_t);
+
+int
+pub_glfs_fdatasync (struct glfs_fd *);
+
+int
+pub_glfs_fsync (struct glfs_fd *glfd);
+
+int
+pub_glfs_discard (struct glfs_fd *, off_t, size_t);
+
+int
+pub_glfs_zerofill (struct glfs_fd *, off_t, off_t);
static int
glfs_io_async_task (void *data)
@@ -592,23 +629,23 @@ glfs_io_async_task (void *data)
switch (gio->op) {
case GF_FOP_WRITE:
- ret = glfs_pwritev (gio->glfd, gio->iov, gio->count,
+ ret = pub_glfs_pwritev (gio->glfd, gio->iov, gio->count,
gio->offset, gio->flags);
break;
case GF_FOP_FTRUNCATE:
- ret = glfs_ftruncate (gio->glfd, gio->offset);
+ ret = pub_glfs_ftruncate (gio->glfd, gio->offset);
break;
case GF_FOP_FSYNC:
if (gio->flags)
- ret = glfs_fdatasync (gio->glfd);
+ ret = pub_glfs_fdatasync (gio->glfd);
else
- ret = glfs_fsync (gio->glfd);
+ ret = pub_glfs_fsync (gio->glfd);
break;
case GF_FOP_DISCARD:
- ret = glfs_discard (gio->glfd, gio->offset, gio->count);
+ ret = pub_glfs_discard (gio->glfd, gio->offset, gio->count);
break;
case GF_FOP_ZEROFILL:
- ret = glfs_zerofill(gio->glfd, gio->offset, gio->count);
+ ret = pub_glfs_zerofill(gio->glfd, gio->offset, gio->count);
break;
}
@@ -647,15 +684,16 @@ out:
GF_FREE (gio->iov);
GF_FREE (gio);
STACK_DESTROY (frame->root);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return 0;
}
int
-glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
- off_t offset, int flags, glfs_io_cbk fn, void *data)
+pub_glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec,
+ int count, off_t offset, int flags, glfs_io_cbk fn,
+ void *data)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -666,7 +704,7 @@ glfs_preadv_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -726,7 +764,7 @@ out:
if (frame) {
STACK_DESTROY (frame->root);
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
}
if (fd)
@@ -735,10 +773,12 @@ out:
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_preadv_async, 3.4.0);
+
int
-glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data)
+pub_glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags,
+ glfs_io_cbk fn, void *data)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -746,15 +786,17 @@ glfs_read_async (struct glfs_fd *glfd, void *buf, size_t count, int flags,
iov.iov_base = buf;
iov.iov_len = count;
- ret = glfs_preadv_async (glfd, &iov, 1, glfd->offset, flags, fn, data);
+ ret = pub_glfs_preadv_async (glfd, &iov, 1, glfd->offset, flags, fn, data);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_read_async, 3.4.0);
+
int
-glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
- int flags, glfs_io_cbk fn, void *data)
+pub_glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count,
+ off_t offset, int flags, glfs_io_cbk fn, void *data)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -762,28 +804,31 @@ glfs_pread_async (struct glfs_fd *glfd, void *buf, size_t count, off_t offset,
iov.iov_base = buf;
iov.iov_len = count;
- ret = glfs_preadv_async (glfd, &iov, 1, offset, flags, fn, data);
+ ret = pub_glfs_preadv_async (glfd, &iov, 1, offset, flags, fn, data);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pread_async, 3.4.0);
+
int
-glfs_readv_async (struct glfs_fd *glfd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data)
+pub_glfs_readv_async (struct glfs_fd *glfd, const struct iovec *iov, int count,
+ int flags, glfs_io_cbk fn, void *data)
{
ssize_t ret = 0;
- ret = glfs_preadv_async (glfd, iov, count, glfd->offset, flags,
- fn, data);
+ ret = pub_glfs_preadv_async (glfd, iov, count, glfd->offset, flags,
+ fn, data);
return ret;
}
-///// writev /////
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readv_async, 3.4.0);
+
ssize_t
-glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
- off_t offset, int flags)
+pub_glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
+ off_t offset, int flags)
{
xlator_t *subvol = NULL;
int ret = -1;
@@ -795,7 +840,7 @@ glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt,
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -855,14 +900,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev, 3.4.0);
+
ssize_t
-glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags)
+pub_glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -870,28 +917,31 @@ glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags)
iov.iov_base = (void *) buf;
iov.iov_len = count;
- ret = glfs_pwritev (glfd, &iov, 1, glfd->offset, flags);
+ ret = pub_glfs_pwritev (glfd, &iov, 1, glfd->offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write, 3.4.0);
ssize_t
-glfs_writev (struct glfs_fd *glfd, const struct iovec *iov, int count,
- int flags)
+pub_glfs_writev (struct glfs_fd *glfd, const struct iovec *iov, int count,
+ int flags)
{
ssize_t ret = 0;
- ret = glfs_pwritev (glfd, iov, count, glfd->offset, flags);
+ ret = pub_glfs_pwritev (glfd, iov, count, glfd->offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev, 3.4.0);
+
ssize_t
-glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, off_t offset,
- int flags)
+pub_glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count,
+ off_t offset, int flags)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -899,15 +949,20 @@ glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, off_t offset,
iov.iov_base = (void *) buf;
iov.iov_len = count;
- ret = glfs_pwritev (glfd, &iov, 1, offset, flags);
+ ret = pub_glfs_pwritev (glfd, &iov, 1, offset, flags);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite, 3.4.0);
+
+
+extern glfs_t *pub_glfs_from_glfd (glfs_fd_t *);
int
-glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
- off_t offset, int flags, glfs_io_cbk fn, void *data)
+pub_glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec,
+ int count, off_t offset, int flags, glfs_io_cbk fn,
+ void *data)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -933,7 +988,7 @@ glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
gio->fn = fn;
gio->data = data;
- ret = synctask_new (glfs_from_glfd (glfd)->ctx->env,
+ ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,
glfs_io_async_task, glfs_io_async_cbk,
NULL, gio);
@@ -945,10 +1000,12 @@ glfs_pwritev_async (struct glfs_fd *glfd, const struct iovec *iovec, int count,
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwritev_async, 3.4.0);
+
int
-glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count, int flags,
- glfs_io_cbk fn, void *data)
+pub_glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count,
+ int flags, glfs_io_cbk fn, void *data)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -956,15 +1013,17 @@ glfs_write_async (struct glfs_fd *glfd, const void *buf, size_t count, int flags
iov.iov_base = (void *) buf;
iov.iov_len = count;
- ret = glfs_pwritev_async (glfd, &iov, 1, glfd->offset, flags, fn, data);
+ ret = pub_glfs_pwritev_async (glfd, &iov, 1, glfd->offset, flags, fn, data);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_write_async, 3.4.0);
+
int
-glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count,
- off_t offset, int flags, glfs_io_cbk fn, void *data)
+pub_glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count,
+ off_t offset, int flags, glfs_io_cbk fn, void *data)
{
struct iovec iov = {0, };
ssize_t ret = 0;
@@ -972,26 +1031,30 @@ glfs_pwrite_async (struct glfs_fd *glfd, const void *buf, int count,
iov.iov_base = (void *) buf;
iov.iov_len = count;
- ret = glfs_pwritev_async (glfd, &iov, 1, offset, flags, fn, data);
+ ret = pub_glfs_pwritev_async (glfd, &iov, 1, offset, flags, fn, data);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_pwrite_async, 3.4.0);
+
int
-glfs_writev_async (struct glfs_fd *glfd, const struct iovec *iov, int count,
- int flags, glfs_io_cbk fn, void *data)
+pub_glfs_writev_async (struct glfs_fd *glfd, const struct iovec *iov, int count,
+ int flags, glfs_io_cbk fn, void *data)
{
ssize_t ret = 0;
- ret = glfs_pwritev_async (glfd, iov, count, glfd->offset, flags,
- fn, data);
+ ret = pub_glfs_pwritev_async (glfd, iov, count, glfd->offset, flags,
+ fn, data);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_writev_async, 3.4.0);
+
int
-glfs_fsync (struct glfs_fd *glfd)
+pub_glfs_fsync (struct glfs_fd *glfd)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -999,7 +1062,7 @@ glfs_fsync (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1019,11 +1082,13 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync, 3.4.0);
+
static int
glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data,
@@ -1044,7 +1109,7 @@ glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data,
gio->fn = fn;
gio->data = data;
- ret = synctask_new (glfs_from_glfd (glfd)->ctx->env,
+ ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,
glfs_io_async_task, glfs_io_async_cbk,
NULL, gio);
@@ -1059,14 +1124,16 @@ glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data,
int
-glfs_fsync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
+pub_glfs_fsync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
{
return glfs_fsync_async_common (glfd, fn, data, 0);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsync_async, 3.4.0);
+
int
-glfs_fdatasync (struct glfs_fd *glfd)
+pub_glfs_fdatasync (struct glfs_fd *glfd)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1074,7 +1141,7 @@ glfs_fdatasync (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1094,21 +1161,25 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync, 3.4.0);
+
int
-glfs_fdatasync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
+pub_glfs_fdatasync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data)
{
return glfs_fsync_async_common (glfd, fn, data, 1);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fdatasync_async, 3.4.0);
+
int
-glfs_ftruncate (struct glfs_fd *glfd, off_t offset)
+pub_glfs_ftruncate (struct glfs_fd *glfd, off_t offset)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1116,7 +1187,7 @@ glfs_ftruncate (struct glfs_fd *glfd, off_t offset)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1136,15 +1207,17 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate, 3.4.0);
+
int
-glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset,
- glfs_io_cbk fn, void *data)
+pub_glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset, glfs_io_cbk fn,
+ void *data)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -1161,7 +1234,7 @@ glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset,
gio->fn = fn;
gio->data = data;
- ret = synctask_new (glfs_from_glfd (glfd)->ctx->env,
+ ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,
glfs_io_async_task, glfs_io_async_cbk,
NULL, gio);
@@ -1173,9 +1246,11 @@ glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset,
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_ftruncate_async, 3.4.0);
+
int
-glfs_access (struct glfs *fs, const char *path, int mode)
+pub_glfs_access (struct glfs *fs, const char *path, int mode)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1185,7 +1260,7 @@ glfs_access (struct glfs *fs, const char *path, int mode)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1206,14 +1281,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_access, 3.4.0);
+
int
-glfs_symlink (struct glfs *fs, const char *data, const char *path)
+pub_glfs_symlink (struct glfs *fs, const char *data, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1225,7 +1302,7 @@ glfs_symlink (struct glfs *fs, const char *data, const char *path)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1288,14 +1365,16 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_symlink, 3.4.0);
+
int
-glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)
+pub_glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1306,7 +1385,7 @@ glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1337,14 +1416,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readlink, 3.4.0);
+
int
-glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)
+pub_glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1356,7 +1437,7 @@ glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1419,14 +1500,16 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_mknod, 3.4.0);
+
int
-glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)
+pub_glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1438,7 +1521,7 @@ glfs_mkdir (struct glfs *fs, const char *path, mode_t mode)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1501,14 +1584,16 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_mkdir, 3.4.0);
+
int
-glfs_unlink (struct glfs *fs, const char *path)
+pub_glfs_unlink (struct glfs *fs, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1518,7 +1603,7 @@ glfs_unlink (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1548,14 +1633,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_unlink, 3.4.0);
+
int
-glfs_rmdir (struct glfs *fs, const char *path)
+pub_glfs_rmdir (struct glfs *fs, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1565,7 +1652,7 @@ glfs_rmdir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1595,14 +1682,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_rmdir, 3.4.0);
+
int
-glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)
+pub_glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1614,7 +1703,7 @@ glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1669,14 +1758,16 @@ out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_rename, 3.4.0);
+
int
-glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)
+pub_glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1688,7 +1779,7 @@ glfs_link (struct glfs *fs, const char *oldpath, const char *newpath)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1743,14 +1834,16 @@ out:
loc_wipe (&oldloc);
loc_wipe (&newloc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_link, 3.4.0);
+
struct glfs_fd *
-glfs_opendir (struct glfs *fs, const char *path)
+pub_glfs_opendir (struct glfs *fs, const char *path)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -1761,7 +1854,7 @@ glfs_opendir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1817,14 +1910,16 @@ out:
glfs_fd_bind (glfd);
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return glfd;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_opendir, 3.4.0);
+
int
-glfs_closedir (struct glfs_fd *glfd)
+pub_glfs_closedir (struct glfs_fd *glfd)
{
__glfs_entry_fd (glfd);
@@ -1835,16 +1930,20 @@ glfs_closedir (struct glfs_fd *glfd)
return 0;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_closedir, 3.4.0);
+
long
-glfs_telldir (struct glfs_fd *fd)
+pub_glfs_telldir (struct glfs_fd *fd)
{
return fd->offset;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_telldir, 3.4.0);
+
void
-glfs_seekdir (struct glfs_fd *fd, long offset)
+pub_glfs_seekdir (struct glfs_fd *fd, long offset)
{
gf_dirent_t *entry = NULL;
gf_dirent_t *tmp = NULL;
@@ -1870,9 +1969,12 @@ glfs_seekdir (struct glfs_fd *fd, long offset)
*/
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_seekdir, 3.4.0);
+
+
int
-glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,
- glfs_io_cbk fn, void *data)
+pub_glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,
+ glfs_io_cbk fn, void *data)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -1890,7 +1992,7 @@ glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,
gio->fn = fn;
gio->data = data;
- ret = synctask_new (glfs_from_glfd (glfd)->ctx->env,
+ ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,
glfs_io_async_task, glfs_io_async_cbk,
NULL, gio);
@@ -1902,9 +2004,12 @@ glfs_discard_async (struct glfs_fd *glfd, off_t offset, size_t len,
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard_async, 3.5.0);
+
+
int
-glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,
- glfs_io_cbk fn, void *data)
+pub_glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,
+ glfs_io_cbk fn, void *data)
{
struct glfs_io *gio = NULL;
int ret = 0;
@@ -1922,7 +2027,7 @@ glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,
gio->fn = fn;
gio->data = data;
- ret = synctask_new (glfs_from_glfd (glfd)->ctx->env,
+ ret = synctask_new (pub_glfs_from_glfd (glfd)->ctx->env,
glfs_io_async_task, glfs_io_async_cbk,
NULL, gio);
@@ -1934,6 +2039,8 @@ glfs_zerofill_async (struct glfs_fd *glfd, off_t offset, off_t len,
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill_async, 3.5.0);
+
void
gf_dirent_to_dirent (gf_dirent_t *gf_dirent, struct dirent *dirent)
@@ -1965,7 +2072,7 @@ glfd_entry_refresh (struct glfs_fd *glfd, int plus)
int ret = -1;
fd_t *fd = NULL;
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2014,7 +2121,7 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
@@ -2076,8 +2183,8 @@ unlock:
int
-glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat, struct dirent *ext,
- struct dirent **res)
+pub_glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat,
+ struct dirent *ext, struct dirent **res)
{
int ret = 0;
gf_dirent_t *entry = NULL;
@@ -2117,38 +2224,46 @@ glfs_readdirplus_r (struct glfs_fd *glfd, struct stat *stat, struct dirent *ext,
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdirplus_r, 3.4.0);
+
int
-glfs_readdir_r (struct glfs_fd *glfd, struct dirent *buf, struct dirent **res)
+pub_glfs_readdir_r (struct glfs_fd *glfd, struct dirent *buf,
+ struct dirent **res)
{
- return glfs_readdirplus_r (glfd, 0, buf, res);
+ return pub_glfs_readdirplus_r (glfd, 0, buf, res);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdir_r, 3.4.0);
+
struct dirent *
-glfs_readdirplus (struct glfs_fd *glfd, struct stat *stat)
+pub_glfs_readdirplus (struct glfs_fd *glfd, struct stat *stat)
{
struct dirent *res = NULL;
int ret = -1;
- ret = glfs_readdirplus_r (glfd, stat, NULL, &res);
+ ret = pub_glfs_readdirplus_r (glfd, stat, NULL, &res);
if (ret)
return NULL;
return res;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdirplus, 3.5.0);
struct dirent *
-glfs_readdir (struct glfs_fd *glfd)
+pub_glfs_readdir (struct glfs_fd *glfd)
{
- return glfs_readdirplus (glfd, NULL);
+ return pub_glfs_readdirplus (glfd, NULL);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_readdir, 3.5.0);
+
int
-glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)
+pub_glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2158,7 +2273,7 @@ glfs_statvfs (struct glfs *fs, const char *path, struct statvfs *buf)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2179,11 +2294,13 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_statvfs, 3.4.0);
+
int
glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt,
@@ -2197,7 +2314,7 @@ glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt,
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2221,7 +2338,7 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
@@ -2236,7 +2353,7 @@ glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2256,14 +2373,14 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
int
-glfs_chmod (struct glfs *fs, const char *path, mode_t mode)
+pub_glfs_chmod (struct glfs *fs, const char *path, mode_t mode)
{
int ret = -1;
struct iatt iatt = {0, };
@@ -2277,9 +2394,11 @@ glfs_chmod (struct glfs *fs, const char *path, mode_t mode)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chmod, 3.4.0);
+
int
-glfs_fchmod (struct glfs_fd *glfd, mode_t mode)
+pub_glfs_fchmod (struct glfs_fd *glfd, mode_t mode)
{
int ret = -1;
struct iatt iatt = {0, };
@@ -2293,9 +2412,11 @@ glfs_fchmod (struct glfs_fd *glfd, mode_t mode)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchmod, 3.4.0);
+
int
-glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
+pub_glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
{
int ret = 0;
int valid = 0;
@@ -2317,9 +2438,11 @@ glfs_chown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chown, 3.4.0);
+
int
-glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
+pub_glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
{
int ret = 0;
int valid = 0;
@@ -2341,9 +2464,11 @@ glfs_lchown (struct glfs *fs, const char *path, uid_t uid, gid_t gid)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lchown, 3.4.0);
+
int
-glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid)
+pub_glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid)
{
int ret = 0;
int valid = 0;
@@ -2365,9 +2490,11 @@ glfs_fchown (struct glfs_fd *glfd, uid_t uid, gid_t gid)
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchown, 3.4.0);
+
int
-glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2])
+pub_glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2])
{
int ret = -1;
int valid = 0;
@@ -2385,9 +2512,11 @@ glfs_utimens (struct glfs *fs, const char *path, struct timespec times[2])
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_utimens, 3.4.0);
+
int
-glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2])
+pub_glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2])
{
int ret = -1;
int valid = 0;
@@ -2405,9 +2534,11 @@ glfs_lutimens (struct glfs *fs, const char *path, struct timespec times[2])
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lutimens, 3.4.0);
+
int
-glfs_futimens (struct glfs_fd *glfd, struct timespec times[2])
+pub_glfs_futimens (struct glfs_fd *glfd, struct timespec times[2])
{
int ret = -1;
int valid = 0;
@@ -2425,6 +2556,8 @@ glfs_futimens (struct glfs_fd *glfd, struct timespec times[2])
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_futimens, 3.4.0);
+
int
glfs_getxattr_process (void *value, size_t size, dict_t *xattr,
@@ -2471,7 +2604,7 @@ glfs_getxattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2500,31 +2633,35 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
ssize_t
-glfs_getxattr (struct glfs *fs, const char *path, const char *name,
- void *value, size_t size)
+pub_glfs_getxattr (struct glfs *fs, const char *path, const char *name,
+ void *value, size_t size)
{
return glfs_getxattr_common (fs, path, name, value, size, 1);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_getxattr, 3.4.0);
+
ssize_t
-glfs_lgetxattr (struct glfs *fs, const char *path, const char *name,
- void *value, size_t size)
+pub_glfs_lgetxattr (struct glfs *fs, const char *path, const char *name,
+ void *value, size_t size)
{
return glfs_getxattr_common (fs, path, name, value, size, 0);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lgetxattr, 3.4.0);
+
ssize_t
-glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,
- size_t size)
+pub_glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,
+ size_t size)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2533,7 +2670,7 @@ glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value,
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2557,11 +2694,13 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fgetxattr, 3.4.0);
+
int
glfs_listxattr_process (void *value, size_t size, dict_t *xattr)
@@ -2604,7 +2743,7 @@ glfs_listxattr_common (struct glfs *fs, const char *path, void *value,
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2634,28 +2773,32 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
ssize_t
-glfs_listxattr (struct glfs *fs, const char *path, void *value, size_t size)
+pub_glfs_listxattr (struct glfs *fs, const char *path, void *value, size_t size)
{
return glfs_listxattr_common (fs, path, value, size, 1);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_listxattr, 3.4.0);
+
ssize_t
-glfs_llistxattr (struct glfs *fs, const char *path, void *value, size_t size)
+pub_glfs_llistxattr (struct glfs *fs, const char *path, void *value, size_t size)
{
return glfs_listxattr_common (fs, path, value, size, 0);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_llistxattr, 3.4.0);
+
ssize_t
-glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)
+pub_glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2664,7 +2807,7 @@ glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2688,11 +2831,13 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_flistxattr, 3.4.0);
+
dict_t *
dict_for_key_value (const char *name, const char *value, size_t size)
@@ -2727,7 +2872,7 @@ glfs_setxattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2761,31 +2906,35 @@ out:
if (xattr)
dict_unref (xattr);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
int
-glfs_setxattr (struct glfs *fs, const char *path, const char *name,
- const void *value, size_t size, int flags)
+pub_glfs_setxattr (struct glfs *fs, const char *path, const char *name,
+ const void *value, size_t size, int flags)
{
return glfs_setxattr_common (fs, path, name, value, size, flags, 1);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_setxattr, 3.4.0);
+
int
-glfs_lsetxattr (struct glfs *fs, const char *path, const char *name,
- const void *value, size_t size, int flags)
+pub_glfs_lsetxattr (struct glfs *fs, const char *path, const char *name,
+ const void *value, size_t size, int flags)
{
return glfs_setxattr_common (fs, path, name, value, size, flags, 0);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lsetxattr, 3.4.0);
+
int
-glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,
- size_t size, int flags)
+pub_glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,
+ size_t size, int flags)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2794,7 +2943,7 @@ glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value,
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2824,11 +2973,13 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fsetxattr, 3.4.0);
+
int
glfs_removexattr_common (struct glfs *fs, const char *path, const char *name,
@@ -2842,7 +2993,7 @@ glfs_removexattr_common (struct glfs *fs, const char *path, const char *name,
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2867,28 +3018,32 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
int
-glfs_removexattr (struct glfs *fs, const char *path, const char *name)
+pub_glfs_removexattr (struct glfs *fs, const char *path, const char *name)
{
return glfs_removexattr_common (fs, path, name, 1);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_removexattr, 3.4.0);
+
int
-glfs_lremovexattr (struct glfs *fs, const char *path, const char *name)
+pub_glfs_lremovexattr (struct glfs *fs, const char *path, const char *name)
{
return glfs_removexattr_common (fs, path, name, 0);
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_lremovexattr, 3.4.0);
+
int
-glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
+pub_glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2896,7 +3051,7 @@ glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2916,14 +3071,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fremovexattr, 3.4.0);
+
int
-glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len)
+pub_glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2931,7 +3088,7 @@ glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2951,14 +3108,16 @@ out:
if (fd)
fd_unref(fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fallocate, 3.5.0);
+
int
-glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)
+pub_glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -2966,7 +3125,7 @@ glfs_discard (struct glfs_fd *glfd, off_t offset, size_t len)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -2986,13 +3145,16 @@ out:
if (fd)
fd_unref(fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_discard, 3.5.0);
+
+
int
-glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)
+pub_glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -3000,7 +3162,7 @@ glfs_zerofill (struct glfs_fd *glfd, off_t offset, off_t len)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -3018,13 +3180,16 @@ out:
if (fd)
fd_unref(fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_zerofill, 3.5.0);
+
+
int
-glfs_chdir (struct glfs *fs, const char *path)
+pub_glfs_chdir (struct glfs *fs, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -3034,7 +3199,7 @@ glfs_chdir (struct glfs *fs, const char *path)
__glfs_entry_fs (fs);
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3059,14 +3224,16 @@ retry:
out:
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_chdir, 3.4.0);
+
int
-glfs_fchdir (struct glfs_fd *glfd)
+pub_glfs_fchdir (struct glfs_fd *glfd)
{
int ret = -1;
inode_t *inode = NULL;
@@ -3075,7 +3242,7 @@ glfs_fchdir (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3103,14 +3270,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_fchdir, 3.4.0);
+
char *
-glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)
+pub_glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)
{
int ret = -1;
char *retpath = NULL;
@@ -3133,7 +3302,7 @@ glfs_realpath (struct glfs *fs, const char *path, char *resolved_path)
goto out;
}
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3161,14 +3330,16 @@ out:
retpath = NULL;
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return retpath;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_realpath, 3.4.0);
+
char *
-glfs_getcwd (struct glfs *fs, char *buf, size_t n)
+pub_glfs_getcwd (struct glfs *fs, char *buf, size_t n)
{
int ret = -1;
inode_t *inode = NULL;
@@ -3211,6 +3382,8 @@ out:
return buf;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_getcwd, 3.4.0);
+
static void
gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock)
@@ -3235,7 +3408,7 @@ gf_flock_from_flock (struct gf_flock *gf_flock, struct flock *flock)
int
-glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)
+pub_glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -3245,7 +3418,7 @@ glfs_posix_lock (struct glfs_fd *glfd, int cmd, struct flock *flock)
__glfs_entry_fd (glfd);
- subvol = glfs_active_subvol (glfd->fs);
+ subvol = priv_glfs_active_subvol (glfd->fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -3271,14 +3444,16 @@ out:
if (fd)
fd_unref (fd);
- glfs_subvol_done (glfd->fs, subvol);
+ priv_glfs_subvol_done (glfd->fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_posix_lock, 3.4.0);
+
struct glfs_fd *
-glfs_dup (struct glfs_fd *glfd)
+pub_glfs_dup (struct glfs_fd *glfd)
{
xlator_t *subvol = NULL;
fd_t *fd = NULL;
@@ -3288,7 +3463,7 @@ glfs_dup (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
fs = glfd->fs;
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -3313,7 +3488,10 @@ out:
if (dupfd)
glfs_fd_bind (dupfd);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return dupfd;
}
+
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_dup, 3.4.0);
+
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index cefe6e3157b..dadbda3675f 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -61,8 +61,8 @@ glfs_iatt_from_stat (struct stat *stat, int valid, struct iatt *iatt,
}
struct glfs_object *
-glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
- const char *path, struct stat *stat)
+pub_glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
+ const char *path, struct stat *stat)
{
int ret = 0;
xlator_t *subvol = NULL;
@@ -80,7 +80,7 @@ glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -96,8 +96,8 @@ glfs_h_lookupat (struct glfs *fs, struct glfs_object *parent,
}
/* fop/op */
- ret = glfs_resolve_at (fs, subvol, inode, path, &loc, &iatt,
- 0 /*TODO: links? */, 0);
+ ret = priv_glfs_resolve_at (fs, subvol, inode, path, &loc, &iatt,
+ 0 /*TODO: links? */, 0);
/* populate out args */
if (!ret) {
@@ -113,13 +113,16 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_lookupat, 3.4.2);
+
+
int
-glfs_h_stat (struct glfs *fs, struct glfs_object *object, struct stat *stat)
+pub_glfs_h_stat (struct glfs *fs, struct glfs_object *object, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -136,7 +139,7 @@ glfs_h_stat (struct glfs *fs, struct glfs_object *object, struct stat *stat)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -167,13 +170,17 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_stat, 3.4.2);
+
+
int
-glfs_h_getattrs (struct glfs *fs, struct glfs_object *object, struct stat *stat)
+pub_glfs_h_getattrs (struct glfs *fs, struct glfs_object *object,
+ struct stat *stat)
{
int ret = 0;
xlator_t *subvol = NULL;
@@ -189,7 +196,7 @@ glfs_h_getattrs (struct glfs *fs, struct glfs_object *object, struct stat *stat)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -215,14 +222,17 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getattrs, 3.4.2);
+
+
int
-glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object, const char *name,
- void *value, size_t size)
+pub_glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object,
+ const char *name, void *value, size_t size)
{
int ret = 0;
xlator_t *subvol = NULL;
@@ -239,7 +249,7 @@ glfs_h_getxattrs (struct glfs *fs, struct glfs_object *object, const char *name,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -274,14 +284,16 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getxattrs, 3.5.1);
+
int
-glfs_h_setattrs (struct glfs *fs, struct glfs_object *object, struct stat *stat,
- int valid)
+pub_glfs_h_setattrs (struct glfs *fs, struct glfs_object *object,
+ struct stat *stat, int valid)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -299,7 +311,7 @@ glfs_h_setattrs (struct glfs *fs, struct glfs_object *object, struct stat *stat,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -328,14 +340,18 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setattrs, 3.4.2);
+
+
int
-glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object, const char *name,
- const void *value, size_t size, int flags)
+pub_glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object,
+ const char *name, const void *value, size_t size,
+ int flags)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -353,7 +369,7 @@ glfs_h_setxattrs (struct glfs *fs, struct glfs_object *object, const char *name,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -390,13 +406,17 @@ out:
if (xattr)
dict_unref (xattr);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setxattrs, 3.5.0);
+
+
int
-glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object, const char *name)
+pub_glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object,
+ const char *name)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -412,7 +432,7 @@ glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object, const char *na
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -439,13 +459,16 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_removexattrs, 3.5.1);
+
+
struct glfs_fd *
-glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
+pub_glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -462,7 +485,7 @@ glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -525,14 +548,17 @@ out:
glfd = NULL;
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return glfd;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_open, 3.4.2);
+
+
struct glfs_object *
-glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path,
- int flags, mode_t mode, struct stat *stat)
+pub_glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path,
+ int flags, mode_t mode, struct stat *stat)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -553,7 +579,7 @@ glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -645,14 +671,17 @@ out:
glfd = NULL;
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_creat, 3.4.2);
+
+
struct glfs_object *
-glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path,
- mode_t mode, struct stat *stat)
+pub_glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path,
+ mode_t mode, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -672,7 +701,7 @@ glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -734,14 +763,17 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mkdir, 3.4.2);
+
+
struct glfs_object *
-glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path,
- mode_t mode, dev_t dev, struct stat *stat)
+pub_glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path,
+ mode_t mode, dev_t dev, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -761,7 +793,7 @@ glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -822,13 +854,16 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mknod, 3.4.2);
+
+
int
-glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path)
+pub_glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -844,7 +879,7 @@ glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if ( !subvol ) {
ret = -1;
errno = EIO;
@@ -858,7 +893,7 @@ glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path)
goto out;
}
- ret = glfs_resolve_at (fs, subvol, inode, path, &loc, NULL, 0 , 0);
+ ret = priv_glfs_resolve_at (fs, subvol, inode, path, &loc, NULL, 0 , 0);
if (ret != 0) {
goto out;
}
@@ -886,13 +921,16 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_unlink, 3.4.2);
+
+
struct glfs_fd *
-glfs_h_opendir (struct glfs *fs, struct glfs_object *object)
+pub_glfs_h_opendir (struct glfs *fs, struct glfs_object *object)
{
int ret = -1;
struct glfs_fd *glfd = NULL;
@@ -909,7 +947,7 @@ glfs_h_opendir (struct glfs *fs, struct glfs_object *object)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -962,13 +1000,16 @@ out:
glfs_fd_bind (glfd);
}
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return glfd;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_opendir, 3.4.2);
+
+
int
-glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask)
+pub_glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -984,7 +1025,7 @@ glfs_h_access (struct glfs *fs, struct glfs_object *object, int mask)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1013,14 +1054,17 @@ out:
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_access, 3.6.0);
+
+
ssize_t
-glfs_h_extract_handle (struct glfs_object *object, unsigned char *handle,
- int len)
+pub_glfs_h_extract_handle (struct glfs_object *object, unsigned char *handle,
+ int len)
{
ssize_t ret = -1;
@@ -1049,9 +1093,12 @@ out:
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_extract_handle, 3.4.2);
+
+
struct glfs_object *
-glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
- struct stat *stat)
+pub_glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
+ struct stat *stat)
{
loc_t loc = {0, };
int ret = -1;
@@ -1069,7 +1116,7 @@ glfs_h_create_from_handle (struct glfs *fs, unsigned char *handle, int len,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
errno = EIO;
goto out;
@@ -1128,13 +1175,16 @@ out:
/* TODO: Check where the inode ref is being held? */
loc_wipe (&loc);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_create_from_handle, 3.4.2);
+
+
int
-glfs_h_close (struct glfs_object *object)
+pub_glfs_h_close (struct glfs_object *object)
{
/* Release the held reference */
inode_unref (object->inode);
@@ -1143,8 +1193,11 @@ glfs_h_close (struct glfs_object *object)
return 0;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_close, 3.4.2);
+
+
int
-glfs_h_truncate (struct glfs *fs, struct glfs_object *object, off_t offset)
+pub_glfs_h_truncate (struct glfs *fs, struct glfs_object *object, off_t offset)
{
loc_t loc = {0, };
int ret = -1;
@@ -1160,7 +1213,7 @@ glfs_h_truncate (struct glfs *fs, struct glfs_object *object, off_t offset)
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1190,14 +1243,17 @@ out:
if (inode)
inode_unref (inode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_truncate, 3.4.2);
+
+
struct glfs_object *
-glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name,
- const char *data, struct stat *stat)
+pub_glfs_h_symlink (struct glfs *fs, struct glfs_object *parent,
+ const char *name, const char *data, struct stat *stat)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1218,7 +1274,7 @@ glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1273,7 +1329,7 @@ glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name,
out:
if (ret && object != NULL) {
- glfs_h_close (object);
+ pub_glfs_h_close (object);
object = NULL;
}
@@ -1285,14 +1341,17 @@ out:
if (xattr_req)
dict_unref (xattr_req);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return object;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_symlink, 3.4.2);
+
+
int
-glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,
- size_t bufsiz)
+pub_glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,
+ size_t bufsiz)
{
loc_t loc = {0, };
int ret = -1;
@@ -1309,7 +1368,7 @@ glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1342,13 +1401,19 @@ out:
if (linkval)
GF_FREE (linkval);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_readlink, 3.4.2);
+
+
+extern int
+priv_glfs_loc_touchup (loc_t *);
+
int
-glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
+pub_glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
struct glfs_object *parent, const char *name)
{
int ret = -1;
@@ -1368,7 +1433,7 @@ glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if (!subvol) {
ret = -1;
errno = EIO;
@@ -1400,7 +1465,7 @@ glfs_h_link (struct glfs *fs, struct glfs_object *linksrc,
/* setup newloc based on parent */
newloc.parent = inode_ref (pinode);
newloc.name = name;
- ret = glfs_loc_touchup (&newloc);
+ ret = priv_glfs_loc_touchup (&newloc);
if (ret != 0) {
errno = EINVAL;
goto out;
@@ -1428,14 +1493,18 @@ out:
if (pinode)
inode_unref (pinode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_link, 3.4.2);
+
+
int
-glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname,
- struct glfs_object *newdir, const char *newname)
+pub_glfs_h_rename (struct glfs *fs, struct glfs_object *olddir,
+ const char *oldname, struct glfs_object *newdir,
+ const char *newname)
{
int ret = -1;
xlator_t *subvol = NULL;
@@ -1456,7 +1525,7 @@ glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname,
__glfs_entry_fs (fs);
/* get the active volume */
- subvol = glfs_active_subvol (fs);
+ subvol = priv_glfs_active_subvol (fs);
if ( !subvol ) {
ret = -1;
errno = EIO;
@@ -1470,8 +1539,8 @@ glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname,
goto out;
}
- ret = glfs_resolve_at (fs, subvol, oldpinode, oldname, &oldloc,
- &oldiatt, 0 , 0);
+ ret = priv_glfs_resolve_at (fs, subvol, oldpinode, oldname, &oldloc,
+ &oldiatt, 0 , 0);
if (ret != 0) {
goto out;
}
@@ -1483,8 +1552,8 @@ glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname,
goto out;
}
- ret = glfs_resolve_at (fs, subvol, newpinode, newname, &newloc,
- &newiatt, 0, 0);
+ ret = priv_glfs_resolve_at (fs, subvol, newpinode, newname, &newloc,
+ &newiatt, 0, 0);
if (ret && errno != ENOENT && newloc.parent)
goto out;
@@ -1521,7 +1590,10 @@ out:
if (newpinode)
inode_unref (newpinode);
- glfs_subvol_done (fs, subvol);
+ priv_glfs_subvol_done (fs, subvol);
return ret;
}
+
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_rename, 3.4.2);
+
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
index ff875280ce6..afcbb4553ba 100644
--- a/api/src/glfs-internal.h
+++ b/api/src/glfs-internal.h
@@ -51,7 +51,7 @@
#define GLFS_LOC_FILL_INODE(oinode, loc, label) do { \
loc.inode = inode_ref (oinode); \
uuid_copy (loc.gfid, oinode->gfid); \
- ret = glfs_loc_touchup (&loc); \
+ ret = priv_glfs_loc_touchup (&loc); \
if (ret != 0) { \
errno = EINVAL; \
goto label; \
@@ -67,7 +67,7 @@
} \
loc.parent = inode_ref (pinode); \
loc.name = path; \
- ret = glfs_loc_touchup (&loc); \
+ ret = priv_glfs_loc_touchup (&loc); \
if (ret != 0) { \
errno = EINVAL; \
goto label; \
@@ -135,7 +135,7 @@ struct glfs_object {
#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256
int glfs_mgmt_init (struct glfs *fs);
-void glfs_init_done (struct glfs *fs, int ret);
+void priv_glfs_init_done (struct glfs *fs, int ret);
int glfs_process_volfp (struct glfs *fs, FILE *fp);
int glfs_resolve (struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc,
struct iatt *iatt, int reval);
@@ -197,11 +197,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 * glfs_active_subvol (struct glfs *fs);
-xlator_t * __glfs_active_subvol (struct glfs *fs);
-void glfs_subvol_done (struct glfs *fs, xlator_t *subvol);
+xlator_t *priv_glfs_active_subvol (struct glfs *fs);
+xlator_t *__glfs_active_subvol (struct glfs *fs);
+void priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol);
-inode_t * glfs_refresh_inode (xlator_t *subvol, inode_t *inode);
+inode_t *glfs_refresh_inode (xlator_t *subvol, inode_t *inode);
inode_t *glfs_cwd_get (struct glfs *fs);
int glfs_cwd_set (struct glfs *fs, inode_t *inode);
@@ -212,14 +212,14 @@ 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 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 glfs_loc_touchup (loc_t *loc);
+int priv_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);
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);
-dict_t * dict_for_key_value (const char *name, const char *value, size_t size);
+dict_t *dict_for_key_value (const char *name, const char *value, size_t size);
int glfs_getxattr_process (void *value, size_t size, dict_t *xattr,
const char *name);
@@ -250,7 +250,7 @@ int glfs_get_volume_info (struct glfs *fs);
NULL : Otherwise.
*/
-struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx);
+struct glfs *priv_glfs_new_from_ctx (glusterfs_ctx_t *ctx);
/*
SYNOPSIS
@@ -275,6 +275,13 @@ struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx);
void
*/
-void glfs_free_from_ctx (struct glfs *fs);
+void priv_glfs_free_from_ctx (struct glfs *fs);
+
+#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 c02534c188f..89017bab84d 100644
--- a/api/src/glfs-master.c
+++ b/api/src/glfs-master.c
@@ -27,8 +27,11 @@
#include "glfs-mem-types.h"
+extern void
+glfs_subvol_done (struct glfs *, xlator_t *);
+
int
-glfs_graph_setup (struct glfs *fs, glusterfs_graph_t *graph)
+graph_setup (struct glfs *fs, glusterfs_graph_t *graph)
{
xlator_t *new_subvol = NULL;
xlator_t *old_subvol = NULL;
@@ -77,6 +80,9 @@ unlock:
}
+extern void
+glfs_init_done (struct glfs *fs, int ret);
+
int
notify (xlator_t *this, int event, void *data, ...)
{
@@ -93,11 +99,11 @@ notify (xlator_t *this, int event, void *data, ...)
graph->id);
break;
case GF_EVENT_CHILD_UP:
- glfs_graph_setup (fs, graph);
+ graph_setup (fs, graph);
glfs_init_done (fs, 0);
break;
case GF_EVENT_CHILD_DOWN:
- glfs_graph_setup (fs, graph);
+ graph_setup (fs, graph);
glfs_init_done (fs, 1);
break;
case GF_EVENT_CHILD_CONNECTING:
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
index 3a428c9d95a..ea017f31af6 100644
--- a/api/src/glfs-mgmt.c
+++ b/api/src/glfs-mgmt.c
@@ -325,7 +325,7 @@ out:
}
int
-glfs_get_volumeid (struct glfs *fs, char *volid, size_t size)
+pub_glfs_get_volumeid (struct glfs *fs, char *volid, size_t size)
{
/* TODO: Define a global macro to store UUID size */
size_t uuid_size = 16;
@@ -365,6 +365,8 @@ done:
return uuid_size;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_get_volumeid, 3.5.0);
+
int
glfs_get_volume_info (struct glfs *fs)
{
@@ -585,7 +587,7 @@ out:
gf_log ("mgmt", GF_LOG_ERROR, "Server is operating at an "
"op-version which is not supported");
errno = ENOTSUP;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
}
if (ret && ctx && !ctx->active) {
@@ -598,7 +600,7 @@ out:
if (!need_retry) {
if (!errno)
errno = EINVAL;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
}
}
@@ -697,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");
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
break;
}
server = list_entry (server->list.next, typeof(*server),
@@ -715,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;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
break;
}
@@ -727,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;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
break;
}
@@ -739,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;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
break;
}
gf_log ("glfs-mgmt", GF_LOG_INFO,
@@ -760,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;
- glfs_init_done (fs, -1);
+ priv_glfs_init_done (fs, -1);
}
break;
diff --git a/api/src/glfs-resolve.c b/api/src/glfs-resolve.c
index 7ed45169a25..7a3a0bc13c7 100644
--- a/api/src/glfs-resolve.c
+++ b/api/src/glfs-resolve.c
@@ -137,7 +137,7 @@ __glfs_refresh_inode (struct glfs *fs, xlator_t *subvol, inode_t *inode)
}
int
-glfs_loc_touchup (loc_t *loc)
+priv_glfs_loc_touchup (loc_t *loc)
{
char *path = NULL;
int ret = -1;
@@ -165,6 +165,7 @@ out:
return ret;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_loc_touchup, 3.4.0);
int
glfs_resolve_symlink (struct glfs *fs, xlator_t *subvol, inode_t *inode,
@@ -283,7 +284,7 @@ glfs_resolve_component (struct glfs *fs, xlator_t *subvol, inode_t *parent,
}
- glret = glfs_loc_touchup (&loc);
+ glret = priv_glfs_loc_touchup (&loc);
if (glret < 0) {
ret = -1;
goto out;
@@ -343,7 +344,7 @@ out:
int
-glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
+priv_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)
{
@@ -420,7 +421,7 @@ glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
if (ret < 0)
break;
- ret = glfs_resolve_at (fs, subvol, parent, lpath,
+ ret = priv_glfs_resolve_at (fs, subvol, parent, lpath,
&sym_loc,
/* followed iatt becomes the
component iatt
@@ -474,7 +475,7 @@ glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at,
ret = 0;
}
- if (glfs_loc_touchup (loc) < 0) {
+ if (priv_glfs_loc_touchup (loc) < 0) {
ret = -1;
}
out:
@@ -485,6 +486,8 @@ out:
return ret;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_resolve_at, 3.4.0);
+
int
glfs_resolve_path (struct glfs *fs, xlator_t *subvol, const char *origpath,
@@ -494,13 +497,13 @@ glfs_resolve_path (struct glfs *fs, xlator_t *subvol, const char *origpath,
inode_t *cwd = NULL;
if (origpath[0] == '/')
- return glfs_resolve_at (fs, subvol, NULL, origpath, loc, iatt,
- follow, reval);
+ return priv_glfs_resolve_at (fs, subvol, NULL, origpath, loc,
+ iatt, follow, reval);
cwd = glfs_cwd_get (fs);
- ret = glfs_resolve_at (fs, subvol, cwd, origpath, loc, iatt,
- follow, reval);
+ ret = priv_glfs_resolve_at (fs, subvol, cwd, origpath, loc, iatt,
+ follow, reval);
if (cwd)
inode_unref (cwd);
@@ -827,7 +830,7 @@ __glfs_active_subvol (struct glfs *fs)
}
xlator_t *
-glfs_active_subvol (struct glfs *fs)
+priv_glfs_active_subvol (struct glfs *fs)
{
xlator_t *subvol = NULL;
xlator_t *old_subvol = NULL;
@@ -848,14 +851,15 @@ glfs_active_subvol (struct glfs *fs)
glfs_unlock (fs);
if (old_subvol)
- glfs_subvol_done (fs, old_subvol);
+ priv_glfs_subvol_done (fs, old_subvol);
return subvol;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_active_subvol, 3.4.0);
void
-glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
+priv_glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
{
int ref = 0;
xlator_t *active_subvol = NULL;
@@ -876,6 +880,7 @@ glfs_subvol_done (struct glfs *fs, xlator_t *subvol)
}
}
+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 c7c4c00450a..fc0e7c7ba91 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);
+
struct glfs *
-glfs_new_from_ctx (glusterfs_ctx_t *ctx)
+priv_glfs_new_from_ctx (glusterfs_ctx_t *ctx)
{
struct glfs *fs = NULL;
@@ -576,9 +601,11 @@ glfs_new_from_ctx (glusterfs_ctx_t *ctx)
return fs;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_new_from_ctx, 3.7.0);
+
void
-glfs_free_from_ctx (struct glfs *fs)
+priv_glfs_free_from_ctx (struct glfs *fs)
{
if (!fs)
return;
@@ -590,9 +617,11 @@ glfs_free_from_ctx (struct glfs *fs)
GF_FREE (fs);
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_free_from_ctx, 3.7.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;
@@ -606,9 +635,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;
@@ -638,6 +669,8 @@ out:
return ret;
}
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_set_logging, 3.4.0);
+
int
glfs_init_wait (struct glfs *fs)
@@ -660,7 +693,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;
@@ -690,6 +723,8 @@ out:
return;
}
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_init_done, 3.4.0);
+
int
glfs_init_common (struct glfs *fs)
@@ -734,7 +769,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;
@@ -754,9 +789,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;
@@ -795,9 +835,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()
@@ -809,7 +849,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)
@@ -818,8 +858,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;
@@ -837,3 +880,6 @@ glfs_get_volfile (struct glfs *fs, void *buf, size_t len)
return res;
}
+
+GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_get_volfile, 3.6.0);
+