diff options
Diffstat (limited to 'libglusterfs/src/syncop.c')
-rw-r--r-- | libglusterfs/src/syncop.c | 233 |
1 files changed, 216 insertions, 17 deletions
diff --git a/libglusterfs/src/syncop.c b/libglusterfs/src/syncop.c index efcd9c5f3..219fbc842 100644 --- a/libglusterfs/src/syncop.c +++ b/libglusterfs/src/syncop.c @@ -1163,6 +1163,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) { @@ -1210,10 +1226,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); if (args.op_ret < 0) return -args.op_errno; @@ -1250,6 +1272,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) { @@ -1265,14 +1298,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); if (args.op_ret < 0) return -args.op_errno; @@ -1310,6 +1348,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) { @@ -1364,12 +1414,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; @@ -1382,6 +1432,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) @@ -1445,13 +1501,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; @@ -1463,15 +1519,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; @@ -1483,6 +1545,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, @@ -1514,6 +1582,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, @@ -1544,14 +1625,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; @@ -1578,6 +1659,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) @@ -1595,21 +1684,29 @@ 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); if (args.op_ret < 0) return -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) { @@ -1706,6 +1803,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) @@ -1737,6 +1846,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, @@ -1769,6 +1890,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, @@ -1804,6 +1937,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, @@ -1836,6 +1982,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, }; @@ -1880,6 +2038,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, @@ -1913,6 +2084,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) { @@ -1947,6 +2131,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) |