summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/shard/src')
-rw-r--r--xlators/features/shard/src/shard.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 930624b3cc8..f5275a3fb58 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -3101,6 +3101,7 @@ shard_readv_do_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
struct iovec vec = {0,};
shard_local_t *local = NULL;
fd_t *anon_fd = cookie;
+ shard_inode_ctx_t *ctx = NULL;
local = frame->local;
@@ -3119,7 +3120,8 @@ shard_readv_do_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (local->op_ret >= 0)
local->op_ret += op_ret;
- fd_ctx_get (anon_fd, this, &block_num);
+ shard_inode_ctx_get (anon_fd->inode, this, &ctx);
+ block_num = ctx->block_num;
if (block_num == local->first_block) {
address = local->iobuf->ptr;
@@ -3172,7 +3174,6 @@ int
shard_readv_do (call_frame_t *frame, xlator_t *this)
{
int i = 0;
- int ret = 0;
int call_count = 0;
int last_block = 0;
int cur_block = 0;
@@ -3229,22 +3230,6 @@ shard_readv_do (call_frame_t *frame, xlator_t *this)
}
}
- ret = fd_ctx_set (anon_fd, this, cur_block);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- SHARD_MSG_FD_CTX_SET_FAILED,
- "Failed to set fd ctx for block %d, gfid=%s",
- cur_block,
- uuid_utoa (local->inode_list[i]->gfid));
- local->op_ret = -1;
- local->op_errno = ENOMEM;
- wind_failed = _gf_true;
- shard_readv_do_cbk (frame, (void *) (long) anon_fd,
- this, -1, ENOMEM, NULL, 0, NULL,
- NULL, NULL);
- goto next;
- }
-
STACK_WIND_COOKIE (frame, shard_readv_do_cbk, anon_fd,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->readv, anon_fd,