summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/syncop.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r--libglusterfs/src/syncop.c233
1 files changed, 216 insertions, 17 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c
index 1f36e5776..a4a5596c3 100644
--- a/libglusterfs/src/syncop.c
+++ b/libglusterfs/src/syncop.c
@@ -1159,6 +1159,22 @@ syncop_opendir (xlator_t *subvol,
}
int
+syncop_opendir_with_xdata (xlator_t *subvol,
+ loc_t *loc,
+ fd_t *fd,
+ dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_opendir_cbk, subvol->fops->opendir,
+ loc, fd, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+
+}
+
+int
syncop_fsyncdir_cbk (call_frame_t *frame, void* cookie, xlator_t *this,
int op_ret, int op_errno, dict_t *xdata)
{
@@ -1205,10 +1221,16 @@ syncop_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
syncop_removexattr (xlator_t *subvol, loc_t *loc, const char *name)
{
+ return(syncop_removexattr_with_xdata(subvol, loc, name, NULL));
+}
+
+int
+syncop_removexattr_with_xdata (xlator_t *subvol, loc_t *loc, const char *name, dict_t *dict)
+{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_removexattr_cbk, subvol->fops->removexattr,
- loc, name, NULL);
+ loc, name, dict);
errno = args.op_errno;
return args.op_ret;
@@ -1243,6 +1265,17 @@ syncop_fremovexattr (xlator_t *subvol, fd_t *fd, const char *name)
}
int
+syncop_fremovexattr_with_xdata (xlator_t *subvol, fd_t *fd, const char *name, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_fremovexattr_cbk,
+ subvol->fops->fremovexattr, fd, name, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+}
+int
syncop_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, dict_t *xdata)
{
@@ -1258,14 +1291,19 @@ syncop_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
}
-
int
syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags)
{
+ return (syncop_setxattr_with_xdata(subvol, loc, dict, flags, NULL));
+}
+
+int
+syncop_setxattr_with_xdata (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags, dict_t *extra)
+{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_setxattr_cbk, subvol->fops->setxattr,
- loc, dict, flags, NULL);
+ loc, dict, flags, extra);
errno = args.op_errno;
return args.op_ret;
@@ -1301,6 +1339,18 @@ syncop_fsetxattr (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags)
}
int
+syncop_fsetxattr_with_xdata (xlator_t *subvol, fd_t *fd, dict_t *dict, int32_t flags, dict_t *extra)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_fsetxattr_cbk, subvol->fops->fsetxattr,
+ fd, dict, flags, extra);
+
+ errno = args.op_errno;
+ return args.op_ret;
+}
+
+int
syncop_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, dict_t *dict, dict_t *xdata)
{
@@ -1353,12 +1403,12 @@ syncop_getxattr (xlator_t *subvol, loc_t *loc, dict_t **dict, const char *key)
}
int
-syncop_fgetxattr (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key)
+syncop_fgetxattr_with_xdata (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key, dict_t *extra)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_getxattr_cbk, subvol->fops->fgetxattr,
- fd, key, NULL);
+ fd, key, extra);
if (dict)
*dict = args.xattr;
@@ -1370,6 +1420,12 @@ syncop_fgetxattr (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key)
}
int
+syncop_fgetxattr (xlator_t *subvol, fd_t *fd, dict_t **dict, const char *key)
+{
+ return(syncop_fgetxattr_with_xdata(subvol, fd, dict, key, NULL));
+}
+
+int
syncop_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct statvfs *buf, dict_t *xdata)
@@ -1432,13 +1488,13 @@ syncop_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
-syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
- struct iatt *preop, struct iatt *postop)
+syncop_setattr_with_xdata (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
+ struct iatt *preop, struct iatt *postop, dict_t *dict)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_setattr_cbk, subvol->fops->setattr,
- loc, iatt, valid, NULL);
+ loc, iatt, valid, dict);
if (preop)
*preop = args.iatt1;
@@ -1449,15 +1505,21 @@ syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
return args.op_ret;
}
+int
+syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid,
+ struct iatt *preop, struct iatt *postop)
+{
+ return(syncop_setattr_with_xdata(subvol, loc, iatt, valid, preop, postop, NULL));
+}
int
-syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
- struct iatt *preop, struct iatt *postop)
+syncop_fsetattr_with_xdata (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
+ struct iatt *preop, struct iatt *postop, dict_t *dict)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_setattr_cbk, subvol->fops->fsetattr,
- fd, iatt, valid, NULL);
+ fd, iatt, valid, dict);
if (preop)
*preop = args.iatt1;
@@ -1468,6 +1530,12 @@ syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
return args.op_ret;
}
+int
+syncop_fsetattr (xlator_t *subvol, fd_t *fd, struct iatt *iatt, int valid,
+ struct iatt *preop, struct iatt *postop)
+{
+ return(syncop_fsetattr_with_xdata(subvol, fd, iatt, valid, preop, postop, NULL));
+}
int32_t
syncop_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1498,6 +1566,19 @@ syncop_open (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd)
}
+int
+syncop_open_with_xdata (xlator_t *subvol, loc_t *loc, int32_t flags, fd_t *fd, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_open_cbk, subvol->fops->open,
+ loc, flags, fd, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+
+}
+
int32_t
syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1528,14 +1609,14 @@ syncop_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
-syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
+syncop_readv_with_xdata (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
uint32_t flags, struct iovec **vector, int *count,
- struct iobref **iobref)
+ struct iobref **iobref, dict_t *dict)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_readv_cbk, subvol->fops->readv,
- fd, size, off, flags, NULL);
+ fd, size, off, flags, dict);
if (args.op_ret < 0)
goto out;
@@ -1561,6 +1642,14 @@ out:
}
int
+syncop_readv (xlator_t *subvol, fd_t *fd, size_t size, off_t off,
+ uint32_t flags, struct iovec **vector, int *count,
+ struct iobref **iobref)
+{
+ return(syncop_readv_with_xdata(subvol, fd, size, off, flags, vector, count, iobref, NULL));
+}
+
+int
syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, struct iatt *prebuf,
struct iatt *postbuf, dict_t *xdata)
@@ -1578,20 +1667,28 @@ syncop_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
int
-syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
+syncop_writev_with_xdata (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
int32_t count, off_t offset, struct iobref *iobref,
- uint32_t flags)
+ uint32_t flags, dict_t *dict)
{
struct syncargs args = {0, };
SYNCOP (subvol, (&args), syncop_writev_cbk, subvol->fops->writev,
fd, (struct iovec *) vector, count, offset, flags, iobref,
- NULL);
+ dict);
errno = args.op_errno;
return args.op_ret;
}
+int
+syncop_writev (xlator_t *subvol, fd_t *fd, const struct iovec *vector,
+ int32_t count, off_t offset, struct iobref *iobref,
+ uint32_t flags)
+{
+ return(syncop_writev_with_xdata(subvol, fd, vector, count, offset, iobref, flags, NULL));
+}
+
int syncop_write (xlator_t *subvol, fd_t *fd, const char *buf, int size,
off_t offset, struct iobref *iobref, uint32_t flags)
{
@@ -1685,6 +1782,18 @@ syncop_unlink (xlator_t *subvol, loc_t *loc)
}
int
+syncop_unlink_with_xdata (xlator_t *subvol, loc_t *loc, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_unlink_cbk, subvol->fops->unlink, loc,
+ 0, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+}
+
+int
syncop_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int op_ret, int op_errno, struct iatt *preparent,
struct iatt *postparent, dict_t *xdata)
@@ -1715,6 +1824,18 @@ syncop_rmdir (xlator_t *subvol, loc_t *loc, int flags)
int
+syncop_rmdir_with_xdata (xlator_t *subvol, loc_t *loc, int flags, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_rmdir_cbk, subvol->fops->rmdir, loc,
+ flags, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+}
+
+int
syncop_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, inode_t *inode,
struct iatt *buf, struct iatt *preparent,
@@ -1746,6 +1867,18 @@ syncop_link (xlator_t *subvol, loc_t *oldloc, loc_t *newloc)
return args.op_ret;
}
+int
+syncop_link_with_xdata (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_link_cbk, subvol->fops->link,
+ oldloc, newloc, dict);
+
+ errno = args.op_errno;
+
+ return args.op_ret;
+}
int
syncop_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1780,6 +1913,19 @@ syncop_rename (xlator_t *subvol, loc_t *oldloc, loc_t *newloc)
return args.op_ret;
}
+int
+syncop_rename_with_xdata (xlator_t *subvol, loc_t *oldloc, loc_t *newloc, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_rename_cbk, subvol->fops->rename,
+ oldloc, newloc, dict);
+
+ errno = args.op_errno;
+
+ return args.op_ret;
+}
+
int
syncop_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1811,6 +1957,18 @@ syncop_ftruncate (xlator_t *subvol, fd_t *fd, off_t offset)
}
int
+syncop_ftruncate_with_xdata (xlator_t *subvol, fd_t *fd, off_t offset, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_ftruncate_cbk, subvol->fops->ftruncate,
+ fd, offset, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+}
+
+int
syncop_truncate (xlator_t *subvol, loc_t *loc, off_t offset)
{
struct syncargs args = {0, };
@@ -1853,6 +2011,19 @@ syncop_fsync (xlator_t *subvol, fd_t *fd, int dataonly)
}
+int
+syncop_fsync_with_xdata (xlator_t *subvol, fd_t *fd, int dataonly, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_fsync_cbk, subvol->fops->fsync,
+ fd, dataonly, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+
+}
+
int
syncop_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
@@ -1885,6 +2056,19 @@ syncop_flush (xlator_t *subvol, fd_t *fd)
}
int
+syncop_flush_with_xdata (xlator_t *subvol, fd_t *fd, dict_t *dict)
+{
+ struct syncargs args = {0};
+
+ SYNCOP (subvol, (&args), syncop_flush_cbk, subvol->fops->flush,
+ fd, dict);
+
+ errno = args.op_errno;
+ return args.op_ret;
+
+}
+
+int
syncop_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, struct iatt *stbuf, dict_t *xdata)
{
@@ -1918,6 +2102,21 @@ syncop_fstat (xlator_t *subvol, fd_t *fd, struct iatt *stbuf)
return args.op_ret;
}
+int
+syncop_fstat_with_xdata (xlator_t *subvol, fd_t *fd, struct iatt *stbuf, dict_t *dict)
+{
+ struct syncargs args = {0, };
+
+ SYNCOP (subvol, (&args), syncop_fstat_cbk, subvol->fops->fstat,
+ fd, dict);
+
+ if (stbuf)
+ *stbuf = args.iatt1;
+
+ errno = args.op_errno;
+ return args.op_ret;
+
+}
int
syncop_stat (xlator_t *subvol, loc_t *loc, struct iatt *stbuf)