MCPcopy Create free account
hub / github.com/apache/trafficserver / TSAIOWrite

Function TSAIOWrite

src/api/InkAPI.cc:6928–6951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6926}
6927
6928TSReturnCode
6929TSAIOWrite(int fd, off_t offset, char *buf, const size_t bufSize, TSCont contp)
6930{
6931 sdk_assert(sdk_sanity_check_iocore_structure(contp) == TS_SUCCESS);
6932
6933 Continuation *pCont = reinterpret_cast<Continuation *>(contp);
6934 AIOCallback *pAIO = new_AIOCallback();
6935
6936 // TODO: Might be able to remove this when allocations can never fail.
6937 sdk_assert(sdk_sanity_check_null_ptr((void *)pAIO) == TS_SUCCESS);
6938
6939 pAIO->aiocb.aio_fildes = fd;
6940 pAIO->aiocb.aio_offset = offset;
6941 pAIO->aiocb.aio_buf = buf;
6942 pAIO->aiocb.aio_nbytes = bufSize;
6943 pAIO->action = pCont;
6944 pAIO->thread = pCont->mutex->thread_holding;
6945
6946 if (ink_aio_write(pAIO, 1) == 1) {
6947 return TS_SUCCESS;
6948 }
6949
6950 return TS_ERROR;
6951}
6952
6953TSReturnCode
6954TSAIOThreadNumSet(int thread_num)

Callers 1

write_to_disk_no_lockMethod · 0.85

Calls 4

new_AIOCallbackFunction · 0.85
ink_aio_writeFunction · 0.85

Tested by

no test coverage detected