diff options
Diffstat (limited to 'xlators/performance/quick-read/src/quick-read.c')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 00d5e2643ab..f8bed732647 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -550,10 +550,11 @@ static int32_t qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct stat *buf) { - qr_file_t *qr_file = NULL; - qr_local_t *local = NULL; - uint64_t value = 0; - int32_t ret = 0; + qr_file_t *qr_file = NULL; + qr_local_t *local = NULL; + uint64_t value = 0; + int32_t ret = 0; + call_stub_t *stub = NULL; local = frame->local; if ((local == NULL) || ((local->fd) == NULL)) { @@ -593,11 +594,11 @@ qr_validate_cache_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } UNLOCK (&qr_file->lock); - frame->local = NULL; + local->just_validated = 1; + stub = local->stub; + local->stub = NULL; + call_resume (stub); - call_resume (local->stub); - - FREE (local); return 0; unwind: @@ -773,6 +774,8 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, off_t start = 0, end = 0; size_t len = 0; struct iobuf_pool *iobuf_pool = NULL; + qr_local_t *local = NULL; + char just_validated = 0; op_ret = 0; conf = this->private; @@ -787,6 +790,13 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, } } + local = frame->local; + if (local != NULL) { + frame->local = NULL; + just_validated = local->just_validated; + FREE (local); + } + iobuf_pool = this->ctx->iobuf_pool; ret = inode_ctx_get (fd->inode, this, &value); @@ -796,7 +806,8 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, LOCK (&file->lock); { if (file->xattr){ - if (qr_need_validation (conf,file)) { + if (!just_validated && + qr_need_validation (conf,file)) { need_validation = 1; goto unlock; } |