api: versioned symbols in libgfapi.so for compatibility
Use versioned symbols to keep libgfapi at libgfapi.so.0.0.0 Some nits uncovered: + there are a couple functions declared that do not have an associated definition, e.g. glfs_truncate(), glfs_caller_specific_init() + there are seven private/internal functions used by heal/src/glfsheal and the gfapi master xlator (glfs-master.c): glfs_loc_touchup(), glfs_active_subvol(), and glfs_subvol_done(), glfs_init_done(), glfs_resolve_at(), glfs_free_from_ctx(), and glfs_new_from_ctx(); which are not declared in glfs.h; + for this initial pass at versioned symbols, we use the earliest version of all public symbols, i.e. those for which there are declarations in glfs.h or glfs-handles.h. Further investigation as we do backports to 3.6, 3.4, and 3.4 will be required to determine if older implementations need to be preserved (forward ported) and their associated alias(es) and symbol version(s) defined. FWIW, we should consider linking all of our libraries with a map, it'll result in a cleaner ABI. Perhaps something for an intern to do or a Google Summer of Code project. Change-Id: I499456807a5cd26acb39843216ece4276f8e9b84 BUG: 1160709 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/9036 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
This commit is contained in:
parent
1fe785152c
commit
7e497871d1
1
.gitignore
vendored
1
.gitignore
vendored
@ -72,3 +72,4 @@ geo-replication/src/gsyncd
|
||||
cli/src/gluster
|
||||
contrib/fuse-util/fusermount-glusterfs
|
||||
geo-replication/src/gsyncd
|
||||
api/src/gfapi.map
|
||||
|
@ -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
|
||||
|
153
api/src/gfapi.map.in
Normal file
153
api/src/gfapi.map.in
Normal file
@ -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;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
||||
|
@ -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 */
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -206,6 +206,7 @@ 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
|
||||
@ -1106,7 +1107,7 @@ AC_SUBST(GLUSTERD_WORKDIR)
|
||||
AM_CONDITIONAL([GF_INSTALL_GLUSTERD_WORKDIR], test ! -d ${GLUSTERD_WORKDIR} && test -d ${sysconfdir}/glusterd )
|
||||
|
||||
dnl pkg-config versioning
|
||||
GFAPI_VERSION="7.0.0"
|
||||
GFAPI_VERSION="0.0.0"
|
||||
LIBGFCHANGELOG_VERSION="0.0.1"
|
||||
AC_SUBST(GFAPI_VERSION)
|
||||
AC_SUBST(LIBGFCHANGELOG_VERSION)
|
||||
@ -1116,7 +1117,7 @@ LIBGFXDR_LT_VERSION="0:1:0"
|
||||
LIBGFRPC_LT_VERSION="0:1:0"
|
||||
LIBGLUSTERFS_LT_VERSION="0:1:0"
|
||||
LIBGFCHANGELOG_LT_VERSION="0:1:0"
|
||||
GFAPI_LT_VERSION="7:0:0"
|
||||
GFAPI_LT_VERSION="0:0:0"
|
||||
AC_SUBST(LIBGFXDR_LT_VERSION)
|
||||
AC_SUBST(LIBGFRPC_LT_VERSION)
|
||||
AC_SUBST(LIBGLUSTERFS_LT_VERSION)
|
||||
|
@ -40,6 +40,10 @@ 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,
|
||||
int32_t *op_errno)
|
||||
|
@ -2010,6 +2010,16 @@ __mnt3udp_get_mstate (xlator_t *nfsx)
|
||||
return ms;
|
||||
}
|
||||
|
||||
extern int
|
||||
glfs_resolve_at (struct glfs *, xlator_t *, inode_t *,
|
||||
const char *, loc_t *, struct iatt *, int, int);
|
||||
|
||||
extern struct glfs *
|
||||
glfs_new_from_ctx (glusterfs_ctx_t *);
|
||||
|
||||
extern void
|
||||
glfs_free_from_ctx (struct glfs *);
|
||||
|
||||
static inode_t *
|
||||
__mnt3udp_get_export_subdir_inode (struct svc_req *req, char *subdir,
|
||||
char *expname, /* OUT */
|
||||
|
Loading…
Reference in New Issue
Block a user