From 9d3af972f516b6ba38d2736ce2016e34a452d569 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 20 Mar 2012 17:22:24 +0530 Subject: core: adding extra data for fops with this change, the xlator APIs will have a dictionary as extra argument, which is passed between all the layers. This can be utilized for overloading in some of the operations. Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40 Signed-off-by: Amar Tumballi BUG: 782265 Reviewed-on: http://review.gluster.com/2960 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/performance/quick-read/src/quick-read.c | 328 ++++++++++++------------ 1 file changed, 170 insertions(+), 158 deletions(-) (limited to 'xlators/performance/quick-read') diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 56f665f675b..fed81446029 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -48,7 +48,7 @@ out: int32_t qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, - off_t offset, uint32_t flags); + off_t offset, uint32_t flags, dict_t *xdata); static void @@ -301,7 +301,7 @@ out: int32_t qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, - struct iatt *buf, dict_t *dict, struct iatt *postparent) + struct iatt *buf, dict_t *xdata, struct iatt *postparent) { data_t *content = NULL; qr_inode_t *qr_inode = NULL; @@ -314,7 +314,7 @@ qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, GF_ASSERT (frame); - if ((op_ret == -1) || (dict == NULL)) { + if ((op_ret == -1) || (xdata == NULL)) { goto out; } @@ -349,7 +349,7 @@ qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } - content = dict_get (dict, GF_CONTENT_KEY); + content = dict_get (xdata, GF_CONTENT_KEY); if (content == NULL) { goto out; } @@ -397,7 +397,7 @@ qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, table->cache_used -= qr_inode->stbuf.ia_size; } - qr_inode->xattr = dict_ref (dict); + qr_inode->xattr = dict_ref (xdata); qr_inode->stbuf = *buf; table->cache_used += buf->ia_size; @@ -414,7 +414,7 @@ out: * FIXME: content size in dict can be greater than the size application * requested for. Applications need to be careful till this is fixed. */ - QR_STACK_UNWIND (lookup, frame, op_ret, op_errno, inode, buf, dict, + QR_STACK_UNWIND (lookup, frame, op_ret, op_errno, inode, buf, xdata, postparent); return 0; @@ -422,7 +422,8 @@ out: int32_t -qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) +qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, + dict_t *xdata) { qr_conf_t *conf = NULL; dict_t *new_req_dict = NULL; @@ -473,9 +474,9 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) } UNLOCK (&table->lock); - if ((xattr_req == NULL) && (conf->max_file_size > 0)) { - new_req_dict = xattr_req = dict_new (); - if (xattr_req == NULL) { + if ((xdata == NULL) && (conf->max_file_size > 0)) { + new_req_dict = xdata = dict_new (); + if (xdata == NULL) { op_ret = -1; op_errno = ENOMEM; goto unwind; @@ -483,8 +484,8 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) } if (!cached) { - if (xattr_req) { - content = dict_get (xattr_req, GF_CONTENT_KEY); + if (xdata) { + content = dict_get (xdata, GF_CONTENT_KEY); if (content) { requested_size = data_to_uint64 (content); } @@ -495,7 +496,7 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) size = (conf->max_file_size > requested_size) ? conf->max_file_size : requested_size; - op_ret = dict_set (xattr_req, GF_CONTENT_KEY, + op_ret = dict_set (xdata, GF_CONTENT_KEY, data_from_uint64 (size)); if (op_ret < 0) { op_ret = -1; @@ -510,7 +511,7 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) } STACK_WIND (frame, qr_lookup_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->lookup, loc, xattr_req); + FIRST_CHILD(this)->fops->lookup, loc, xdata); if (new_req_dict) { dict_unref (new_req_dict); @@ -519,8 +520,8 @@ qr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req) return 0; unwind: - QR_STACK_UNWIND (lookup, frame, op_ret, op_errno, NULL, NULL, NULL, - NULL); + QR_STACK_UNWIND (lookup, frame, op_ret, op_errno, NULL, NULL, + NULL, NULL); if (new_req_dict) { dict_unref (new_req_dict); @@ -532,7 +533,7 @@ unwind: int32_t qr_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, fd_t *fd) + int32_t op_errno, fd_t *fd, dict_t *xdata) { uint64_t value = 0; int32_t ret = -1; @@ -618,7 +619,7 @@ qr_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, } out: if (is_open) { - QR_STACK_UNWIND (open, frame, op_ret, op_errno, fd); + QR_STACK_UNWIND (open, frame, op_ret, op_errno, fd, xdata); } else { STACK_DESTROY (frame->root); } @@ -629,7 +630,7 @@ out: int32_t qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - fd_t *fd, int32_t wbflags) + fd_t *fd, dict_t *xdata) { qr_inode_t *qr_inode = NULL; int32_t ret = -1; @@ -668,7 +669,6 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, } qr_fd_ctx->flags = flags; - qr_fd_ctx->wbflags = wbflags; ret = fd_ctx_set (fd, this, (uint64_t)(long)qr_fd_ctx); if (ret == -1) { @@ -717,8 +717,7 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, if (!content_cached || ((flags & O_ACCMODE) == O_WRONLY) || ((flags & O_TRUNC) == O_TRUNC) - || ((flags & O_DIRECT) == O_DIRECT) - || ((wbflags & GF_OPEN_NOWB) != 0)) { + || ((flags & O_DIRECT) == O_DIRECT)) { LOCK (&qr_fd_ctx->lock); { /* @@ -727,8 +726,7 @@ qr_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, */ qr_fd_ctx->open_in_transit = 1; - if (((flags & O_DIRECT) == O_DIRECT) - || ((wbflags & GF_OPEN_NOWB)) != 0) { + if ((flags & O_DIRECT) == O_DIRECT) { qr_fd_ctx->disabled = 1; } } @@ -745,12 +743,13 @@ unwind: qr_fd_ctx_free (tmp_fd_ctx); } - QR_STACK_UNWIND (open, frame, op_ret, op_errno, fd); + QR_STACK_UNWIND (open, frame, op_ret, op_errno, fd, NULL); return 0; wind: STACK_WIND (frame, qr_open_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->open, loc, flags, fd, wbflags); + FIRST_CHILD(this)->fops->open, loc, flags, fd, + xdata); return 0; } @@ -791,7 +790,8 @@ out: static int32_t qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct iatt *buf) + int32_t op_ret, int32_t op_errno, struct iatt *buf, + dict_t *xdata) { qr_inode_t *qr_inode = NULL; qr_local_t *local = NULL; @@ -858,13 +858,15 @@ qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, unwind: /* this is actually unwind of readv */ - QR_STACK_UNWIND (readv, frame, op_ret, op_errno, NULL, -1, NULL, NULL); + QR_STACK_UNWIND (readv, frame, op_ret, op_errno, NULL, -1, NULL, NULL, + NULL); return 0; } int32_t -qr_validate_cache_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) +qr_validate_cache_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, + dict_t *xdata) { qr_local_t *local = NULL; int32_t op_ret = -1, op_errno = -1; @@ -884,10 +886,10 @@ qr_validate_cache_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) out: if (op_ret == -1) { qr_validate_cache_cbk (frame, NULL, this, op_ret, op_errno, - NULL); + NULL, NULL); } else { STACK_WIND (frame, qr_validate_cache_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fstat, fd); + FIRST_CHILD (this)->fops->fstat, fd, xdata); } return 0; @@ -949,7 +951,7 @@ qr_validate_cache (call_frame_t *frame, xlator_t *this, fd_t *fd, } else { validate_stub = fop_fstat_stub (frame, qr_validate_cache_helper, - fd); + fd, NULL); if (validate_stub == NULL) { ret = -1; if (need_open) { @@ -990,12 +992,12 @@ qr_validate_cache (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, - &loc, flags, fd, qr_fd_ctx->wbflags); + &loc, flags, fd, NULL); qr_loc_wipe (&loc); } else if (can_wind) { STACK_WIND (frame, qr_validate_cache_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fstat, fd); + FIRST_CHILD (this)->fops->fstat, fd, NULL); } ret = 0; @@ -1005,7 +1007,7 @@ out: call_stub_destroy (stub); } - qr_validate_cache_cbk (frame, NULL, this, -1, errno, NULL); + qr_validate_cache_cbk (frame, NULL, this, -1, errno, NULL, NULL); } return ret; } @@ -1014,19 +1016,19 @@ out: int32_t qr_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, - struct iatt *stbuf, struct iobref *iobref) + struct iatt *stbuf, struct iobref *iobref, dict_t *xdata) { GF_ASSERT (frame); QR_STACK_UNWIND (readv, frame, op_ret, op_errno, vector, count, - stbuf, iobref); + stbuf, iobref, xdata); return 0; } int32_t qr_readv_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, - off_t offset, uint32_t flags) + off_t offset, uint32_t flags, dict_t *xdata) { qr_local_t *local = NULL; int32_t op_errno = EINVAL, ret = 0; @@ -1055,18 +1057,19 @@ qr_readv_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } STACK_WIND (frame, qr_readv_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->readv, fd, size, offset, flags); + FIRST_CHILD (this)->fops->readv, fd, size, offset, flags, + xdata); return 0; unwind: - QR_STACK_UNWIND (readv, frame, -1, op_errno, NULL, 0, NULL, NULL); + QR_STACK_UNWIND (readv, frame, -1, op_errno, NULL, 0, NULL, NULL, NULL); return 0; } int32_t qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, - off_t offset, uint32_t read_flags) + off_t offset, uint32_t read_flags, dict_t *xdata) { qr_inode_t *qr_inode = NULL; int32_t ret = -1, op_ret = -1, op_errno = -1; @@ -1216,11 +1219,11 @@ unlock: out: if (content_cached || need_unwind) { QR_STACK_UNWIND (readv, frame, op_ret, op_errno, vector, - count, &stbuf, iobref); + count, &stbuf, iobref, NULL); } else if (need_validation) { stub = fop_readv_stub (frame, qr_readv, fd, size, offset, - read_flags); + read_flags, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1259,7 +1262,7 @@ out: qr_readv_helper, fd, size, offset, - read_flags); + read_flags, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1299,13 +1302,13 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, - &loc, flags, fd, qr_fd_ctx->wbflags); + &loc, flags, fd, NULL); qr_loc_wipe (&loc); } else if (can_wind) { STACK_WIND (frame, qr_readv_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->readv, fd, size, - offset, read_flags); + offset, read_flags, xdata); } } @@ -1325,10 +1328,11 @@ ret: int32_t qr_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, - struct iatt *postbuf) + struct iatt *postbuf, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (writev, frame, op_ret, op_errno, prebuf, postbuf); + QR_STACK_UNWIND (writev, frame, op_ret, op_errno, prebuf, postbuf, + xdata); return 0; } @@ -1336,7 +1340,7 @@ qr_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t qr_writev_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, int32_t count, off_t off, - uint32_t flags, struct iobref *iobref) + uint32_t flags, struct iobref *iobref, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -1367,18 +1371,19 @@ qr_writev_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (frame, qr_writev_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->writev, fd, vector, count, off, - flags, iobref); + flags, iobref, xdata); return 0; unwind: - QR_STACK_UNWIND (writev, frame, -1, op_errno, NULL, NULL); + QR_STACK_UNWIND (writev, frame, -1, op_errno, NULL, NULL, NULL); return 0; } int32_t qr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, - int32_t count, off_t off, uint32_t wr_flags, struct iobref *iobref) + int32_t count, off_t off, uint32_t wr_flags, struct iobref *iobref, + dict_t *xdata) { uint64_t value = 0; int flags = 0; @@ -1441,7 +1446,7 @@ qr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, stub = fop_writev_stub (frame, qr_writev_helper, fd, vector, count, off, - wr_flags, iobref); + wr_flags, iobref, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1461,11 +1466,11 @@ qr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, } if (need_unwind) { - QR_STACK_UNWIND (writev, frame, op_ret, op_errno, NULL, NULL); + QR_STACK_UNWIND (writev, frame, op_ret, op_errno, NULL, NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_writev_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->writev, fd, vector, count, - off, wr_flags, iobref); + off, wr_flags, iobref, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -1482,7 +1487,7 @@ qr_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector, STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -1494,15 +1499,15 @@ ret: int32_t qr_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *buf) + int32_t op_errno, struct iatt *buf, dict_t *xdata) { - QR_STACK_UNWIND (fstat, frame, op_ret, op_errno, buf); + QR_STACK_UNWIND (fstat, frame, op_ret, op_errno, buf, xdata); return 0; } int32_t -qr_fstat_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) +qr_fstat_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -1532,17 +1537,17 @@ qr_fstat_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) } STACK_WIND (frame, qr_fstat_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fstat, fd); + FIRST_CHILD (this)->fops->fstat, fd, xdata); return 0; unwind: - QR_STACK_UNWIND (fstat, frame, -1, op_errno, NULL); + QR_STACK_UNWIND (fstat, frame, -1, op_errno, NULL, NULL); return 0; } int32_t -qr_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) +qr_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { qr_fd_ctx_t *qr_fd_ctx = NULL; char need_open = 0, can_wind = 0, need_unwind = 0; @@ -1593,7 +1598,7 @@ qr_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) } stub = fop_fstat_stub (frame, qr_fstat_helper, - fd); + fd, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1614,10 +1619,10 @@ qr_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) unwind: if (need_unwind) { - QR_STACK_UNWIND (fstat, frame, op_ret, op_errno, NULL); + QR_STACK_UNWIND (fstat, frame, op_ret, op_errno, NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_fstat_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fstat, fd); + FIRST_CHILD (this)->fops->fstat, fd, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -1634,7 +1639,7 @@ unwind: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -1647,17 +1652,18 @@ ret: int32_t qr_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct iatt *preop, struct iatt *postop) + struct iatt *preop, struct iatt *postop, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (fsetattr, frame, op_ret, op_errno, preop, postop); + QR_STACK_UNWIND (fsetattr, frame, op_ret, op_errno, preop, postop, + xdata); return 0; } int32_t qr_fsetattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, - struct iatt *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -1689,18 +1695,18 @@ qr_fsetattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (frame, qr_fsetattr_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fsetattr, fd, stbuf, - valid); + valid, xdata); return 0; unwind: - QR_STACK_UNWIND (fsetattr, frame, -1, op_errno, NULL, NULL); + QR_STACK_UNWIND (fsetattr, frame, -1, op_errno, NULL, NULL, NULL); return 0; } int32_t qr_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, - struct iatt *stbuf, int32_t valid) + struct iatt *stbuf, int32_t valid, dict_t *xdata) { uint64_t value = 0; int flags = 0; @@ -1751,7 +1757,7 @@ qr_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, stub = fop_fsetattr_stub (frame, qr_fsetattr_helper, - fd, stbuf, valid); + fd, stbuf, valid, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1772,11 +1778,12 @@ qr_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, out: if (need_unwind) { - QR_STACK_UNWIND (fsetattr, frame, op_ret, op_errno, NULL, NULL); + QR_STACK_UNWIND (fsetattr, frame, op_ret, op_errno, NULL, NULL, + NULL); } else if (can_wind) { STACK_WIND (frame, qr_fsetattr_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->fsetattr, fd, stbuf, - valid); + valid, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -1793,7 +1800,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -1805,17 +1812,17 @@ ret: int32_t qr_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno) + int32_t op_ret, int32_t op_errno, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (fsetxattr, frame, op_ret, op_errno); + QR_STACK_UNWIND (fsetxattr, frame, op_ret, op_errno, xdata); return 0; } int32_t qr_fsetxattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, - dict_t *dict, int32_t flags) + dict_t *dict, int32_t flags, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -1846,18 +1853,19 @@ qr_fsetxattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, } STACK_WIND (frame, qr_fsetxattr_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fsetxattr, fd, dict, flags); + FIRST_CHILD (this)->fops->fsetxattr, fd, dict, flags, + xdata); return 0; unwind: - QR_STACK_UNWIND (fsetxattr, frame, -1, op_errno); + QR_STACK_UNWIND (fsetxattr, frame, -1, op_errno, NULL); return 0; } int32_t qr_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, - int32_t flags) + int32_t flags, dict_t *xdata) { uint64_t value = 0; call_stub_t *stub = NULL; @@ -1909,7 +1917,7 @@ qr_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, stub = fop_fsetxattr_stub (frame, qr_fsetxattr_helper, - fd, dict, flags); + fd, dict, flags, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -1930,11 +1938,11 @@ qr_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict, out: if (need_unwind) { - QR_STACK_UNWIND (fsetxattr, frame, op_ret, op_errno); + QR_STACK_UNWIND (fsetxattr, frame, op_ret, op_errno, NULL); } else if (can_wind) { STACK_WIND (frame, qr_fsetxattr_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->fsetxattr, fd, dict, - flags); + flags, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -1951,7 +1959,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, open_flags, - fd, qr_fd_ctx->wbflags); + fd, NULL); qr_loc_wipe (&loc); } @@ -1963,17 +1971,17 @@ ret: int32_t qr_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, dict_t *dict) + int32_t op_ret, int32_t op_errno, dict_t *dict, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (fgetxattr, frame, op_ret, op_errno, dict); + QR_STACK_UNWIND (fgetxattr, frame, op_ret, op_errno, dict, xdata); return 0; } int32_t qr_fgetxattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, - const char *name) + const char *name, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2004,17 +2012,18 @@ qr_fgetxattr_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, } STACK_WIND (frame, qr_fgetxattr_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fgetxattr, fd, name); + FIRST_CHILD (this)->fops->fgetxattr, fd, name, xdata); return 0; unwind: - QR_STACK_UNWIND (fgetxattr, frame, -1, op_errno, NULL); + QR_STACK_UNWIND (fgetxattr, frame, -1, op_errno, NULL, NULL); return 0; } int32_t -qr_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name) +qr_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name, + dict_t *xdata) { int flags = 0; uint64_t value = 0; @@ -2071,7 +2080,7 @@ qr_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name) stub = fop_fgetxattr_stub (frame, qr_fgetxattr_helper, - fd, name); + fd, name, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2092,10 +2101,10 @@ qr_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name) out: if (need_unwind) { - QR_STACK_UNWIND (open, frame, op_ret, op_errno, NULL); + QR_STACK_UNWIND (open, frame, op_ret, op_errno, NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_fgetxattr_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fgetxattr, fd, name); + FIRST_CHILD (this)->fops->fgetxattr, fd, name, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -2112,7 +2121,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -2124,16 +2133,16 @@ ret: int32_t qr_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno) + int32_t op_errno, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (flush, frame, op_ret, op_errno); + QR_STACK_UNWIND (flush, frame, op_ret, op_errno, xdata); return 0; } int32_t -qr_flush_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) +qr_flush_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2163,17 +2172,17 @@ qr_flush_helper (call_frame_t *frame, xlator_t *this, fd_t *fd) } STACK_WIND (frame, qr_flush_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->flush, fd); + FIRST_CHILD (this)->fops->flush, fd, xdata); return 0; unwind: - QR_STACK_UNWIND (flush, frame, -1, op_errno); + QR_STACK_UNWIND (flush, frame, -1, op_errno, NULL); return 0; } int32_t -qr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) +qr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata) { uint64_t value = 0; call_stub_t *stub = NULL; @@ -2211,7 +2220,7 @@ qr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) } stub = fop_flush_stub (frame, qr_flush_helper, - fd); + fd, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2235,10 +2244,10 @@ qr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) out: if (need_unwind) { - QR_STACK_UNWIND (flush, frame, op_ret, op_errno); + QR_STACK_UNWIND (flush, frame, op_ret, op_errno, NULL); } else if (can_wind) { STACK_WIND (frame, qr_flush_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->flush, fd); + FIRST_CHILD (this)->fops->flush, fd, xdata); } return 0; @@ -2247,10 +2256,10 @@ out: int32_t qr_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno) + int32_t op_ret, int32_t op_errno, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (fentrylk, frame, op_ret, op_errno); + QR_STACK_UNWIND (fentrylk, frame, op_ret, op_errno, xdata); return 0; } @@ -2258,7 +2267,7 @@ qr_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t qr_fentrylk_helper (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd, - entrylk_type type) + entrylk_type type, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2290,18 +2299,19 @@ qr_fentrylk_helper (call_frame_t *frame, xlator_t *this, const char *volume, STACK_WIND(frame, qr_fentrylk_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fentrylk, volume, fd, basename, - cmd, type); + cmd, type, xdata); return 0; unwind: - QR_STACK_UNWIND (fentrylk, frame, -1, op_errno); + QR_STACK_UNWIND (fentrylk, frame, -1, op_errno, NULL); return 0; } int32_t qr_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, - const char *basename, entrylk_cmd cmd, entrylk_type type) + const char *basename, entrylk_cmd cmd, entrylk_type type, + dict_t *xdata) { int flags = 0; uint64_t value = 0; @@ -2353,7 +2363,7 @@ qr_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, stub = fop_fentrylk_stub (frame, qr_fentrylk_helper, volume, fd, basename, - cmd, type); + cmd, type, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2374,11 +2384,11 @@ qr_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, out: if (need_unwind) { - QR_STACK_UNWIND (fentrylk, frame, op_ret, op_errno); + QR_STACK_UNWIND (fentrylk, frame, op_ret, op_errno, NULL); } else if (can_wind) { STACK_WIND (frame, qr_fentrylk_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->fentrylk, volume, fd, - basename, cmd, type); + basename, cmd, type, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -2395,7 +2405,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -2407,18 +2417,17 @@ ret: int32_t qr_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno) - + int32_t op_ret, int32_t op_errno, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (finodelk, frame, op_ret, op_errno); + QR_STACK_UNWIND (finodelk, frame, op_ret, op_errno, xdata); return 0; } int32_t qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct gf_flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2449,18 +2458,19 @@ qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume, } STACK_WIND (frame, qr_finodelk_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->finodelk, volume, fd, cmd, lock); + FIRST_CHILD(this)->fops->finodelk, volume, fd, cmd, lock, + xdata); return 0; unwind: - QR_STACK_UNWIND (finodelk, frame, -1, op_errno); + QR_STACK_UNWIND (finodelk, frame, -1, op_errno, NULL); return 0; } int32_t qr_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, - int32_t cmd, struct gf_flock *lock) + int32_t cmd, struct gf_flock *lock, dict_t *xdata) { int flags = 0; uint64_t value = 0; @@ -2512,7 +2522,7 @@ qr_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, stub = fop_finodelk_stub (frame, qr_finodelk_helper, volume, fd, cmd, - lock); + lock, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2533,11 +2543,11 @@ qr_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, out: if (need_unwind) { - QR_STACK_UNWIND (finodelk, frame, op_ret, op_errno); + QR_STACK_UNWIND (finodelk, frame, op_ret, op_errno, NULL); } else if (can_wind) { STACK_WIND (frame, qr_finodelk_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->finodelk, volume, fd, - cmd, lock); + cmd, lock, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -2554,7 +2564,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -2566,16 +2576,18 @@ ret: int32_t qr_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf) + int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf, + dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (fsync, frame, op_ret, op_errno, prebuf, postbuf); + QR_STACK_UNWIND (fsync, frame, op_ret, op_errno, prebuf, postbuf, xdata); return 0; } int32_t -qr_fsync_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) +qr_fsync_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, + dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2605,17 +2617,18 @@ qr_fsync_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) } STACK_WIND (frame, qr_fsync_cbk, FIRST_CHILD (this), - FIRST_CHILD(this)->fops->fsync, fd, flags); + FIRST_CHILD(this)->fops->fsync, fd, flags, xdata); return 0; unwind: - QR_STACK_UNWIND (fsync, frame, -1, op_errno, NULL, NULL); + QR_STACK_UNWIND (fsync, frame, -1, op_errno, NULL, NULL, NULL); return 0; } int32_t -qr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) +qr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags, + dict_t *xdata) { uint64_t value = 0; call_stub_t *stub = NULL; @@ -2665,7 +2678,7 @@ qr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) } stub = fop_fsync_stub (frame, qr_fsync_helper, - fd, flags); + fd, flags, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2686,10 +2699,10 @@ qr_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) out: if (need_unwind) { - QR_STACK_UNWIND (fsync, frame, op_ret, op_errno, NULL, NULL); + QR_STACK_UNWIND (fsync, frame, op_ret, op_errno, NULL, NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_fsync_cbk, FIRST_CHILD (this), - FIRST_CHILD (this)->fops->fsync, fd, flags); + FIRST_CHILD (this)->fops->fsync, fd, flags, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -2706,7 +2719,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, open_flags, - fd, qr_fd_ctx->wbflags); + fd, NULL); qr_loc_wipe (&loc); } @@ -2719,7 +2732,7 @@ ret: int32_t qr_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, - struct iatt *postbuf) + struct iatt *postbuf, dict_t *xdata) { int32_t ret = 0; uint64_t value = 0; @@ -2776,14 +2789,14 @@ qr_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, out: QR_STACK_UNWIND (ftruncate, frame, op_ret, op_errno, prebuf, - postbuf); + postbuf, xdata); return 0; } int32_t qr_ftruncate_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, - off_t offset) + off_t offset, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2814,17 +2827,18 @@ qr_ftruncate_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, } STACK_WIND (frame, qr_ftruncate_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->ftruncate, fd, offset); + FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); return 0; unwind: - QR_STACK_UNWIND (ftruncate, frame, -1, op_errno, NULL, NULL); + QR_STACK_UNWIND (ftruncate, frame, -1, op_errno, NULL, NULL, NULL); return 0; } int32_t -qr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) +qr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, + dict_t *xdata) { int flags = 0; uint64_t value = 0; @@ -2879,7 +2893,7 @@ qr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) } else { stub = fop_ftruncate_stub (frame, qr_ftruncate_helper, - fd, offset); + fd, offset, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -2901,10 +2915,10 @@ qr_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) out: if (need_unwind) { QR_STACK_UNWIND (ftruncate, frame, op_ret, op_errno, NULL, - NULL); + NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_ftruncate_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->ftruncate, fd, offset); + FIRST_CHILD(this)->fops->ftruncate, fd, offset, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -2921,7 +2935,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -2933,17 +2947,17 @@ ret: int32_t qr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct gf_flock *lock) + int32_t op_errno, struct gf_flock *lock, dict_t *xdata) { GF_ASSERT (frame); - QR_STACK_UNWIND (lk, frame, op_ret, op_errno, lock); + QR_STACK_UNWIND (lk, frame, op_ret, op_errno, lock, xdata); return 0; } int32_t qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct gf_flock *lock) + struct gf_flock *lock, dict_t *xdata) { qr_local_t *local = NULL; qr_fd_ctx_t *fdctx = NULL; @@ -2973,19 +2987,19 @@ qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } STACK_WIND (frame, qr_lk_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->lk, fd, cmd, lock); + FIRST_CHILD(this)->fops->lk, fd, cmd, lock, xdata); return 0; unwind: - QR_STACK_UNWIND (lk, frame, -1, op_errno, NULL); + QR_STACK_UNWIND (lk, frame, -1, op_errno, NULL, NULL); return 0; } int32_t qr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct gf_flock *lock) + struct gf_flock *lock, dict_t *xdata) { int flags = 0; uint64_t value = 0; @@ -3036,7 +3050,7 @@ qr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, } stub = fop_lk_stub (frame, qr_lk_helper, fd, - cmd, lock); + cmd, lock, xdata); if (stub == NULL) { op_ret = -1; op_errno = ENOMEM; @@ -3057,10 +3071,10 @@ qr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, out: if (need_unwind) { - QR_STACK_UNWIND (lk, frame, op_ret, op_errno, NULL); + QR_STACK_UNWIND (lk, frame, op_ret, op_errno, NULL, NULL); } else if (can_wind) { STACK_WIND (frame, qr_lk_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->lk, fd, cmd, lock); + FIRST_CHILD(this)->fops->lk, fd, cmd, lock, xdata); } else if (need_open) { op_ret = qr_loc_fill (&loc, fd->inode, path); if (op_ret == -1) { @@ -3077,7 +3091,7 @@ out: STACK_WIND (open_frame, qr_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, &loc, flags, fd, - qr_fd_ctx->wbflags); + NULL); qr_loc_wipe (&loc); } @@ -3218,8 +3232,6 @@ qr_fdctx_dump (xlator_t *this, fd_t *fd) gf_proc_dump_write ("flags", "%d", fdctx->flags); - gf_proc_dump_write ("wbflags", "%d", fdctx->wbflags); - list_for_each_entry (stub, &fdctx->waiting_ops, list) { gf_proc_dump_build_key (key, "", "waiting-ops[%d].frame", i); -- cgit