summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/quota/src/quota.c10
-rw-r--r--xlators/features/shard/src/shard.c10
2 files changed, 5 insertions, 15 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 1335386a19..c787028e7b 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -1769,19 +1769,13 @@ quota_writev_helper(call_frame_t *frame, xlator_t *this, fd_t *fd,
if ((op_errno == EDQUOT) && (local->space_available > 0)) {
new_count = iov_subset(vector, count, 0, local->space_available,
- NULL);
-
- new_vector = GF_CALLOC(new_count, sizeof(struct iovec),
- gf_common_mt_iovec);
- if (new_vector == NULL) {
+ &new_vector, 0);
+ if (new_count < 0) {
local->op_ret = -1;
local->op_errno = ENOMEM;
goto unwind;
}
- new_count = iov_subset(vector, count, 0, local->space_available,
- new_vector);
-
vector = new_vector;
count = new_count;
} else if (op_errno == ENOENT || op_errno == ESTALE) {
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index b6908c39ef..6e78e96721 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -5476,21 +5476,17 @@ shard_common_inode_write_do(call_frame_t *frame, xlator_t *this)
remaining_size -= shard_write_size;
if (local->fop == GF_FOP_WRITE) {
+ vec = NULL;
count = iov_subset(local->vector, local->count, vec_offset,
- vec_offset + shard_write_size, NULL);
-
- vec = GF_CALLOC(count, sizeof(struct iovec), gf_shard_mt_iovec);
- if (!vec) {
+ shard_write_size, &vec, 0);
+ if (count < 0) {
local->op_ret = -1;
local->op_errno = ENOMEM;
wind_failed = _gf_true;
- GF_FREE(vec);
shard_common_inode_write_do_cbk(frame, (void *)(long)0, this,
-1, ENOMEM, NULL, NULL, NULL);
goto next;
}
- count = iov_subset(local->vector, local->count, vec_offset,
- vec_offset + shard_write_size, vec);
}
if (cur_block == 0) {