summaryrefslogtreecommitdiffstats
path: root/api/src/glfs-fops.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs-fops.c')
-rw-r--r--api/src/glfs-fops.c365
1 files changed, 266 insertions, 99 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)
{