summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix-aio.c')
-rw-r--r--xlators/storage/posix/src/posix-aio.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c
index f807618ce..c3bbddd67 100644
--- a/xlators/storage/posix/src/posix-aio.c
+++ b/xlators/storage/posix/src/posix-aio.c
@@ -136,11 +136,7 @@ posix_aio_readv_complete (struct posix_aio_cb *paiocb, int res, int res2)
/* Hack to notify higher layers of EOF. */
- if (postbuf.ia_size == 0)
- op_errno = ENOENT;
- else if ((offset + iov.iov_len) == postbuf.ia_size)
- op_errno = ENOENT;
- else if (offset > postbuf.ia_size)
+ if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size)
op_errno = ENOENT;
LOCK (&priv->lock);
@@ -490,8 +486,8 @@ posix_aio_init (xlator_t *this)
goto out;
}
- ret = pthread_create (&priv->aiothread, NULL,
- posix_aio_thread, this);
+ ret = gf_thread_create (&priv->aiothread, NULL,
+ posix_aio_thread, this);
if (ret != 0) {
io_destroy (priv->ctxp);
goto out;
@@ -566,7 +562,7 @@ __posix_fd_set_odirect (fd_t *fd, struct posix_fd *pfd, int opflags,
{
xlator_t *this = THIS;
gf_log (this->name, GF_LOG_INFO,
- "Linux AIO not availble at build-time."
+ "Linux AIO not available at build-time."
" Continuing with synchronous IO");
return;
}