diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-fops.c | 389 | ||||
-rw-r--r-- | api/src/glfs-handleops.c | 193 | ||||
-rw-r--r-- | api/src/glfs-handles.h | 37 | ||||
-rw-r--r-- | api/src/glfs.h | 88 |
4 files changed, 529 insertions, 178 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 4bf33b859..37e8d22d8 100644 --- a/api/src/glfs-fops.c +++ b/api/src/glfs-fops.c @@ -146,7 +146,7 @@ out: int -glfs_close (struct glfs_fd *glfd) +glfs_close_with_xdata (struct glfs_fd *glfd, dict_t *dict) { xlator_t *subvol = NULL; int ret = -1; @@ -169,7 +169,7 @@ glfs_close (struct glfs_fd *glfd) goto out; } - ret = syncop_flush (subvol, fd); + ret = syncop_flush_with_xdata (subvol, fd, dict); DECODE_SYNCOP_ERR (ret); out: fs = glfd->fs; @@ -183,6 +183,11 @@ out: return ret; } +int +glfs_close (struct glfs_fd *glfd) +{ + return(glfs_close_with_xdata(glfd, NULL)); +} int glfs_lstat (struct glfs *fs, const char *path, struct stat *stat) @@ -251,7 +256,7 @@ out: int -glfs_fstat (struct glfs_fd *glfd, struct stat *stat) +glfs_fstat_with_xdata (struct glfs_fd *glfd, struct stat *stat, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -274,7 +279,7 @@ glfs_fstat (struct glfs_fd *glfd, struct stat *stat) goto out; } - ret = syncop_fstat (subvol, fd, &iatt); + ret = syncop_fstat_with_xdata (subvol, fd, &iatt, dict); DECODE_SYNCOP_ERR (ret); if (ret == 0 && stat) @@ -288,17 +293,21 @@ out: return ret; } +int +glfs_fstat (struct glfs_fd *glfd, struct stat *stat) +{ + return(glfs_fstat_with_xdata(glfd, stat, NULL)); +} + struct glfs_fd * -glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode) +glfs_creat_with_xdata (struct glfs *fs, const char *path, int flags, mode_t mode, uuid_t gfid, dict_t *xattr_req) { int ret = -1; struct glfs_fd *glfd = NULL; xlator_t *subvol = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; int reval = 0; __glfs_entry_fs (fs); @@ -310,14 +319,6 @@ glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode) goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -409,8 +410,6 @@ retry: out: loc_wipe (&loc); - if (xattr_req) - dict_unref (xattr_req); if (ret && glfd) { glfs_fd_destroy (glfd); @@ -426,9 +425,28 @@ out: return glfd; } +struct glfs_fd * +glfs_creat (struct glfs *fs, const char *path, int flags, mode_t mode) +{ + dict_t *xattr_req = NULL; + uuid_t gfid; + struct glfs_fd *fd = NULL; + + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return NULL; + } + uuid_generate (gfid); + fd = glfs_creat_with_xdata (fs, path, flags, mode, gfid, xattr_req); + if (xattr_req) + dict_unref (xattr_req); + return (fd); +} off_t -glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence) +glfs_lseek_with_xdata (struct glfs_fd *glfd, off_t offset, int whence, dict_t *dict) { struct stat sb = {0, }; int ret = -1; @@ -443,7 +461,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 = glfs_fstat_with_xdata (glfd, &sb, dict); if (ret) { /* seek cannot fail :O */ break; @@ -455,12 +473,17 @@ glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence) return glfd->offset; } +off_t +glfs_lseek (struct glfs_fd *glfd, off_t offset, int whence) +{ + return(glfs_lseek_with_xdata(glfd, offset, whence, NULL)); +} ////////////// ssize_t -glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, - off_t offset, int flags) +glfs_preadv_with_xdata (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags, dict_t *dict) { xlator_t *subvol = NULL; ssize_t ret = -1; @@ -488,7 +511,7 @@ glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, size = iov_length (iovec, iovcnt); - ret = syncop_readv (subvol, fd, size, offset, 0, &iov, &cnt, &iobref); + ret = syncop_readv_with_xdata (subvol, fd, size, offset, 0, &iov, &cnt, &iobref, dict); DECODE_SYNCOP_ERR (ret); if (ret <= 0) goto out; @@ -512,6 +535,12 @@ out: return ret; } +ssize_t +glfs_preadv (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags) +{ + return(glfs_preadv_with_xdata(glfd, iovec, iovcnt, offset, flags, NULL)); +} ssize_t glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags) @@ -527,6 +556,19 @@ glfs_read (struct glfs_fd *glfd, void *buf, size_t count, int flags) return ret; } +ssize_t +glfs_read_with_xdata (struct glfs_fd *glfd, void *buf, size_t count, int flags, dict_t *dict) +{ + struct iovec iov = {0, }; + ssize_t ret = 0; + + iov.iov_base = buf; + iov.iov_len = count; + + ret = glfs_preadv_with_xdata (glfd, &iov, 1, glfd->offset, flags, dict); + + return ret; +} ssize_t glfs_pread (struct glfs_fd *glfd, void *buf, size_t count, off_t offset, @@ -783,6 +825,12 @@ ssize_t glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, off_t offset, int flags) { + return(glfs_pwritev_with_xdata(glfd, iovec, iovcnt, offset, flags, NULL)); +} +ssize_t +glfs_pwritev_with_xdata (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, + off_t offset, int flags, dict_t *dict) +{ xlator_t *subvol = NULL; int ret = -1; size_t size = -1; @@ -838,7 +886,7 @@ glfs_pwritev (struct glfs_fd *glfd, const struct iovec *iovec, int iovcnt, iov.iov_base = iobuf_ptr (iobuf); iov.iov_len = size; - ret = syncop_writev (subvol, fd, &iov, 1, offset, iobref, flags); + ret = syncop_writev_with_xdata (subvol, fd, &iov, 1, offset, iobref, flags, dict); DECODE_SYNCOP_ERR (ret); iobuf_unref (iobuf); @@ -873,6 +921,20 @@ glfs_write (struct glfs_fd *glfd, const void *buf, size_t count, int flags) return ret; } +ssize_t +glfs_write_with_xdata (struct glfs_fd *glfd, const void *buf, size_t count, int flags, dict_t *dict) +{ + struct iovec iov = {0, }; + ssize_t ret = 0; + + iov.iov_base = (void *) buf; + iov.iov_len = count; + + ret = glfs_pwritev_with_xdata (glfd, &iov, 1, glfd->offset, flags, dict); + + return ret; +} + ssize_t @@ -886,6 +948,16 @@ glfs_writev (struct glfs_fd *glfd, const struct iovec *iov, int count, return ret; } +ssize_t +glfs_writev_with_xdata (struct glfs_fd *glfd, const struct iovec *iov, int count, + int flags, dict_t *dict) +{ + ssize_t ret = 0; + + ret = glfs_pwritev_with_xdata (glfd, iov, count, glfd->offset, flags, dict); + + return ret; +} ssize_t glfs_pwrite (struct glfs_fd *glfd, const void *buf, size_t count, off_t offset, @@ -989,7 +1061,7 @@ glfs_writev_async (struct glfs_fd *glfd, const struct iovec *iov, int count, int -glfs_fsync (struct glfs_fd *glfd) +glfs_fsync_with_xdata (struct glfs_fd *glfd, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1011,7 +1083,7 @@ glfs_fsync (struct glfs_fd *glfd) goto out; } - ret = syncop_fsync (subvol, fd, 0); + ret = syncop_fsync_with_xdata (subvol, fd, 0, dict); DECODE_SYNCOP_ERR (ret); out: if (fd) @@ -1022,6 +1094,11 @@ out: return ret; } +int +glfs_fsync (struct glfs_fd *glfd) +{ + return(glfs_fsync_with_xdata(glfd, NULL)); +} static int glfs_fsync_async_common (struct glfs_fd *glfd, glfs_io_cbk fn, void *data, @@ -1106,7 +1183,7 @@ glfs_fdatasync_async (struct glfs_fd *glfd, glfs_io_cbk fn, void *data) int -glfs_ftruncate (struct glfs_fd *glfd, off_t offset) +glfs_ftruncate_with_xdata (struct glfs_fd *glfd, off_t offset, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1128,7 +1205,7 @@ glfs_ftruncate (struct glfs_fd *glfd, off_t offset) goto out; } - ret = syncop_ftruncate (subvol, fd, offset); + ret = syncop_ftruncate_with_xdata (subvol, fd, offset, dict); DECODE_SYNCOP_ERR (ret); out: if (fd) @@ -1139,6 +1216,11 @@ out: return ret; } +int +glfs_ftruncate (struct glfs_fd *glfd, off_t offset) +{ + return(glfs_ftruncate_with_xdata(glfd, offset, NULL)); +} int glfs_ftruncate_async (struct glfs_fd *glfd, off_t offset, @@ -1211,14 +1293,12 @@ out: int -glfs_symlink (struct glfs *fs, const char *data, const char *path) +glfs_symlink_with_xdata (struct glfs *fs, const char *data, const char *path, uuid_t gfid, dict_t *xattr_req) { int ret = -1; xlator_t *subvol = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; int reval = 0; __glfs_entry_fs (fs); @@ -1230,14 +1310,6 @@ glfs_symlink (struct glfs *fs, const char *data, const char *path) goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -1283,14 +1355,30 @@ retry: out: loc_wipe (&loc); - if (xattr_req) - dict_unref (xattr_req); - glfs_subvol_done (fs, subvol); return ret; } +int +glfs_symlink (struct glfs *fs, const char *data, const char *path) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + int ret = -1; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return -1 ; + } + + uuid_generate (gfid); + ret = glfs_symlink_with_xdata(fs, data, path, gfid, xattr_req); + + dict_unref (xattr_req); + return ret; +} int glfs_readlink (struct glfs *fs, const char *path, char *buf, size_t bufsiz) @@ -1342,14 +1430,12 @@ out: int -glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev) +glfs_mknod_with_xdata (struct glfs *fs, const char *path, mode_t mode, dev_t dev, uuid_t gfid, dict_t *xattr_req) { int ret = -1; xlator_t *subvol = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; int reval = 0; __glfs_entry_fs (fs); @@ -1361,14 +1447,7 @@ glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev) goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -1414,24 +1493,38 @@ retry: out: loc_wipe (&loc); - if (xattr_req) - dict_unref (xattr_req); - glfs_subvol_done (fs, subvol); return ret; } +int +glfs_mknod (struct glfs *fs, const char *path, mode_t mode, dev_t dev) +{ + dict_t *xattr_req = NULL; + uuid_t gfid; + int ret; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return -1; + } + + uuid_generate (gfid); + ret = glfs_mknod_with_xdata(fs, path, mode, dev, gfid, xattr_req); + + dict_unref (xattr_req); + return (ret); +} int -glfs_mkdir (struct glfs *fs, const char *path, mode_t mode) +glfs_mkdir_with_xdata (struct glfs *fs, const char *path, mode_t mode, uuid_t gfid, dict_t *xattr_req) { int ret = -1; xlator_t *subvol = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; int reval = 0; __glfs_entry_fs (fs); @@ -1443,14 +1536,6 @@ glfs_mkdir (struct glfs *fs, const char *path, mode_t mode) goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -1496,17 +1581,33 @@ retry: out: loc_wipe (&loc); - if (xattr_req) - dict_unref (xattr_req); glfs_subvol_done (fs, subvol); return ret; } +int +glfs_mkdir (struct glfs *fs, const char *path, mode_t mode) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + int ret; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return -1; + } + + uuid_generate (gfid); + ret = glfs_mkdir_with_xdata(fs, path, mode, gfid, xattr_req); + dict_unref (xattr_req); + return ret; +} int -glfs_unlink (struct glfs *fs, const char *path) +glfs_unlink_with_xdata (struct glfs *fs, const char *path, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1536,7 +1637,7 @@ retry: goto out; } - ret = syncop_unlink (subvol, &loc); + ret = syncop_unlink_with_xdata (subvol, &loc, dict); DECODE_SYNCOP_ERR (ret); ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1551,9 +1652,14 @@ out: return ret; } +int +glfs_unlink (struct glfs *fs, const char *path) +{ + return(glfs_unlink_with_xdata(fs, path, NULL)); +} int -glfs_rmdir (struct glfs *fs, const char *path) +glfs_rmdir_with_xdata (struct glfs *fs, const char *path, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1583,7 +1689,7 @@ retry: goto out; } - ret = syncop_rmdir (subvol, &loc, 0); + ret = syncop_rmdir_with_xdata (subvol, &loc, 0, dict); DECODE_SYNCOP_ERR (ret); ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -1598,9 +1704,14 @@ out: return ret; } +int +glfs_rmdir (struct glfs *fs, const char *path) +{ + return (glfs_rmdir_with_xdata(fs, path, NULL)); +} int -glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath) +glfs_rename_with_xdata (struct glfs *fs, const char *oldpath, const char *newpath, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1647,7 +1758,7 @@ retrynew: /* TODO: check if new or old is a prefix of the other, and fail EINVAL */ - ret = syncop_rename (subvol, &oldloc, &newloc); + ret = syncop_rename_with_xdata (subvol, &oldloc, &newloc, dict); DECODE_SYNCOP_ERR (ret); if (ret == -1 && errno == ESTALE) { @@ -1674,7 +1785,13 @@ out: int -glfs_link (struct glfs *fs, const char *oldpath, const char *newpath) +glfs_rename (struct glfs *fs, const char *oldpath, const char *newpath) +{ + return(glfs_rename_with_xdata(fs, oldpath, newpath, NULL)); +} + +int +glfs_link_with_xdata (struct glfs *fs, const char *oldpath, const char *newpath, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1725,7 +1842,7 @@ retrynew: } newloc.inode = inode_ref (oldloc.inode); - ret = syncop_link (subvol, &oldloc, &newloc); + ret = syncop_link_with_xdata (subvol, &oldloc, &newloc, dict); DECODE_SYNCOP_ERR (ret); if (ret == -1 && errno == ESTALE) { @@ -1746,6 +1863,11 @@ out: return ret; } +int +glfs_link (struct glfs *fs, const char *oldpath, const char *newpath) +{ + return(glfs_link_with_xdata(fs, oldpath, newpath, NULL)); +} struct glfs_fd * glfs_opendir (struct glfs *fs, const char *path) @@ -2184,8 +2306,8 @@ out: int -glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt, - int valid, int follow) +glfs_setattr_with_xdata (struct glfs *fs, const char *path, struct iatt *iatt, + int valid, int follow, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2212,7 +2334,7 @@ retry: if (ret) goto out; - ret = syncop_setattr (subvol, &loc, iatt, valid, 0, 0); + ret = syncop_setattr_with_xdata (subvol, &loc, iatt, valid, 0, 0, dict); DECODE_SYNCOP_ERR (ret); ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2224,9 +2346,15 @@ out: return ret; } +int +glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt, + int valid, int follow) +{ + return(glfs_setattr_with_xdata(fs, path, iatt, valid, follow, NULL)); +} int -glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid) +glfs_fsetattr_with_xdata (struct glfs_fd *glfd, struct iatt *iatt, int valid, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2248,7 +2376,7 @@ glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid) goto out; } - ret = syncop_fsetattr (subvol, fd, iatt, valid, 0, 0); + ret = syncop_fsetattr_with_xdata (subvol, fd, iatt, valid, 0, 0, dict); DECODE_SYNCOP_ERR (ret); out: if (fd) @@ -2259,6 +2387,11 @@ out: return ret; } +int +glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid) +{ + return(glfs_fsetattr_with_xdata(glfd, iatt, valid, NULL)); +} int glfs_chmod (struct glfs *fs, const char *path, mode_t mode) @@ -2500,8 +2633,8 @@ glfs_lgetxattr (struct glfs *fs, const char *path, const char *name, ssize_t -glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value, - size_t size) +glfs_fgetxattr_with_xdata (struct glfs_fd *glfd, const char *name, void *value, + size_t size, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2524,7 +2657,7 @@ glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value, goto out; } - ret = syncop_fgetxattr (subvol, fd, &xattr, name); + ret = syncop_fgetxattr_with_xdata (subvol, fd, &xattr, name, dict); DECODE_SYNCOP_ERR (ret); if (ret) goto out; @@ -2539,6 +2672,12 @@ out: return ret; } +ssize_t +glfs_fgetxattr (struct glfs_fd *glfd, const char *name, void *value, + size_t size) +{ + return(glfs_fgetxattr_with_xdata(glfd, name, value, size, NULL)); +} int glfs_listxattr_process (void *value, size_t size, dict_t *xattr) @@ -2628,7 +2767,8 @@ glfs_llistxattr (struct glfs *fs, const char *path, void *value, size_t size) ssize_t -glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size) +glfs_flistxattr_with_xdata (struct glfs_fd *glfd, void *value, size_t size, + dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2651,7 +2791,7 @@ glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size) goto out; } - ret = syncop_fgetxattr (subvol, fd, &xattr, NULL); + ret = syncop_fgetxattr_with_xdata (subvol, fd, &xattr, NULL, dict); DECODE_SYNCOP_ERR (ret); if (ret) goto out; @@ -2667,6 +2807,12 @@ out: } +ssize_t +glfs_flistxattr (struct glfs_fd *glfd, void *value, size_t size) +{ + return(glfs_flistxattr_with_xdata(glfd, value, size, NULL)); +} + dict_t * dict_for_key_value (const char *name, const char *value, size_t size) { @@ -2689,7 +2835,7 @@ dict_for_key_value (const char *name, const char *value, size_t size) int glfs_setxattr_common (struct glfs *fs, const char *path, const char *name, - const void *value, size_t size, int flags, int follow) + const void *value, size_t size, int flags, int follow, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2724,7 +2870,7 @@ retry: goto out; } - ret = syncop_setxattr (subvol, &loc, xattr, flags); + ret = syncop_setxattr_with_xdata (subvol, &loc, xattr, flags, dict); DECODE_SYNCOP_ERR (ret); ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2744,21 +2890,27 @@ int 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); + return glfs_setxattr_common (fs, path, name, value, size, flags, 1, NULL); } +int +glfs_setxattr_with_xdata (struct glfs *fs, const char *path, const char *name, + const void *value, size_t size, int flags, dict_t * dict) +{ + return glfs_setxattr_common (fs, path, name, value, size, flags, 1, dict); +} int 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); + return glfs_setxattr_common (fs, path, name, value, size, flags, 0, NULL); } int -glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value, - size_t size, int flags) +glfs_fsetxattr_with_xdata (struct glfs_fd *glfd, const char *name, const void *value, + size_t size, int flags, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2788,7 +2940,7 @@ glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value, goto out; } - ret = syncop_fsetxattr (subvol, fd, xattr, flags); + ret = syncop_fsetxattr_with_xdata (subvol, fd, xattr, flags, dict); DECODE_SYNCOP_ERR (ret); out: if (xattr) @@ -2802,10 +2954,16 @@ out: return ret; } +int +glfs_fsetxattr (struct glfs_fd *glfd, const char *name, const void *value, + size_t size, int flags) +{ + return(glfs_fsetxattr_with_xdata(glfd, name, value, size, flags, NULL)); +} int glfs_removexattr_common (struct glfs *fs, const char *path, const char *name, - int follow) + int follow, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2832,7 +2990,7 @@ retry: if (ret) goto out; - ret = syncop_removexattr (subvol, &loc, name, 0); + ret = syncop_removexattr_with_xdata (subvol, &loc, name, dict); DECODE_SYNCOP_ERR (ret); ESTALE_RETRY (ret, errno, reval, &loc, retry); @@ -2849,19 +3007,25 @@ out: int glfs_removexattr (struct glfs *fs, const char *path, const char *name) { - return glfs_removexattr_common (fs, path, name, 1); + return glfs_removexattr_common (fs, path, name, 1, NULL); } int glfs_lremovexattr (struct glfs *fs, const char *path, const char *name) { - return glfs_removexattr_common (fs, path, name, 0); + return glfs_removexattr_common (fs, path, name, 0, NULL); +} + +int +glfs_removexattr_with_xdata (struct glfs *fs, const char *path, const char *name, dict_t *dict) +{ + return glfs_removexattr_common (fs, path, name, 1, dict); } int -glfs_fremovexattr (struct glfs_fd *glfd, const char *name) +glfs_fremovexattr_with_xdata (struct glfs_fd *glfd, const char *name, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -2883,7 +3047,7 @@ glfs_fremovexattr (struct glfs_fd *glfd, const char *name) goto out; } - ret = syncop_fremovexattr (subvol, fd, name, 0); + ret = syncop_fremovexattr_with_xdata (subvol, fd, name, dict); DECODE_SYNCOP_ERR (ret); out: if (fd) @@ -2894,6 +3058,11 @@ out: return ret; } +int +glfs_fremovexattr (struct glfs_fd *glfd, const char *name) +{ + return(glfs_fremovexattr_with_xdata(glfd, name, NULL)); +} int glfs_fallocate (struct glfs_fd *glfd, int keep_size, off_t offset, size_t len) @@ -2997,6 +3166,29 @@ out: } int +glfs_ipc (struct glfs *fs, int32_t op) +{ + int ret = -1; + xlator_t *subvol = NULL; + + __glfs_entry_fs (fs); + + subvol = glfs_active_subvol (fs); + if (!subvol) { + ret = -1; + errno = EIO; + goto out; + } + + ret = syncop_ipc (subvol, op); + DECODE_SYNCOP_ERR (ret); + +out: + glfs_subvol_done (fs, subvol); + return ret; +} + +int glfs_chdir (struct glfs *fs, const char *path) { int ret = -1; @@ -3139,7 +3331,6 @@ out: return retpath; } - char * glfs_getcwd (struct glfs *fs, char *buf, size_t n) { diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c index 7fb202973..b97590239 100644 --- a/api/src/glfs-handleops.c +++ b/api/src/glfs-handleops.c @@ -432,7 +432,7 @@ out: } struct glfs_fd * -glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) +glfs_h_open_with_xdata (struct glfs *fs, struct glfs_object *object, int flags, dict_t * dict) { int ret = -1; struct glfs_fd *glfd = NULL; @@ -441,7 +441,7 @@ glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) loc_t loc = {0, }; /* validate in args */ - if ((fs == NULL) || (object == NULL)) { + if ((fs == NULL) || (object == NULL) || (dict == NULL)) { errno = EINVAL; return NULL; } @@ -492,7 +492,7 @@ glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) GLFS_LOC_FILL_INODE (inode, loc, out); /* fop/op */ - ret = syncop_open (subvol, &loc, flags, glfd->fd); + ret = syncop_open_with_xdata (subvol, &loc, flags, glfd->fd, dict); DECODE_SYNCOP_ERR (ret); out: @@ -515,9 +515,16 @@ out: return glfd; } +struct glfs_fd * +glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) +{ + return(glfs_h_open_with_xdata(fs, object, flags, NULL)); +} + struct glfs_object * -glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, - int flags, mode_t mode, struct stat *stat) +glfs_h_creat_with_xdata (struct glfs *fs, struct glfs_object *parent, const char *path, + int flags, mode_t mode, struct stat *stat, + uuid_t gfid, dict_t * xattr_req) { int ret = -1; struct glfs_fd *glfd = NULL; @@ -525,12 +532,10 @@ glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, inode_t *inode = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; struct glfs_object *object = NULL; /* validate in args */ - if ((fs == NULL) || (parent == NULL) || (path == NULL)) { + if ((fs == NULL) || (parent == NULL) || (path == NULL) || (xattr_req == NULL)) { errno = EINVAL; return NULL; } @@ -552,14 +557,6 @@ glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -628,20 +625,34 @@ out: } struct glfs_object * -glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path, - mode_t mode, struct stat *stat) +glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, + int flags, mode_t mode, struct stat *stat) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return NULL; + } + uuid_generate (gfid); + return(glfs_h_creat_with_xdata(fs, parent, path, flags, mode, stat, gfid, xattr_req)); +} + +struct glfs_object * +glfs_h_mkdir_with_xdata (struct glfs *fs, struct glfs_object *parent, const char *path, + mode_t mode, struct stat *stat, uuid_t gfid, dict_t *xattr_req) { int ret = -1; xlator_t *subvol = NULL; inode_t *inode = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; struct glfs_object *object = NULL; /* validate in args */ - if ((fs == NULL) || (parent == NULL) || (path == NULL)) { + if ((fs == NULL) || (parent == NULL) || (path == NULL) || (xattr_req == NULL)) { errno = EINVAL; return NULL; } @@ -663,14 +674,6 @@ glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path, goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -717,20 +720,36 @@ out: } 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) +glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path, + mode_t mode, struct stat *stat) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return NULL; + } + + uuid_generate (gfid); + return(glfs_h_mkdir_with_xdata(fs, parent, path, mode, stat, gfid, xattr_req)); +} + +struct glfs_object * +glfs_h_mknod_with_xdata (struct glfs *fs, struct glfs_object *parent, const char *path, + mode_t mode, dev_t dev, struct stat *stat, + uuid_t gfid, dict_t * xattr_req) { int ret = -1; xlator_t *subvol = NULL; inode_t *inode = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; struct glfs_object *object = NULL; /* validate in args */ - if ((fs == NULL) || (parent == NULL) || (path == NULL)) { + if ((fs == NULL) || (parent == NULL) || (path == NULL) || (xattr_req == NULL)) { errno = EINVAL; return NULL; } @@ -752,14 +771,6 @@ glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path, goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -804,8 +815,26 @@ out: return object; } +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) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return NULL; + } + + uuid_generate (gfid); + + return(glfs_h_mknod_with_xdata(fs, parent, path, mode, dev, stat, gfid, xattr_req)); +} + int -glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path) +glfs_h_unlink_with_xdata (struct glfs *fs, struct glfs_object *parent, const char *path, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -841,13 +870,13 @@ glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path) } if (!IA_ISDIR(loc.inode->ia_type)) { - ret = syncop_unlink (subvol, &loc); + ret = syncop_unlink_with_xdata (subvol, &loc, dict); DECODE_SYNCOP_ERR (ret); if (ret != 0) { goto out; } } else { - ret = syncop_rmdir (subvol, &loc, 0); + ret = syncop_rmdir_with_xdata (subvol, &loc, 0, dict); DECODE_SYNCOP_ERR (ret); if (ret != 0) { goto out; @@ -868,8 +897,14 @@ out: return ret; } +int +glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path) +{ + return(glfs_h_unlink_with_xdata(fs, parent, path, NULL)); +} + struct glfs_fd * -glfs_h_opendir (struct glfs *fs, struct glfs_object *object) +glfs_h_opendir_with_xdata (struct glfs *fs, struct glfs_object *object, dict_t *dict) { int ret = -1; struct glfs_fd *glfd = NULL; @@ -922,7 +957,7 @@ glfs_h_opendir (struct glfs *fs, struct glfs_object *object) GLFS_LOC_FILL_INODE (inode, loc, out); /* fop/op */ - ret = syncop_opendir (subvol, &loc, glfd->fd); + ret = syncop_opendir_with_xdata (subvol, &loc, glfd->fd, dict); DECODE_SYNCOP_ERR (ret); out: @@ -944,6 +979,12 @@ out: return glfd; } +struct glfs_fd * +glfs_h_opendir (struct glfs *fs, struct glfs_object *object) +{ + return(glfs_h_opendir_with_xdata(fs, object, NULL)); +} + ssize_t glfs_h_extract_handle (struct glfs_object *object, unsigned char *handle, int len) @@ -1122,21 +1163,19 @@ out: } struct glfs_object * -glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name, - const char *data, struct stat *stat) +glfs_h_symlink_with_xdata (struct glfs *fs, struct glfs_object *parent, const char *name, + const char *data, struct stat *stat, uuid_t gfid, dict_t * xattr_req) { int ret = -1; xlator_t *subvol = NULL; inode_t *inode = NULL; loc_t loc = {0, }; struct iatt iatt = {0, }; - uuid_t gfid; - dict_t *xattr_req = NULL; struct glfs_object *object = NULL; /* validate in args */ if ((fs == NULL) || (parent == NULL) || (name == NULL) || - (data == NULL)) { + (data == NULL) || (xattr_req == NULL)) { errno = EINVAL; return NULL; } @@ -1158,14 +1197,6 @@ glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name, goto out; } - xattr_req = dict_new (); - if (!xattr_req) { - ret = -1; - errno = ENOMEM; - goto out; - } - - uuid_generate (gfid); ret = dict_set_static_bin (xattr_req, "gfid-req", gfid, 16); if (ret) { ret = -1; @@ -1216,6 +1247,23 @@ out: return object; } +struct glfs_object * +glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name, + const char *data, struct stat *stat) +{ + uuid_t gfid; + dict_t *xattr_req = NULL; + + xattr_req = dict_new (); + if (!xattr_req) { + errno = ENOMEM; + return NULL; + } + + uuid_generate (gfid); + return(glfs_h_symlink_with_xdata(fs, parent, name, data, stat, gfid, xattr_req)); +} + int glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf, size_t bufsiz) @@ -1274,8 +1322,8 @@ out: } int -glfs_h_link (struct glfs *fs, struct glfs_object *linksrc, - struct glfs_object *parent, const char *name) +glfs_h_link_with_xdata (struct glfs *fs, struct glfs_object *linksrc, + struct glfs_object *parent, const char *name, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1338,7 +1386,7 @@ glfs_h_link (struct glfs *fs, struct glfs_object *linksrc, newloc.inode = inode_ref (inode); /* fop/op */ - ret = syncop_link (subvol, &oldloc, &newloc); + ret = syncop_link_with_xdata (subvol, &oldloc, &newloc, dict); DECODE_SYNCOP_ERR (ret); if (ret == 0) @@ -1360,8 +1408,14 @@ out: } int -glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname, - struct glfs_object *newdir, const char *newname) +glfs_h_link (struct glfs *fs, struct glfs_object *linksrc, + struct glfs_object *parent, const char *name) +{ + return(glfs_h_link_with_xdata(fs, linksrc, parent, name, NULL)); +} +int +glfs_h_rename_with_xdata (struct glfs *fs, struct glfs_object *olddir, const char *oldname, + struct glfs_object *newdir, const char *newname, dict_t *dict) { int ret = -1; xlator_t *subvol = NULL; @@ -1429,7 +1483,7 @@ glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname, /* TODO: check if new or old is a prefix of the other, and fail EINVAL */ - ret = syncop_rename (subvol, &oldloc, &newloc); + ret = syncop_rename_with_xdata (subvol, &oldloc, &newloc, dict); DECODE_SYNCOP_ERR (ret); if (ret == 0) @@ -1451,3 +1505,10 @@ out: return ret; } + +int +glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname, + struct glfs_object *newdir, const char *newname) +{ + return(glfs_h_rename_with_xdata(fs, olddir, oldname, newdir, newname, NULL)); +} diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h index 027089760..277b20a3d 100644 --- a/api/src/glfs-handles.h +++ b/api/src/glfs-handles.h @@ -84,21 +84,42 @@ struct glfs_object *glfs_h_creat (struct glfs *fs, struct glfs_object *parent, const char *path, int flags, mode_t mode, struct stat *sb) __THROW; +struct glfs_object *glfs_h_creat_with_xdata (struct glfs *fs, struct glfs_object *parent, + const char *path, int flags, mode_t mode, + struct stat *sb, uuid_t gfid, dict_t * xattr_req); + struct glfs_object *glfs_h_mkdir (struct glfs *fs, struct glfs_object *parent, const char *path, mode_t flags, struct stat *sb) __THROW; +struct glfs_object *glfs_h_mkdir_with_xdata (struct glfs *fs, struct glfs_object *parent, + const char *path, mode_t flags, + struct stat *sb, uuid_t gfid, dict_t * xattr_req); + struct glfs_object *glfs_h_mknod (struct glfs *fs, struct glfs_object *parent, const char *path, mode_t mode, dev_t dev, struct stat *sb) __THROW; +struct glfs_object *glfs_h_mknod_with_xdata (struct glfs *fs, struct glfs_object *parent, + const char *path, mode_t mode, dev_t dev, + struct stat *sb, uuid_t gfid, dict_t * xattr_req); + struct glfs_object *glfs_h_symlink (struct glfs *fs, struct glfs_object *parent, const char *name, const char *data, struct stat *stat) __THROW; +struct glfs_object *glfs_h_symlink_with_xdata (struct glfs *fs, + struct glfs_object *parent, + const char *name, + const char *data, + struct stat *stat, + uuid_t gfid, + dict_t * xattr_req) __THROW; /* Operations on the actual objects */ int glfs_h_unlink (struct glfs *fs, struct glfs_object *parent, const char *path) __THROW; +int glfs_h_unlink_with_xdata (struct glfs *fs, struct glfs_object *parent, + const char *path, dict_t *dict) __THROW; int glfs_h_close (struct glfs_object *object) __THROW; @@ -130,10 +151,16 @@ int glfs_h_readlink (struct glfs *fs, struct glfs_object *object, char *buf, int glfs_h_link (struct glfs *fs, struct glfs_object *linktgt, struct glfs_object *parent, const char *name) __THROW; +int glfs_h_link_with_xdata (struct glfs *fs, struct glfs_object *linktgt, + struct glfs_object *parent, const char *name, + dict_t *dict) __THROW; int glfs_h_rename (struct glfs *fs, struct glfs_object *olddir, const char *oldname, struct glfs_object *newdir, const char *newname) __THROW; +int glfs_h_rename_with_xdata (struct glfs *fs, struct glfs_object *olddir, + const char *oldname, struct glfs_object *newdir, + const char *newname, dict_t *dict) __THROW; int glfs_h_removexattrs (struct glfs *fs, struct glfs_object *object, const char *name) __THROW; @@ -147,11 +174,17 @@ struct glfs_object *glfs_h_create_from_handle (struct glfs *fs, struct stat *stat) __THROW; /* Operations enabling object handles to fd transitions */ -struct glfs_fd *glfs_h_opendir (struct glfs *fs, - struct glfs_object *object) __THROW; +struct glfs_fd *glfs_h_opendir (struct glfs *fs, struct glfs_object *object) + __THROW; +struct glfs_fd *glfs_h_opendir_with_xdata (struct glfs *fs, + struct glfs_object *object, + dict_t *dict) __THROW; struct glfs_fd *glfs_h_open (struct glfs *fs, struct glfs_object *object, int flags) __THROW; +struct glfs_fd *glfs_h_open_with_xdata (struct glfs *fs, + struct glfs_object *object, int flags, + dict_t *dict) __THROW; __END_DECLS diff --git a/api/src/glfs.h b/api/src/glfs.h index 4344df24d..1ebb8f507 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -387,8 +387,11 @@ glfs_fd_t *glfs_open (glfs_t *fs, const char *path, int flags) __THROW; glfs_fd_t *glfs_creat (glfs_t *fs, const char *path, int flags, mode_t mode) __THROW; +glfs_fd_t *glfs_creat_with_xdata (glfs_t *fs, const char *path, int flags, + mode_t mode, uuid_t gfid, dict_t *dict) __THROW; int glfs_close (glfs_fd_t *fd) __THROW; +int glfs_close_with_xdata (glfs_fd_t *fd, dict_t *dict) __THROW; glfs_t *glfs_from_glfd (glfs_fd_t *fd) __THROW; @@ -422,10 +425,13 @@ typedef void (*glfs_io_cbk) (glfs_fd_t *fd, ssize_t ret, void *data); // glfs_{read,write}[_async] -ssize_t glfs_read (glfs_fd_t *fd, void *buf, - size_t count, int flags) __THROW; -ssize_t glfs_write (glfs_fd_t *fd, const void *buf, - size_t count, int flags) __THROW; +ssize_t glfs_read (glfs_fd_t *fd, void *buf, size_t count, int flags) __THROW; +ssize_t glfs_read_with_xdata (struct glfs_fd *glfd, void *buf, size_t count, + int flags, dict_t *dict) __THROW; +ssize_t glfs_write (glfs_fd_t *fd, const void *buf, size_t count, int flags) + __THROW; +ssize_t glfs_write_with_xdata (glfs_fd_t *fd, const void *buf, size_t count, + int flags, dict_t *dict) __THROW; int glfs_read_async (glfs_fd_t *fd, void *buf, size_t count, int flags, glfs_io_cbk fn, void *data) __THROW; int glfs_write_async (glfs_fd_t *fd, const void *buf, size_t count, int flags, @@ -437,6 +443,8 @@ ssize_t glfs_readv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, int flags) __THROW; ssize_t glfs_writev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, int flags) __THROW; +ssize_t glfs_writev_with_xdata (glfs_fd_t *fd, const struct iovec *iov, + int iovcnt, int flags, dict_t *dict) __THROW; int glfs_readv_async (glfs_fd_t *fd, const struct iovec *iov, int count, int flags, glfs_io_cbk fn, void *data) __THROW; int glfs_writev_async (glfs_fd_t *fd, const struct iovec *iov, int count, @@ -457,29 +465,42 @@ int glfs_pwrite_async (glfs_fd_t *fd, const void *buf, int count, off_t offset, ssize_t glfs_preadv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) __THROW; +ssize_t glfs_preadv_with_xdata (glfs_fd_t *fd, const struct iovec *iov, + int iovcnt, off_t offset, int flags, + dict_t *dict) __THROW; ssize_t glfs_pwritev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset, int flags) __THROW; -int glfs_preadv_async (glfs_fd_t *fd, const struct iovec *iov, - int count, off_t offset, int flags, - glfs_io_cbk fn, void *data) __THROW; -int glfs_pwritev_async (glfs_fd_t *fd, const struct iovec *iov, - int count, off_t offset, int flags, - glfs_io_cbk fn, void *data) __THROW; +ssize_t glfs_pwritev_with_xdata (glfs_fd_t *fd, const struct iovec *iov, + int iovcnt, off_t offset, int flags, + dict_t *dict) __THROW; +int glfs_preadv_async (glfs_fd_t *fd, const struct iovec *iov, int count, + off_t offset, int flags, glfs_io_cbk fn, void *data) + __THROW; +int glfs_pwritev_async (glfs_fd_t *fd, const struct iovec *iov, int count, + off_t offset, int flags, glfs_io_cbk fn, void *data) + __THROW; off_t glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW; +off_t glfs_lseek_with_xdata (glfs_fd_t *fd, off_t offset, int whence, + dict_t *dict) __THROW; int glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW; int glfs_ftruncate (glfs_fd_t *fd, off_t length) __THROW; +int glfs_ftruncate_with_xdata (glfs_fd_t *fd, off_t length, dict_t *dict) + __THROW; int glfs_ftruncate_async (glfs_fd_t *fd, off_t length, glfs_io_cbk fn, void *data) __THROW; int glfs_lstat (glfs_t *fs, const char *path, struct stat *buf) __THROW; int glfs_stat (glfs_t *fs, const char *path, struct stat *buf) __THROW; int glfs_fstat (glfs_fd_t *fd, struct stat *buf) __THROW; +int glfs_fstat_with_xdata (glfs_fd_t *fd, struct stat *buf, dict_t *dict) + __THROW; int glfs_fsync (glfs_fd_t *fd) __THROW; +int glfs_fsync_with_xdata (glfs_fd_t *fd, dict_t *dict) __THROW; int glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW; int glfs_fdatasync (glfs_fd_t *fd) __THROW; @@ -487,22 +508,35 @@ int glfs_fdatasync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW; int glfs_access (glfs_t *fs, const char *path, int mode) __THROW; -int glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) __THROW; +int glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) + __THROW; +int glfs_symlink_with_xdata (glfs_t *fs, const char *oldpath, + const char *newpath, uuid_t gfid, dict_t *dict) + __THROW; int glfs_readlink (glfs_t *fs, const char *path, char *buf, size_t bufsiz) __THROW; int glfs_mknod (glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW; +int glfs_mknod_with_xdata (glfs_t *fs, const char *path, mode_t mode, + dev_t dev, uuid_t gfid, dict_t *dict) __THROW; int glfs_mkdir (glfs_t *fs, const char *path, mode_t mode) __THROW; +int glfs_mkdir_with_xdata (glfs_t *fs, const char *path, mode_t mode, + uuid_t gfid, dict_t *dict) __THROW; int glfs_unlink (glfs_t *fs, const char *path) __THROW; int glfs_rmdir (glfs_t *fs, const char *path) __THROW; +int glfs_rmdir_with_xdata (glfs_t *fs, const char *path, dict_t *dict) __THROW; int glfs_rename (glfs_t *fs, const char *oldpath, const char *newpath) __THROW; +int glfs_rename_with_xdata (glfs_t *fs, const char *oldpath, + const char *newpath, dict_t *dict) __THROW; int glfs_link (glfs_t *fs, const char *oldpath, const char *newpath) __THROW; +int glfs_link_with_xdata (glfs_t *fs, const char *oldpath, const char *newpath, + dict_t *dict) __THROW; glfs_fd_t *glfs_opendir (glfs_t *fs, const char *path) __THROW; @@ -565,6 +599,9 @@ ssize_t glfs_lgetxattr (glfs_t *fs, const char *path, const char *name, ssize_t glfs_fgetxattr (glfs_fd_t *fd, const char *name, void *value, size_t size) __THROW; +ssize_t glfs_fgetxattr_with_xdata (glfs_fd_t *fd, const char *name, + void *value, size_t size, dict_t *dict) + __THROW; ssize_t glfs_listxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW; @@ -573,21 +610,34 @@ ssize_t glfs_llistxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW; ssize_t glfs_flistxattr (glfs_fd_t *fd, void *value, size_t size) __THROW; +ssize_t glfs_flistxattr_with_xdata (glfs_fd_t *fd, void *value, size_t size, + dict_t *dict) __THROW; int glfs_setxattr (glfs_t *fs, const char *path, const char *name, const void *value, size_t size, int flags) __THROW; +int glfs_setxattr_with_xdata (glfs_t *fs, const char *path, const char *name, + const void *value, size_t size, int flags, dict_t *dict); + int glfs_lsetxattr (glfs_t *fs, const char *path, const char *name, const void *value, size_t size, int flags) __THROW; int glfs_fsetxattr (glfs_fd_t *fd, const char *name, const void *value, size_t size, int flags) __THROW; +int glfs_fsetxattr_with_xdata (glfs_fd_t *fd, const char *name, + const void *value, size_t size, int flags, + dict_t *dict) __THROW; + int glfs_removexattr (glfs_t *fs, const char *path, const char *name) __THROW; +int glfs_removexattr_with_xdata (glfs_t *fs, const char *path, + const char *name, dict_t *dict) __THROW; int glfs_lremovexattr (glfs_t *fs, const char *path, const char *name) __THROW; int glfs_fremovexattr (glfs_fd_t *fd, const char *name) __THROW; +int glfs_fremovexattr_with_xdata (glfs_fd_t *fd, const char *name, + dict_t *dict) __THROW; int glfs_fallocate(glfs_fd_t *fd, int keep_size, off_t offset, size_t len) __THROW; @@ -611,6 +661,22 @@ int glfs_fchdir (glfs_fd_t *fd) __THROW; char *glfs_realpath (glfs_t *fs, const char *path, char *resolved_path) __THROW; +int +glfs_setattr_with_xdata (struct glfs *fs, const char *path, struct iatt *iatt, + int valid, int follow, dict_t *dict); +int +glfs_fsetattr_with_xdata (struct glfs_fd *glfd, struct iatt *iatt, int valid, dict_t *dict); +int +glfs_setattr (struct glfs *fs, const char *path, struct iatt *iatt, + int valid, int follow); +int +glfs_fsetattr (struct glfs_fd *glfd, struct iatt *iatt, int valid); + +int glfs_ipc (struct glfs *fs, int32_t op) __THROW; + + + + /* * @cmd and @flock are as specified in man fcntl(2). */ |