diff options
author | Anuradha Talur <atalur@redhat.com> | 2016-02-05 10:45:37 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-04-09 11:44:24 -0700 |
commit | 5ff451beecaf564b4f854b10e63a307e40660c8c (patch) | |
tree | 066fa26ce9e424d469f2483295c1fe6e05da562e /libglusterfs/src/default-args.c | |
parent | be99ddd842025e0cd1a84076ee199cd4554a4575 (diff) |
libglusterfs: Refactor packing of arguments
Added these changes so that they can be re-used to pack
arguments required for each fop while populating the
compound fop structure used by each xlator.
Change-Id: Id9923e10003adafbc16a8bf3fbefa30677847313
BUG: 1303829
Signed-off-by: Anuradha Talur <atalur@redhat.com>
Reviewed-on: http://review.gluster.org/13360
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Reviewed-by: Ashish Pandey <aspandey@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src/default-args.c')
-rw-r--r-- | libglusterfs/src/default-args.c | 624 |
1 files changed, 624 insertions, 0 deletions
diff --git a/libglusterfs/src/default-args.c b/libglusterfs/src/default-args.c index 3563332e827..cc9da678dda 100644 --- a/libglusterfs/src/default-args.c +++ b/libglusterfs/src/default-args.c @@ -17,6 +17,17 @@ #include "defaults.h" int +args_lookup_store (default_args_t *args, loc_t *loc, + dict_t *xdata) +{ + loc_copy (&args->loc, loc); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_lookup_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, @@ -38,6 +49,16 @@ args_lookup_cbk_store (default_args_cbk_t *args, int +args_stat_store (default_args_t *args, loc_t *loc, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_stat_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) @@ -53,6 +74,17 @@ args_stat_cbk_store (default_args_cbk_t *args, } int +args_fstat_store (default_args_t *args, fd_t *fd, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_fstat_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *buf, dict_t *xdata) @@ -68,6 +100,18 @@ args_fstat_cbk_store (default_args_cbk_t *args, } int +args_truncate_store (default_args_t *args, loc_t *loc, off_t off, + dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->offset = off; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_truncate_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) @@ -84,6 +128,19 @@ args_truncate_cbk_store (default_args_cbk_t *args, return 0; } +int +args_ftruncate_store (default_args_t *args, fd_t *fd, off_t off, + dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + args->offset = off; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} int args_ftruncate_cbk_store (default_args_cbk_t *args, @@ -104,6 +161,18 @@ args_ftruncate_cbk_store (default_args_cbk_t *args, int +args_access_store (default_args_t *args, loc_t *loc, int32_t mask, + dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->mask = mask; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_access_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -117,6 +186,18 @@ args_access_cbk_store (default_args_cbk_t *args, int +args_readlink_store (default_args_t *args, loc_t *loc, size_t size, + dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->size = size; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_readlink_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, const char *path, struct iatt *stbuf, dict_t *xdata) @@ -134,6 +215,20 @@ args_readlink_cbk_store (default_args_cbk_t *args, } int +args_mknod_store (default_args_t *args, loc_t *loc, mode_t mode, + dev_t rdev, mode_t umask, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->mode = mode; + args->rdev = rdev; + args->umask = umask; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_mknod_cbk_store (default_args_cbk_t *args, int op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent, @@ -156,6 +251,20 @@ args_mknod_cbk_store (default_args_cbk_t *args, int op_ret, } int +args_mkdir_store (default_args_t *args, loc_t *loc, mode_t mode, + mode_t umask, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->mode = mode; + args->umask = umask; + + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_mkdir_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, struct iatt *preparent, @@ -178,6 +287,17 @@ args_mkdir_cbk_store (default_args_cbk_t *args, } int +args_unlink_store (default_args_t *args, loc_t *loc, int xflag, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->xflag = xflag; + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_unlink_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, @@ -196,6 +316,16 @@ args_unlink_cbk_store (default_args_cbk_t *args, } int +args_rmdir_store (default_args_t *args, loc_t *loc, int flags, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->flags = flags; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_rmdir_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *preparent, struct iatt *postparent, @@ -214,6 +344,19 @@ args_rmdir_cbk_store (default_args_cbk_t *args, } int +args_symlink_store (default_args_t *args, const char *linkname, loc_t *loc, + mode_t umask, dict_t *xdata) +{ + args->linkname = gf_strdup (linkname); + args->umask = umask; + loc_copy (&args->loc, loc); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_symlink_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, @@ -238,6 +381,18 @@ args_symlink_cbk_store (default_args_cbk_t *args, int +args_rename_store (default_args_t *args, loc_t *oldloc, loc_t *newloc, + dict_t *xdata) +{ + loc_copy (&args->loc, oldloc); + loc_copy (&args->loc2, newloc); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_rename_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, @@ -263,6 +418,19 @@ args_rename_cbk_store (default_args_cbk_t *args, } int +args_link_store (default_args_t *args, loc_t *oldloc, loc_t *newloc, + dict_t *xdata) +{ + loc_copy (&args->loc, oldloc); + loc_copy (&args->loc2, newloc); + + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_link_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, @@ -286,6 +454,22 @@ args_link_cbk_store (default_args_cbk_t *args, } int +args_create_store (default_args_t *args, + loc_t *loc, int32_t flags, mode_t mode, + mode_t umask, fd_t *fd, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->flags = flags; + args->mode = mode; + args->umask = umask; + if (fd) + args->fd = fd_ref (fd); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_create_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode, struct iatt *buf, @@ -311,6 +495,20 @@ args_create_cbk_store (default_args_cbk_t *args, } int +args_open_store (default_args_t *args, loc_t *loc, int32_t flags, + fd_t *fd, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->flags = flags; + if (fd) + args->fd = fd_ref (fd); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_open_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) @@ -326,6 +524,22 @@ args_open_cbk_store (default_args_cbk_t *args, } int +args_readv_store (default_args_t *args, fd_t *fd, size_t size, off_t off, + uint32_t flags, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + args->size = size; + args->offset = off; + args->flags = flags; + + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_readv_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, @@ -346,6 +560,23 @@ args_readv_cbk_store (default_args_cbk_t *args, } int +args_writev_store (default_args_t *args, fd_t *fd, struct iovec *vector, + int32_t count, off_t off, uint32_t flags, + struct iobref *iobref, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + args->vector = iov_dup (vector, count); + args->count = count; + args->offset = off; + args->flags = flags; + args->iobref = iobref_ref (iobref); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_writev_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, dict_t *xdata) @@ -362,6 +593,15 @@ args_writev_cbk_store (default_args_cbk_t *args, return 0; } +int +args_flush_store (default_args_t *args, fd_t *fd, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} int args_flush_cbk_store (default_args_cbk_t *args, @@ -375,6 +615,17 @@ args_flush_cbk_store (default_args_cbk_t *args, return 0; } +int +args_fsync_store (default_args_t *args, fd_t *fd, int32_t datasync, + dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + args->datasync = datasync; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} int args_fsync_cbk_store (default_args_cbk_t *args, @@ -394,6 +645,18 @@ args_fsync_cbk_store (default_args_cbk_t *args, } int +args_opendir_store (default_args_t *args, loc_t *loc, fd_t *fd, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + if (fd) + args->fd = fd_ref (fd); + if (xdata) + args->xdata = dict_ref (xdata); + + return 0; +} + +int args_opendir_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata) @@ -409,6 +672,17 @@ args_opendir_cbk_store (default_args_cbk_t *args, } int +args_fsyncdir_store (default_args_t *args, fd_t *fd, int32_t datasync, + dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + args->datasync = datasync; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} +int args_fsyncdir_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -421,6 +695,15 @@ args_fsyncdir_cbk_store (default_args_cbk_t *args, } int +args_statfs_store (default_args_t *args, loc_t *loc, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_statfs_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct statvfs *buf, dict_t *xdata) @@ -436,6 +719,21 @@ args_statfs_cbk_store (default_args_cbk_t *args, } int +args_setxattr_store (default_args_t *args, + loc_t *loc, dict_t *dict, + int32_t flags, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + /* TODO */ + if (dict) + args->xattr = dict_ref (dict); + args->flags = flags; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_setxattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) @@ -449,6 +747,19 @@ args_setxattr_cbk_store (default_args_cbk_t *args, } int +args_getxattr_store (default_args_t *args, + loc_t *loc, const char *name, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + + if (name) + args->name = gf_strdup (name); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_getxattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) @@ -464,6 +775,20 @@ args_getxattr_cbk_store (default_args_cbk_t *args, } int +args_fsetxattr_store (default_args_t *args, + fd_t *fd, dict_t *dict, int32_t flags, dict_t *xdata) +{ + args->fd = fd_ref (fd); + + if (dict) + args->xattr = dict_ref (dict); + args->flags = flags; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fsetxattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -476,6 +801,19 @@ args_fsetxattr_cbk_store (default_args_cbk_t *args, } int +args_fgetxattr_store (default_args_t *args, + fd_t *fd, const char *name, dict_t *xdata) +{ + args->fd = fd_ref (fd); + + if (name) + args->name = gf_strdup (name); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fgetxattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) @@ -491,6 +829,17 @@ args_fgetxattr_cbk_store (default_args_cbk_t *args, } int +args_removexattr_store (default_args_t *args, + loc_t *loc, const char *name, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + args->name = gf_strdup (name); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_removexattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -503,6 +852,17 @@ args_removexattr_cbk_store (default_args_cbk_t *args, } int +args_fremovexattr_store (default_args_t *args, + fd_t *fd, const char *name, dict_t *xdata) +{ + args->fd = fd_ref (fd); + args->name = gf_strdup (name); + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fremovexattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -515,6 +875,20 @@ args_fremovexattr_cbk_store (default_args_cbk_t *args, } int +args_lk_store (default_args_t *args, + fd_t *fd, int32_t cmd, + struct gf_flock *lock, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + args->cmd = cmd; + args->lock = *lock; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_lk_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct gf_flock *lock, dict_t *xdata) @@ -531,6 +905,22 @@ args_lk_cbk_store (default_args_cbk_t *args, int +args_inodelk_store (default_args_t *args, + const char *volume, loc_t *loc, int32_t cmd, + struct gf_flock *lock, dict_t *xdata) +{ + if (volume) + args->volume = gf_strdup (volume); + + loc_copy (&args->loc, loc); + args->cmd = cmd; + args->lock = *lock; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_inodelk_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -543,6 +933,25 @@ args_inodelk_cbk_store (default_args_cbk_t *args, } int +args_finodelk_store (default_args_t *args, + const char *volume, fd_t *fd, int32_t cmd, + struct gf_flock *lock, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + if (volume) + args->volume = gf_strdup (volume); + + args->cmd = cmd; + args->lock = *lock; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_finodelk_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -555,6 +964,27 @@ args_finodelk_cbk_store (default_args_cbk_t *args, } int +args_entrylk_store (default_args_t *args, + const char *volume, loc_t *loc, const char *name, + entrylk_cmd cmd, entrylk_type type, dict_t *xdata) +{ + if (volume) + args->volume = gf_strdup (volume); + + loc_copy (&args->loc, loc); + + args->entrylkcmd = cmd; + args->entrylktype = type; + + if (name) + args->name = gf_strdup (name); + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_entrylk_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -567,6 +997,26 @@ args_entrylk_cbk_store (default_args_cbk_t *args, } int +args_fentrylk_store (default_args_t *args, + const char *volume, fd_t *fd, const char *name, + entrylk_cmd cmd, entrylk_type type, dict_t *xdata) +{ + if (volume) + args->volume = gf_strdup (volume); + + if (fd) + args->fd = fd_ref (fd); + args->entrylkcmd = cmd; + args->entrylktype = type; + if (name) + args->name = gf_strdup (name); + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fentrylk_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -580,6 +1030,18 @@ args_fentrylk_cbk_store (default_args_cbk_t *args, int +args_readdirp_store (default_args_t *args, + fd_t *fd, size_t size, off_t off, dict_t *xdata) +{ + args->fd = fd_ref (fd); + args->size = size; + args->offset = off; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_readdirp_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) @@ -613,6 +1075,20 @@ out: int +args_readdir_store (default_args_t *args, + fd_t *fd, size_t size, + off_t off, dict_t *xdata) +{ + args->fd = fd_ref (fd); + args->size = size; + args->offset = off; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_readdir_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries, dict_t *xdata) @@ -641,6 +1117,18 @@ out: int +args_rchecksum_store (default_args_t *args, + fd_t *fd, off_t offset, int32_t len, dict_t *xdata) +{ + args->fd = fd_ref (fd); + args->offset = offset; + args->size = len; + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_rchecksum_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum, @@ -660,6 +1148,21 @@ args_rchecksum_cbk_store (default_args_cbk_t *args, return 0; } +int +args_xattrop_store (default_args_t *args, + loc_t *loc, gf_xattrop_flags_t optype, + dict_t *xattr, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + + args->optype = optype; + args->xattr = dict_ref (xattr); + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + int args_xattrop_cbk_store (default_args_cbk_t *args, int32_t op_ret, @@ -677,6 +1180,21 @@ args_xattrop_cbk_store (default_args_cbk_t *args, int32_t op_ret, int +args_fxattrop_store (default_args_t *args, + fd_t *fd, gf_xattrop_flags_t optype, + dict_t *xattr, dict_t *xdata) +{ + args->fd = fd_ref (fd); + + args->optype = optype; + args->xattr = dict_ref (xattr); + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fxattrop_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xattr, dict_t *xdata) @@ -692,6 +1210,23 @@ args_fxattrop_cbk_store (default_args_cbk_t *args, } int +args_setattr_store (default_args_t *args, + loc_t *loc, struct iatt *stbuf, + int32_t valid, dict_t *xdata) +{ + loc_copy (&args->loc, loc); + + if (stbuf) + args->stat = *stbuf; + + args->valid = valid; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_setattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, @@ -711,6 +1246,23 @@ args_setattr_cbk_store (default_args_cbk_t *args, int +args_fsetattr_store (default_args_t *args, + fd_t *fd, struct iatt *stbuf, + int32_t valid, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + if (stbuf) + args->stat = *stbuf; + + args->valid = valid; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} +int args_fsetattr_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, @@ -729,6 +1281,22 @@ args_fsetattr_cbk_store (default_args_cbk_t *args, } int +args_fallocate_store (default_args_t *args, fd_t *fd, + int32_t mode, off_t offset, size_t len, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + args->flags = mode; + args->offset = offset; + args->size = len; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_fallocate_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, @@ -747,6 +1315,21 @@ args_fallocate_cbk_store(default_args_cbk_t *args, } int +args_discard_store (default_args_t *args, fd_t *fd, + off_t offset, size_t len, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + args->offset = offset; + args->size = len; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_discard_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, @@ -765,6 +1348,21 @@ args_discard_cbk_store(default_args_cbk_t *args, } int +args_zerofill_store (default_args_t *args, fd_t *fd, + off_t offset, off_t len, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + args->offset = offset; + args->size = len; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_zerofill_cbk_store(default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, struct iatt *statpre, struct iatt *statpost, @@ -783,6 +1381,17 @@ args_zerofill_cbk_store(default_args_cbk_t *args, } int +args_ipc_store (default_args_t *args, + int32_t op, dict_t *xdata) +{ + args->cmd = op; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_ipc_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, dict_t *xdata) { @@ -795,6 +1404,21 @@ args_ipc_cbk_store (default_args_cbk_t *args, } int +args_seek_store (default_args_t *args, fd_t *fd, + off_t offset, gf_seek_what_t what, dict_t *xdata) +{ + if (fd) + args->fd = fd_ref (fd); + + args->offset = offset; + args->what = what; + + if (xdata) + args->xdata = dict_ref (xdata); + return 0; +} + +int args_seek_cbk_store (default_args_cbk_t *args, int32_t op_ret, int32_t op_errno, off_t offset, dict_t *xdata) { |