summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2013-12-11 16:26:25 -0500
committerJeff Darcy <jdarcy@redhat.com>2013-12-11 16:26:25 -0500
commitef171ff2bfd114e46442441fbdeb692a416cc951 (patch)
tree27ac663045954c8efb145fbbae3df87d7bbfe5b3 /api
parent4bbbda2017be3cfae57c122d70d11c9470364f63 (diff)
Roll-up patch for NSR so far.
Previous history: https://forge.gluster.org/~jdarcy/glusterfs-core/glusterfs-nsr Change-Id: I2b56328788753c6a74d9589815f2dd705ac9ce6a Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c365
-rw-r--r--api/src/glfs-handleops.c193
-rw-r--r--api/src/glfs-handles.h37
-rw-r--r--api/src/glfs.h86
4 files changed, 503 insertions, 178 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index f3ac335fb..8d905193a 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -145,7 +145,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;
@@ -168,7 +168,7 @@ glfs_close (struct glfs_fd *glfd)
goto out;
}
- ret = syncop_flush (subvol, fd);
+ ret = syncop_flush_with_xdata (subvol, fd, dict);
out:
fs = glfd->fs;
glfs_fd_destroy (glfd);
@@ -181,6 +181,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)
@@ -249,7 +254,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;
@@ -272,7 +277,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);
if (ret == 0 && stat)
glfs_iatt_to_stat (glfd->fs, &iatt, stat);
@@ -285,17 +290,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);
@@ -307,14 +316,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;
@@ -404,8 +405,6 @@ retry:
out:
loc_wipe (&loc);
- if (xattr_req)
- dict_unref (xattr_req);
if (ret && glfd) {
glfs_fd_destroy (glfd);
@@ -421,9 +420,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;
@@ -438,7 +456,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;
@@ -450,12 +468,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;
@@ -483,7 +506,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);
if (ret <= 0)
goto out;
@@ -506,6 +529,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)
@@ -521,6 +550,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,
@@ -773,6 +815,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;
@@ -828,7 +876,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);
iobuf_unref (iobuf);
iobref_unref (iobref);
@@ -862,6 +910,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
@@ -875,6 +937,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,
@@ -978,7 +1050,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;
@@ -1000,7 +1072,7 @@ glfs_fsync (struct glfs_fd *glfd)
goto out;
}
- ret = syncop_fsync (subvol, fd, 0);
+ ret = syncop_fsync_with_xdata (subvol, fd, 0, dict);
out:
if (fd)
fd_unref (fd);
@@ -1010,6 +1082,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,
@@ -1093,7 +1170,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;
@@ -1115,7 +1192,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);
out:
if (fd)
fd_unref (fd);
@@ -1125,6 +1202,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,
@@ -1196,14 +1278,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);
@@ -1215,14 +1295,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;
@@ -1267,14 +1339,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)
@@ -1325,14 +1413,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);
@@ -1344,14 +1430,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;
@@ -1396,24 +1475,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);
@@ -1425,14 +1518,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;
@@ -1477,17 +1562,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;
@@ -1517,7 +1618,7 @@ retry:
goto out;
}
- ret = syncop_unlink (subvol, &loc);
+ ret = syncop_unlink_with_xdata (subvol, &loc, dict);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -1531,9 +1632,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;
@@ -1563,7 +1669,7 @@ retry:
goto out;
}
- ret = syncop_rmdir (subvol, &loc, 0);
+ ret = syncop_rmdir_with_xdata (subvol, &loc, 0, dict);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -1577,9 +1683,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;
@@ -1626,7 +1737,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);
if (ret == -1 && errno == ESTALE) {
if (reval < DEFAULT_REVAL_COUNT) {
@@ -1652,7 +1763,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;
@@ -1703,7 +1820,7 @@ retrynew:
}
newloc.inode = inode_ref (oldloc.inode);
- ret = syncop_link (subvol, &oldloc, &newloc);
+ ret = syncop_link_with_xdata (subvol, &oldloc, &newloc, dict);
if (ret == -1 && errno == ESTALE) {
loc_wipe (&oldloc);
@@ -1723,6 +1840,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)
@@ -2158,8 +2280,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;
@@ -2186,7 +2308,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);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
out:
@@ -2197,9 +2319,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;
@@ -2221,7 +2349,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);
out:
if (fd)
fd_unref (fd);
@@ -2231,6 +2359,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)
@@ -2471,8 +2604,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;
@@ -2495,7 +2628,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);
if (ret)
goto out;
@@ -2509,6 +2642,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)
@@ -2597,7 +2736,7 @@ 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;
@@ -2620,7 +2759,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);
if (ret)
goto out;
@@ -2635,6 +2774,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)
{
@@ -2657,7 +2802,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;
@@ -2692,7 +2837,7 @@ retry:
goto out;
}
- ret = syncop_setxattr (subvol, &loc, xattr, flags);
+ ret = syncop_setxattr_with_xdata (subvol, &loc, xattr, flags, dict);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -2711,21 +2856,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;
@@ -2755,7 +2906,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);
out:
if (xattr)
dict_unref (xattr);
@@ -2768,10 +2919,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;
@@ -2798,7 +2955,7 @@ retry:
if (ret)
goto out;
- ret = syncop_removexattr (subvol, &loc, name);
+ ret = syncop_removexattr_with_xdata (subvol, &loc, name, dict);
ESTALE_RETRY (ret, errno, reval, &loc, retry);
@@ -2814,19 +2971,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;
@@ -2848,7 +3011,7 @@ glfs_fremovexattr (struct glfs_fd *glfd, const char *name)
goto out;
}
- ret = syncop_fremovexattr (subvol, fd, name);
+ ret = syncop_fremovexattr_with_xdata (subvol, fd, name, dict);
out:
if (fd)
fd_unref (fd);
@@ -2858,6 +3021,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)
@@ -3100,7 +3268,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 0f996d3a2..6a60557ff 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -270,7 +270,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;
@@ -279,7 +279,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;
}
@@ -330,7 +330,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);
out:
loc_wipe (&loc);
@@ -352,9 +352,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;
@@ -362,12 +369,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;
}
@@ -389,14 +394,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;
@@ -464,20 +461,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;
}
@@ -499,14 +510,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;
@@ -552,20 +555,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;
}
@@ -587,14 +606,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;
@@ -638,8 +649,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;
@@ -675,12 +704,12 @@ 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);
if (ret != 0) {
goto out;
}
} else {
- ret = syncop_rmdir (subvol, &loc, 0);
+ ret = syncop_rmdir_with_xdata (subvol, &loc, 0, dict);
if (ret != 0) {
goto out;
}
@@ -700,8 +729,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;
@@ -754,7 +789,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);
out:
loc_wipe (&loc);
@@ -775,6 +810,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)
@@ -951,21 +992,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;
}
@@ -987,14 +1026,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;
@@ -1044,6 +1075,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)
@@ -1101,8 +1149,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;
@@ -1165,7 +1213,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);
if (ret == 0)
/* TODO: No iatt to pass as there has been no lookup */
@@ -1186,8 +1234,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;
@@ -1255,7 +1309,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);
if (ret == 0)
inode_rename (oldloc.parent->table, oldloc.parent, oldloc.name,
@@ -1276,3 +1330,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 bc26618c4..548268fd6 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;
@@ -122,10 +143,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;
/* Operations enabling opaque invariant handle to object transitions */
ssize_t glfs_h_extract_handle (struct glfs_object *object,
@@ -136,11 +163,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 20fb18c9e..d79385792 100644
--- a/api/src/glfs.h
+++ b/api/src/glfs.h
@@ -354,8 +354,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;
@@ -389,10 +392,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,
@@ -404,6 +410,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,
@@ -424,29 +432,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;
@@ -454,22 +475,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;
@@ -532,6 +566,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;
@@ -540,21 +577,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;
@@ -578,6 +628,20 @@ 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);
+
+
+
+
/*
* @cmd and @flock are as specified in man fcntl(2).
*/