summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src/shard.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-06-03 04:22:27 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-06-06 08:12:55 -0700
commit04b5fcb82e90250cdeaa6f0e1e4c4debdeb0e3fa (patch)
treed44d378cc865e4187fbaa61483cf42767581e7ce /xlators/features/shard/src/shard.c
parent66cc92c25ec2680e50a6b3edda2e027635c380db (diff)
features/shard: Don't modify readv size
For o-direct reads application sends aligned size which needs to be sent as is, otherwise o-direct writes where the file-size is not aligned fails. Change-Id: I097418ad92eda6c835d7352a3d2e53ea9d8e2424 BUG: 1342298 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/14623 CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/shard/src/shard.c')
-rw-r--r--xlators/features/shard/src/shard.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 0967f734ea1..af2bdfbd6da 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -3317,8 +3317,6 @@ int
shard_post_lookup_readv_handler (call_frame_t *frame, xlator_t *this)
{
int ret = 0;
- size_t read_size = 0;
- size_t actual_size = 0;
struct iobuf *iobuf = NULL;
shard_local_t *local = NULL;
shard_priv_t *priv = NULL;
@@ -3353,21 +3351,10 @@ shard_post_lookup_readv_handler (call_frame_t *frame, xlator_t *this)
return 0;
}
- read_size = (local->offset + local->req_size);
- actual_size = local->prebuf.ia_size;
-
local->first_block = get_lowest_block (local->offset,
local->block_size);
- /* If the end of read surpasses the file size, only resolve and read
- * till the end of the file size. If the read is confined within the
- * size of the file, read only the requested size.
- */
-
- if (read_size >= actual_size)
- local->total_size = actual_size - local->offset;
- else
- local->total_size = local->req_size;
+ local->total_size = local->req_size;
local->last_block = get_highest_block (local->offset, local->total_size,
local->block_size);