summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/quick-read/src/quick-read.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index b8b4c532674..0e4ce71a571 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -545,8 +545,6 @@ qr_readv_cached (call_frame_t *frame, qr_inode_t *qr_inode, size_t size,
LOCK (&table->lock);
{
- op_ret = -1;
-
if (!qr_inode->data)
goto unlock;
@@ -582,19 +580,16 @@ qr_readv_cached (call_frame_t *frame, qr_inode_t *qr_inode, size_t size,
unlock:
UNLOCK (&table->lock);
- if (op_ret > 0) {
+ if (op_ret >= 0) {
iov.iov_base = iobuf->ptr;
iov.iov_len = op_ret;
STACK_UNWIND_STRICT (readv, frame, op_ret, 0, &iov, 1,
&buf, iobref, xdata);
}
+ iobuf_unref (iobuf);
- if (iobuf)
- iobuf_unref (iobuf);
-
- if (iobref)
- iobref_unref (iobref);
+ iobref_unref (iobref);
return op_ret;
}