From f1bdc3f186576107fda4f3665c809c791b4cbe95 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Fri, 27 Mar 2015 16:03:20 +0530 Subject: features/shard: Consume size and block count in metadata read ops Metadata read fops like lookup, stat etc will now fetch the xattr that holds the size and block count information, extract the size and block count fields and set them in respective stbuf before unwinding the resultant iatt to the parent xlator. Change-Id: I881be8955092fa6b75f8b0e4f3deb01344cb638e BUG: 1207603 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/10098 Reviewed-by: Pranith Kumar Karampuri Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/shard/src/shard.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/features/shard/src/shard.h') diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h index 0eeabc51f5e..14f181624f7 100644 --- a/xlators/features/shard/src/shard.h +++ b/xlators/features/shard/src/shard.h @@ -101,11 +101,13 @@ } while (0) -#define SHARD_MD_READ_FOP_INIT_REQ_DICT(this, xattr_req, gfid, label) do { \ +#define SHARD_MD_READ_FOP_INIT_REQ_DICT(this, dict, gfid, local, label) do { \ int __ret = -1; \ \ - __ret = dict_set_uint64 (xattr_req, GF_XATTR_SHARD_FILE_SIZE, 8 * 4); \ + __ret = dict_set_uint64 (dict, GF_XATTR_SHARD_FILE_SIZE, 8 * 4); \ if (__ret) { \ + local->op_ret = -1; \ + local->op_errno = ENOMEM; \ gf_log (this->name, GF_LOG_WARNING, "Failed to set dict" \ " value: key:%s for %s.", GF_XATTR_SHARD_FILE_SIZE, \ uuid_utoa (gfid)); \ @@ -126,6 +128,9 @@ typedef struct { char *domain; } shard_lock_t; +typedef int32_t (*shard_post_fop_handler_t) (call_frame_t *frame, + xlator_t *this); + typedef struct shard_local { int op_ret; int op_errno; @@ -151,6 +156,7 @@ typedef struct shard_local { struct iatt postbuf; struct iovec *vector; struct iobref *iobref; + shard_post_fop_handler_t handler; struct { int lock_count; fop_inodelk_cbk_t inodelk_cbk; -- cgit