diff options
author | praks <none@none> | 2007-11-28 10:50:43 -0800 |
---|---|---|
committer | praks <none@none> | 2007-11-28 10:50:43 -0800 |
commit | 967072a15e834441c4b221b17b3859169a2c9af2 (patch) | |
tree | 17216aa9c1f5bde0127190a23f7b6fb6fa63fccf /usr/src/lib | |
parent | e521259d04612e0de70106469fc244e2afdf5cf2 (diff) | |
download | illumos-gate-967072a15e834441c4b221b17b3859169a2c9af2.tar.gz |
6572126 aio_mutex lock is held across the system call to kaio causing poor scaling
6617953 aiowrite fails with EOVERFLOW when using SEEK_END and the file exceeds 2GB
Diffstat (limited to 'usr/src/lib')
-rw-r--r-- | usr/src/lib/libc/port/aio/aio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr/src/lib/libc/port/aio/aio.c b/usr/src/lib/libc/port/aio/aio.c index ad8b1246eb..c1f7b51875 100644 --- a/usr/src/lib/libc/port/aio/aio.c +++ b/usr/src/lib/libc/port/aio/aio.c @@ -344,7 +344,7 @@ _aiorw(int fd, caddr_t buf, int bufsz, offset_t offset, int whence, aio_req_t *reqp; aio_args_t *ap; offset_t loffset; - struct stat stat; + struct stat64 stat64; int error = 0; int kerr; int umode; @@ -361,10 +361,10 @@ _aiorw(int fd, caddr_t buf, int bufsz, offset_t offset, int whence, loffset += offset; break; case SEEK_END: - if (fstat(fd, &stat) == -1) + if (fstat64(fd, &stat64) == -1) error = -1; else - loffset = offset + stat.st_size; + loffset = offset + stat64.st_size; break; default: errno = EINVAL; @@ -396,13 +396,14 @@ _aiorw(int fd, caddr_t buf, int bufsz, offset_t offset, int whence, resultp->aio_errno = 0; sig_mutex_lock(&__aio_mutex); _kaio_outstand_cnt++; + sig_mutex_unlock(&__aio_mutex); kerr = (int)_kaio(((resultp->aio_return == AIO_INPROGRESS) ? (umode | AIO_POLL_BIT) : umode), fd, buf, bufsz, loffset, resultp); if (kerr == 0) { - sig_mutex_unlock(&__aio_mutex); return (0); } + sig_mutex_lock(&__aio_mutex); _kaio_outstand_cnt--; sig_mutex_unlock(&__aio_mutex); if (errno != ENOTSUP && errno != EBADFD) |