"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "api/src/glfs-handleops.c" between
glusterfs-8.0.tar.gz and glusterfs-8.1.tar.gz

About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x (latest version).

glfs-handleops.c  (glusterfs-8.0):glfs-handleops.c  (glusterfs-8.1)
skipping to change at line 63 skipping to change at line 63
if (valid & GFAPI_SET_ATTR_MTIME) { if (valid & GFAPI_SET_ATTR_MTIME) {
iatt->ia_mtime = stat->st_mtime; iatt->ia_mtime = stat->st_mtime;
iatt->ia_mtime_nsec = ST_MTIM_NSEC(stat); iatt->ia_mtime_nsec = ST_MTIM_NSEC(stat);
*glvalid |= GF_SET_ATTR_MTIME; *glvalid |= GF_SET_ATTR_MTIME;
} }
return; return;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_lookupat, 3.7.4)
struct glfs_object * struct glfs_object *
pub_glfs_h_lookupat(struct glfs *fs, struct glfs_object *parent, pub_glfs_h_lookupat(struct glfs *fs, struct glfs_object *parent,
const char *path, struct stat *stat, int follow) const char *path, struct stat *stat, int follow)
{ {
int ret = 0; int ret = 0;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
struct iatt iatt = { struct iatt iatt = {
0, 0,
}; };
skipping to change at line 129 skipping to change at line 130
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_lookupat, 3.7.4); GFAPI_SYMVER_PUBLIC(glfs_h_lookupat34, glfs_h_lookupat, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_lookupat34(struct glfs *fs, struct glfs_object *parent, pub_glfs_h_lookupat34(struct glfs *fs, struct glfs_object *parent,
const char *path, struct stat *stat) const char *path, struct stat *stat)
{ {
return pub_glfs_h_lookupat(fs, parent, path, stat, 0); return pub_glfs_h_lookupat(fs, parent, path, stat, 0);
} }
GFAPI_SYMVER_PUBLIC(glfs_h_lookupat34, glfs_h_lookupat, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_statfs, 3.7.0)
int int
pub_glfs_h_statfs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_statfs(struct glfs *fs, struct glfs_object *object,
struct statvfs *statvfs) struct statvfs *statvfs)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 197 skipping to change at line 196
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_statfs, 3.7.0); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_stat, 3.4.2)
int int
pub_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; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
struct iatt iatt = { struct iatt iatt = {
skipping to change at line 262 skipping to change at line 260
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_stat, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getattrs, 3.4.2)
int int
pub_glfs_h_getattrs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_getattrs(struct glfs *fs, struct glfs_object *object,
struct stat *stat) struct stat *stat)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
struct iatt iatt = { struct iatt iatt = {
0, 0,
}; };
skipping to change at line 320 skipping to change at line 317
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getattrs, 3.4.2);
int int
glfs_h_getxattrs_common(struct glfs *fs, struct glfs_object *object, glfs_h_getxattrs_common(struct glfs *fs, struct glfs_object *object,
dict_t **xattr, const char *name, dict_t **xattr, const char *name,
gf_boolean_t is_listxattr) gf_boolean_t is_listxattr)
{ {
int ret = 0; int ret = 0;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
skipping to change at line 383 skipping to change at line 378
loc_wipe(&loc); loc_wipe(&loc);
if (inode) if (inode)
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getxattrs, 3.5.1)
int int
pub_glfs_h_getxattrs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_getxattrs(struct glfs *fs, struct glfs_object *object,
const char *name, void *value, size_t size) const char *name, void *value, size_t size)
{ {
int ret = -1; int ret = -1;
dict_t *xattr = NULL; dict_t *xattr = NULL;
/* validate in args */ /* validate in args */
if ((fs == NULL) || (object == NULL)) { if ((fs == NULL) || (object == NULL)) {
errno = EINVAL; errno = EINVAL;
skipping to change at line 419 skipping to change at line 415
out: out:
if (xattr) if (xattr)
dict_unref(xattr); dict_unref(xattr);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_getxattrs, 3.5.1); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setattrs, 3.4.2)
int int
pub_glfs_h_setattrs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_setattrs(struct glfs *fs, struct glfs_object *object,
struct stat *stat, int valid) struct stat *stat, int valid)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 483 skipping to change at line 478
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setattrs, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setxattrs, 3.5.0)
int int
pub_glfs_h_setxattrs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_setxattrs(struct glfs *fs, struct glfs_object *object,
const char *name, const void *value, size_t size, const char *name, const void *value, size_t size,
int flags) int flags)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
skipping to change at line 571 skipping to change at line 565
dict_unref(xattr); dict_unref(xattr);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_setxattrs, 3.5.0); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_removexattrs, 3.5.1)
int int
pub_glfs_h_removexattrs(struct glfs *fs, struct glfs_object *object, pub_glfs_h_removexattrs(struct glfs *fs, struct glfs_object *object,
const char *name) const char *name)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 629 skipping to change at line 622
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_removexattrs, 3.5.1); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_open, 3.4.2)
struct glfs_fd * struct glfs_fd *
pub_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; int ret = -1;
struct glfs_fd *glfd = NULL; struct glfs_fd *glfd = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 730 skipping to change at line 722
} }
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return glfd; return glfd;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_open, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_creat, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_creat(struct glfs *fs, struct glfs_object *parent, const char *path, pub_glfs_h_creat(struct glfs *fs, struct glfs_object *parent, const char *path,
int flags, mode_t mode, struct stat *stat) int flags, mode_t mode, struct stat *stat)
{ {
int ret = -1; int ret = -1;
fd_t *fd = NULL; fd_t *fd = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
skipping to change at line 843 skipping to change at line 834
fd_unref(fd); fd_unref(fd);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_creat, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_creat_open, 6.6)
struct glfs_object * struct glfs_object *
pub_glfs_h_creat_open(struct glfs *fs, struct glfs_object *parent, pub_glfs_h_creat_open(struct glfs *fs, struct glfs_object *parent,
const char *path, int flags, mode_t mode, const char *path, int flags, mode_t mode,
struct stat *stat, struct glfs_fd **out_fd) struct stat *stat, struct glfs_fd **out_fd)
{ {
int ret = -1; int ret = -1;
struct glfs_fd *glfd = NULL; struct glfs_fd *glfd = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
skipping to change at line 978 skipping to change at line 968
} }
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_creat_open, 6.6); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mkdir, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_mkdir(struct glfs *fs, struct glfs_object *parent, const char *path, pub_glfs_h_mkdir(struct glfs *fs, struct glfs_object *parent, const char *path,
mode_t mode, struct stat *stat) mode_t mode, struct stat *stat)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1077 skipping to change at line 1066
dict_unref(xattr_req); dict_unref(xattr_req);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mkdir, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mknod, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_mknod(struct glfs *fs, struct glfs_object *parent, const char *path, pub_glfs_h_mknod(struct glfs *fs, struct glfs_object *parent, const char *path,
mode_t mode, dev_t dev, struct stat *stat) mode_t mode, dev_t dev, struct stat *stat)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1175 skipping to change at line 1163
dict_unref(xattr_req); dict_unref(xattr_req);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_mknod, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_unlink, 3.4.2)
int int
pub_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; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1247 skipping to change at line 1234
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_unlink, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_opendir, 3.4.2)
struct glfs_fd * struct glfs_fd *
pub_glfs_h_opendir(struct glfs *fs, struct glfs_object *object) pub_glfs_h_opendir(struct glfs *fs, struct glfs_object *object)
{ {
int ret = -1; int ret = -1;
struct glfs_fd *glfd = NULL; struct glfs_fd *glfd = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1330 skipping to change at line 1316
} }
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return glfd; return glfd;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_opendir, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_access, 3.6.0)
int int
pub_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; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1388 skipping to change at line 1373
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_access, 3.6.0); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_extract_handle, 3.4.2)
ssize_t ssize_t
pub_glfs_h_extract_handle(struct glfs_object *object, unsigned char *handle, pub_glfs_h_extract_handle(struct glfs_object *object, unsigned char *handle,
int len) int len)
{ {
ssize_t ret = -1; ssize_t ret = -1;
/* validate in args */ /* validate in args */
if (object == NULL) { if (object == NULL) {
errno = EINVAL; errno = EINVAL;
goto out; goto out;
skipping to change at line 1420 skipping to change at line 1404
} }
memcpy(handle, object->gfid, GFAPI_HANDLE_LENGTH); memcpy(handle, object->gfid, GFAPI_HANDLE_LENGTH);
ret = GFAPI_HANDLE_LENGTH; ret = GFAPI_HANDLE_LENGTH;
out: out:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_extract_handle, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_create_from_handle, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_create_from_handle(struct glfs *fs, unsigned char *handle, int len, pub_glfs_h_create_from_handle(struct glfs *fs, unsigned char *handle, int len,
struct stat *stat) struct stat *stat)
{ {
loc_t loc = { loc_t loc = {
0, 0,
}; };
int ret = -1; int ret = -1;
struct iatt iatt = { struct iatt iatt = {
0, 0,
skipping to change at line 1544 skipping to change at line 1527
loc_wipe(&loc); loc_wipe(&loc);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_create_from_handle, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_close, 3.4.2)
int int
pub_glfs_h_close(struct glfs_object *object) pub_glfs_h_close(struct glfs_object *object)
{ {
/* since glfs_h_* objects hold a reference to inode /* since glfs_h_* objects hold a reference to inode
* it is safe to keep lookup count to '0' */ * it is safe to keep lookup count to '0' */
inode_forget(object->inode, 0); inode_forget(object->inode, 0);
inode_unref(object->inode); inode_unref(object->inode);
GF_FREE(object); GF_FREE(object);
return 0; return 0;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_close, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_truncate, 3.4.2)
int int
pub_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 = { loc_t loc = {
0, 0,
}; };
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
skipping to change at line 1619 skipping to change at line 1600
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_truncate, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_symlink, 3.4.2)
struct glfs_object * struct glfs_object *
pub_glfs_h_symlink(struct glfs *fs, struct glfs_object *parent, pub_glfs_h_symlink(struct glfs *fs, struct glfs_object *parent,
const char *name, const char *data, struct stat *stat) const char *name, const char *data, struct stat *stat)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 1719 skipping to change at line 1699
dict_unref(xattr_req); dict_unref(xattr_req);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_symlink, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_readlink, 3.4.2)
int int
pub_glfs_h_readlink(struct glfs *fs, struct glfs_object *object, char *buf, pub_glfs_h_readlink(struct glfs *fs, struct glfs_object *object, char *buf,
size_t bufsiz) size_t bufsiz)
{ {
loc_t loc = { loc_t loc = {
0, 0,
}; };
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
skipping to change at line 1785 skipping to change at line 1764
GF_FREE(linkval); GF_FREE(linkval);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_readlink, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_link, 3.4.2)
int int
pub_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) struct glfs_object *parent, const char *name)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
inode_t *pinode = NULL; inode_t *pinode = NULL;
loc_t oldloc = { loc_t oldloc = {
0, 0,
skipping to change at line 1883 skipping to change at line 1861
inode_unref(pinode); inode_unref(pinode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_link, 3.4.2); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_rename, 3.4.2)
int int
pub_glfs_h_rename(struct glfs *fs, struct glfs_object *olddir, pub_glfs_h_rename(struct glfs *fs, struct glfs_object *olddir,
const char *oldname, struct glfs_object *newdir, const char *oldname, struct glfs_object *newdir,
const char *newname) const char *newname)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *oldpinode = NULL; inode_t *oldpinode = NULL;
inode_t *newpinode = NULL; inode_t *newpinode = NULL;
loc_t oldloc = { loc_t oldloc = {
skipping to change at line 1994 skipping to change at line 1971
inode_unref(newpinode); inode_unref(newpinode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_rename, 3.4.2);
/* /*
* Given a handle/gfid, find if the corresponding inode is present in * Given a handle/gfid, find if the corresponding inode is present in
* the inode table. If yes create and return the corresponding glfs_object. * the inode table. If yes create and return the corresponding glfs_object.
*/ */
struct glfs_object * struct glfs_object *
glfs_h_find_handle(struct glfs *fs, unsigned char *handle, int len) glfs_h_find_handle(struct glfs *fs, unsigned char *handle, int len)
{ {
inode_t *newinode = NULL; inode_t *newinode = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
struct glfs_object *object = NULL; struct glfs_object *object = NULL;
skipping to change at line 2203 skipping to change at line 2178
* Current supported upcall_events: * Current supported upcall_events:
* GLFS_UPCALL_INODE_INVALIDATE * GLFS_UPCALL_INODE_INVALIDATE
* *
* After processing the event, applications need to free 'up_arg' by calling * After processing the event, applications need to free 'up_arg' by calling
* glfs_free(). * glfs_free().
* *
* Also similar to I/Os, the application should ideally stop polling before * Also similar to I/Os, the application should ideally stop polling before
* calling glfs_fini(..). Hence making an assumption that 'fs' & ctx structures * calling glfs_fini(..). Hence making an assumption that 'fs' & ctx structures
* cannot be freed while in this routine. * cannot be freed while in this routine.
*/ */
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_poll_upcall, 3.7.16)
int int
pub_glfs_h_poll_upcall(struct glfs *fs, struct glfs_upcall **up_arg) pub_glfs_h_poll_upcall(struct glfs *fs, struct glfs_upcall **up_arg)
{ {
upcall_entry *u_list = NULL; upcall_entry *u_list = NULL;
upcall_entry *tmp = NULL; upcall_entry *tmp = NULL;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
glusterfs_ctx_t *ctx = NULL; glusterfs_ctx_t *ctx = NULL;
int ret = -1; int ret = -1;
struct gf_upcall *upcall_data = NULL; struct gf_upcall *upcall_data = NULL;
skipping to change at line 2320 skipping to change at line 2296
pthread_mutex_unlock(&fs->mutex); pthread_mutex_unlock(&fs->mutex);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
restore: restore:
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
err: err:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_poll_upcall, 3.7.16);
static gf_boolean_t log_upcall370 = _gf_true; /* log once */ static gf_boolean_t log_upcall370 = _gf_true; /* log once */
/* The old glfs_h_poll_upcall interface requires intimate knowledge of the /* The old glfs_h_poll_upcall interface requires intimate knowledge of the
* structures that are returned to the calling application. This is not * structures that are returned to the calling application. This is not
* recommended, as the returned structures need to returned correctly (handles * recommended, as the returned structures need to returned correctly (handles
* closed, memory free'd with the unavailable GF_FREE(), and possibly more.) * closed, memory free'd with the unavailable GF_FREE(), and possibly more.)
* *
* To the best of our knowledge, only NFS-Ganesha uses the upcall events * To the best of our knowledge, only NFS-Ganesha uses the upcall events
* through gfapi. We keep this backwards compatibility function around so that * through gfapi. We keep this backwards compatibility function around so that
* applications using the existing implementation do not break. * applications using the existing implementation do not break.
* *
* WARNING: this function will be removed in the future. * WARNING: this function will be removed in the future.
*/ */
GFAPI_SYMVER_PUBLIC(glfs_h_poll_upcall370, glfs_h_poll_upcall, 3.7.0)
int int
pub_glfs_h_poll_upcall370(struct glfs *fs, struct glfs_callback_arg *up_arg) pub_glfs_h_poll_upcall370(struct glfs *fs, struct glfs_callback_arg *up_arg)
{ {
struct glfs_upcall *upcall = NULL; struct glfs_upcall *upcall = NULL;
int ret = -1; int ret = -1;
if (log_upcall370) { if (log_upcall370) {
log_upcall370 = _gf_false; log_upcall370 = _gf_false;
gf_log(THIS->name, GF_LOG_WARNING, gf_log(THIS->name, GF_LOG_WARNING,
"this application is " "this application is "
skipping to change at line 2402 skipping to change at line 2377
out: out:
if (upcall) { if (upcall) {
/* we can not use glfs_free() here, objects need to stay */ /* we can not use glfs_free() here, objects need to stay */
GF_FREE(upcall->event); GF_FREE(upcall->event);
GF_FREE(upcall); GF_FREE(upcall);
} }
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC(glfs_h_poll_upcall370, glfs_h_poll_upcall, 3.7.0);
#ifdef HAVE_ACL_LIBACL_H #ifdef HAVE_ACL_LIBACL_H
#include <glusterfs/glusterfs-acl.h> #include <glusterfs/glusterfs-acl.h>
#include <acl/libacl.h> #include <acl/libacl.h>
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_set, 3.7.0)
int int
pub_glfs_h_acl_set(struct glfs *fs, struct glfs_object *object, pub_glfs_h_acl_set(struct glfs *fs, struct glfs_object *object,
const acl_type_t type, const acl_t acl) const acl_type_t type, const acl_t acl)
{ {
int ret = -1; int ret = -1;
char *acl_s = NULL; char *acl_s = NULL;
const char *acl_key = NULL; const char *acl_key = NULL;
struct glfs_object *new_object = NULL; struct glfs_object *new_object = NULL;
DECLARE_OLD_THIS; DECLARE_OLD_THIS;
skipping to change at line 2456 skipping to change at line 2430
out: out:
if (IA_ISLNK(object->inode->ia_type) && new_object) if (IA_ISLNK(object->inode->ia_type) && new_object)
glfs_h_close(new_object); glfs_h_close(new_object);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_get, 3.7.0)
acl_t acl_t
pub_glfs_h_acl_get(struct glfs *fs, struct glfs_object *object, pub_glfs_h_acl_get(struct glfs *fs, struct glfs_object *object,
const acl_type_t type) const acl_type_t type)
{ {
int ret = 0; int ret = 0;
acl_t acl = NULL; acl_t acl = NULL;
char *acl_s = NULL; char *acl_s = NULL;
dict_t *xattr = NULL; dict_t *xattr = NULL;
const char *acl_key = NULL; const char *acl_key = NULL;
struct glfs_object *new_object = NULL; struct glfs_object *new_object = NULL;
skipping to change at line 2510 skipping to change at line 2485
if (IA_ISLNK(object->inode->ia_type) && new_object) if (IA_ISLNK(object->inode->ia_type) && new_object)
glfs_h_close(new_object); glfs_h_close(new_object);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return acl; return acl;
} }
#else /* !HAVE_ACL_LIBACL_H */ #else /* !HAVE_ACL_LIBACL_H */
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_get, 3.7.0)
acl_t acl_t
pub_glfs_h_acl_get(struct glfs *fs, struct glfs_object *object, pub_glfs_h_acl_get(struct glfs *fs, struct glfs_object *object,
const acl_type_t type) const acl_type_t type)
{ {
errno = ENOTSUP; errno = ENOTSUP;
return NULL; return NULL;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_set, 3.7.0)
int int
pub_glfs_h_acl_set(struct glfs *fs, struct glfs_object *object, pub_glfs_h_acl_set(struct glfs *fs, struct glfs_object *object,
const acl_type_t type, const acl_t acl) const acl_type_t type, const acl_t acl)
{ {
errno = ENOTSUP; errno = ENOTSUP;
return -1; return -1;
} }
#endif #endif
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_set, 3.7.0);
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_acl_get, 3.7.0);
/* The API to perform read using anonymous fd */ /* The API to perform read using anonymous fd */
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_anonymous_read, 3.7.0)
ssize_t ssize_t
pub_glfs_h_anonymous_read(struct glfs *fs, struct glfs_object *object, pub_glfs_h_anonymous_read(struct glfs *fs, struct glfs_object *object,
const void *buf, size_t count, off_t offset) const void *buf, size_t count, off_t offset)
{ {
struct iovec iov = { struct iovec iov = {
0, 0,
}; };
ssize_t ret = 0; ssize_t ret = 0;
/* validate in args */ /* validate in args */
skipping to change at line 2553 skipping to change at line 2529
} }
iov.iov_base = (void *)buf; iov.iov_base = (void *)buf;
iov.iov_len = count; iov.iov_len = count;
ret = glfs_anonymous_preadv(fs, object, &iov, 1, offset, 0); ret = glfs_anonymous_preadv(fs, object, &iov, 1, offset, 0);
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_anonymous_read, 3.7.0);
/* The API to perform write using anonymous fd */ /* The API to perform write using anonymous fd */
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_anonymous_write, 3.7.0)
ssize_t ssize_t
pub_glfs_h_anonymous_write(struct glfs *fs, struct glfs_object *object, pub_glfs_h_anonymous_write(struct glfs *fs, struct glfs_object *object,
const void *buf, size_t count, off_t offset) const void *buf, size_t count, off_t offset)
{ {
struct iovec iov = { struct iovec iov = {
0, 0,
}; };
ssize_t ret = 0; ssize_t ret = 0;
/* validate in args */ /* validate in args */
skipping to change at line 2579 skipping to change at line 2554
} }
iov.iov_base = (void *)buf; iov.iov_base = (void *)buf;
iov.iov_len = count; iov.iov_len = count;
ret = glfs_anonymous_pwritev(fs, object, &iov, 1, offset, 0); ret = glfs_anonymous_pwritev(fs, object, &iov, 1, offset, 0);
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_anonymous_write, 3.7.0); GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_object_copy, 3.11.0)
struct glfs_object * struct glfs_object *
pub_glfs_object_copy(struct glfs_object *src) pub_glfs_object_copy(struct glfs_object *src)
{ {
struct glfs_object *object = NULL; struct glfs_object *object = NULL;
GF_VALIDATE_OR_GOTO("glfs_dup_object", src, out); GF_VALIDATE_OR_GOTO("glfs_dup_object", src, out);
object = GF_CALLOC(1, sizeof(struct glfs_object), glfs_mt_glfs_object_t); object = GF_CALLOC(1, sizeof(struct glfs_object), glfs_mt_glfs_object_t);
if (object == NULL) { if (object == NULL) {
errno = ENOMEM; errno = ENOMEM;
skipping to change at line 2602 skipping to change at line 2576
"glfs_dup_object gfid=%s", uuid_utoa(src->inode->gfid), NULL); "glfs_dup_object gfid=%s", uuid_utoa(src->inode->gfid), NULL);
return NULL; return NULL;
} }
object->inode = inode_ref(src->inode); object->inode = inode_ref(src->inode);
gf_uuid_copy(object->gfid, src->inode->gfid); gf_uuid_copy(object->gfid, src->inode->gfid);
out: out:
return object; return object;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_object_copy, 3.11.0);
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_xreaddirplus_get_object, 3.11.0)
struct glfs_object * struct glfs_object *
pub_glfs_xreaddirplus_get_object(struct glfs_xreaddirp_stat *xstat) pub_glfs_xreaddirplus_get_object(struct glfs_xreaddirp_stat *xstat)
{ {
GF_VALIDATE_OR_GOTO("glfs_xreaddirplus_get_object", xstat, out); GF_VALIDATE_OR_GOTO("glfs_xreaddirplus_get_object", xstat, out);
if (!(xstat->flags_handled & GFAPI_XREADDIRP_HANDLE)) if (!(xstat->flags_handled & GFAPI_XREADDIRP_HANDLE))
gf_smsg(THIS->name, GF_LOG_ERROR, errno, API_MSG_HANDLE_NOT_SET, gf_smsg(THIS->name, GF_LOG_ERROR, errno, API_MSG_HANDLE_NOT_SET,
"GFAPI_XREADDIRP_HANDLE xstat=%p", xstat, "handle=%x", "GFAPI_XREADDIRP_HANDLE xstat=%p", xstat, "handle=%x",
xstat->flags_handled, NULL); xstat->flags_handled, NULL);
return xstat->object; return xstat->object;
out: out:
return NULL; return NULL;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_xreaddirplus_get_object, 3.11.0);
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_lease, 4.0.0)
int int
pub_glfs_h_lease(struct glfs *fs, struct glfs_object *object, pub_glfs_h_lease(struct glfs *fs, struct glfs_object *object,
struct glfs_lease *lease) struct glfs_lease *lease)
{ {
int ret = -1; int ret = -1;
xlator_t *subvol = NULL; xlator_t *subvol = NULL;
inode_t *inode = NULL; inode_t *inode = NULL;
loc_t loc = { loc_t loc = {
0, 0,
}; };
skipping to change at line 2682 skipping to change at line 2656
if (inode) if (inode)
inode_unref(inode); inode_unref(inode);
glfs_subvol_done(fs, subvol); glfs_subvol_done(fs, subvol);
__GLFS_EXIT_FS; __GLFS_EXIT_FS;
invalid_fs: invalid_fs:
return ret; return ret;
} }
GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_h_lease, 4.0.0);
 End of changes. 45 change blocks. 
62 lines changed or deleted 36 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)