summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src/shard.h
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-03-27 16:03:20 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-21 22:38:22 -0700
commitf1bdc3f186576107fda4f3665c809c791b4cbe95 (patch)
tree47437cc77521ba26f629650433a63559ac9d4ab8 /xlators/features/shard/src/shard.h
parent1fbcecb72ef3525823536b640d244d1e5127a37f (diff)
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 <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/10098 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/shard/src/shard.h')
-rw-r--r--xlators/features/shard/src/shard.h10
1 files changed, 8 insertions, 2 deletions
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;