• Home
  • Raw
  • Download

Lines Matching refs:aiocbp

38         struct aiocb *aiocbp;  in work_func()  local
44 aiocbp = gWorkQueue.back(); in work_func()
47 CHECK(aiocbp->queued); in work_func()
49 if (aiocbp->read) { in work_func()
50 ret = TEMP_FAILURE_RETRY(pread64(aiocbp->aio_fildes, in work_func()
51 aiocbp->aio_buf, aiocbp->aio_nbytes, aiocbp->aio_offset)); in work_func()
53 ret = TEMP_FAILURE_RETRY(pwrite64(aiocbp->aio_fildes, in work_func()
54 aiocbp->aio_buf, aiocbp->aio_nbytes, aiocbp->aio_offset)); in work_func()
57 std::unique_lock<std::mutex> lk(aiocbp->lock); in work_func()
58 aiocbp->ret = ret; in work_func()
59 if (aiocbp->ret == -1) { in work_func()
60 aiocbp->error = errno; in work_func()
62 aiocbp->queued = false; in work_func()
64 aiocbp->cv.notify_all(); in work_func()
68 int aio_add(struct aiocb *aiocbp) { in aio_add() argument
69 CHECK(!aiocbp->queued); in aio_add()
70 aiocbp->queued = true; in aio_add()
73 gWorkQueue.push_front(aiocbp); in aio_add()
113 int aio_read(struct aiocb *aiocbp) { in aio_read() argument
114 aiocbp->read = true; in aio_read()
115 return aio_add(aiocbp); in aio_read()
118 int aio_write(struct aiocb *aiocbp) { in aio_write() argument
119 aiocbp->read = false; in aio_write()
120 return aio_add(aiocbp); in aio_write()
123 int aio_error(const struct aiocb *aiocbp) { in aio_error() argument
124 return aiocbp->error; in aio_error()
127 ssize_t aio_return(struct aiocb *aiocbp) { in aio_return() argument
128 return aiocbp->ret; in aio_return()
131 int aio_suspend(struct aiocb *aiocbp[], int n, in aio_suspend() argument
135 std::unique_lock<std::mutex> lk(aiocbp[i]->lock); in aio_suspend()
136 aiocbp[i]->cv.wait(lk, [aiocbp, i]{return !aiocbp[i]->queued;}); in aio_suspend()
142 void aio_prepare(struct aiocb *aiocbp, void* buf, size_t count, off64_t offset) { in aio_prepare() argument
143 aiocbp->aio_buf = buf; in aio_prepare()
144 aiocbp->aio_offset = offset; in aio_prepare()
145 aiocbp->aio_nbytes = count; in aio_prepare()