summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/protocol/client/src/client-helpers.c10
-rw-r--r--xlators/protocol/client/src/client-rpc-fops.c37
-rw-r--r--xlators/protocol/client/src/client-rpc-fops_v2.c9
3 files changed, 24 insertions, 32 deletions
diff --git a/xlators/protocol/client/src/client-helpers.c b/xlators/protocol/client/src/client-helpers.c
index 75cfd55..ddb8879 100644
--- a/xlators/protocol/client/src/client-helpers.c
+++ b/xlators/protocol/client/src/client-helpers.c
@@ -1268,15 +1268,14 @@ client_handle_fop_requirements (xlator_t *this, call_frame_t *frame,
}
}
- iobref_add (*rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
if (*rsp_count + 1 >= MAX_IOVEC) {
op_errno = ENOMEM;
goto out;
}
rsp_vector[*rsp_count].iov_base = iobuf_ptr (rsp_iobuf);
rsp_vector[*rsp_count].iov_len = iobuf_pagesize (rsp_iobuf);
+ iobref_add (*rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
if (args->size > rsp_vector[*rsp_count].iov_len) {
gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
@@ -2371,15 +2370,14 @@ client_handle_fop_requirements_v2 (xlator_t *this, call_frame_t *frame,
}
}
- iobref_add (*rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
if (*rsp_count + 1 >= MAX_IOVEC) {
op_errno = ENOMEM;
goto out;
}
rsp_vector[*rsp_count].iov_base = iobuf_ptr (rsp_iobuf);
rsp_vector[*rsp_count].iov_len = iobuf_pagesize (rsp_iobuf);
+ iobref_add (*rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
if (args->size > rsp_vector[*rsp_count].iov_len) {
gf_msg (this->name, GF_LOG_WARNING, ENOMEM,
diff --git a/xlators/protocol/client/src/client-rpc-fops.c b/xlators/protocol/client/src/client-rpc-fops.c
index cf2d913d..5c5a96d 100644
--- a/xlators/protocol/client/src/client-rpc-fops.c
+++ b/xlators/protocol/client/src/client-rpc-fops.c
@@ -3456,13 +3456,13 @@ client3_3_readlink (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
@@ -4029,12 +4029,11 @@ client3_3_readv (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsp_vec.iov_base = iobuf_ptr (rsp_iobuf);
rsp_vec.iov_len = iobuf_pagesize (rsp_iobuf);
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
if (args->size > rsp_vec.iov_len) {
@@ -4555,14 +4554,13 @@ client3_3_fgetxattr (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);;
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
@@ -4650,14 +4648,13 @@ client3_3_getxattr (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
@@ -4771,14 +4768,13 @@ client3_3_xattrop (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
@@ -4872,13 +4868,13 @@ client3_3_fxattrop (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
@@ -5485,14 +5481,13 @@ client3_3_readdirp (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
}
@@ -5884,12 +5879,12 @@ client3_3_compound (call_frame_t *frame, xlator_t *this, void *data)
goto unwind;
}
- iobref_add (rsphdr_iobref, rsphdr_iobuf);
- iobuf_unref (rsphdr_iobuf);
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsphdr_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsphdr_iobuf);
rsphdr_count = 1;
+ iobref_add (rsphdr_iobref, rsphdr_iobuf);
+ iobuf_unref (rsphdr_iobuf);
rsphdr_iobuf = NULL;
req.compound_fop_enum = c_args->fop_enum;
diff --git a/xlators/protocol/client/src/client-rpc-fops_v2.c b/xlators/protocol/client/src/client-rpc-fops_v2.c
index 3573192..dc5b8d4 100644
--- a/xlators/protocol/client/src/client-rpc-fops_v2.c
+++ b/xlators/protocol/client/src/client-rpc-fops_v2.c
@@ -4960,14 +4960,13 @@ client4_0_readdirp (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- iobref_add (rsp_iobref, rsp_iobuf);
- iobuf_unref (rsp_iobuf);
-
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
local->iobref = rsp_iobref;
+ iobref_add (rsp_iobref, rsp_iobuf);
+ iobuf_unref (rsp_iobuf);
rsp_iobuf = NULL;
rsp_iobref = NULL;
}
@@ -5952,12 +5951,12 @@ client4_0_compound (call_frame_t *frame, xlator_t *this, void *data)
goto unwind;
}
- iobref_add (rsphdr_iobref, rsphdr_iobuf);
- iobuf_unref (rsphdr_iobuf);
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsphdr_iobuf);
rsphdr->iov_len = iobuf_pagesize (rsphdr_iobuf);
rsphdr_count = 1;
+ iobref_add (rsphdr_iobref, rsphdr_iobuf);
+ iobuf_unref (rsphdr_iobuf);
rsphdr_iobuf = NULL;
req.compound_fop_enum = c_args->fop_enum;