• Home
  • Raw
  • Download

Lines Matching +full:async +full:- +full:io

21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
38 * program and only a io type field value would have to change to
39 * do different types of io. There is even a couple of functions that
45 * Functions declared in this module - see individual function code for
124 #if 0 /* disabled until it's needed -- roehrich 6/11/97 */
139 "async i/o using a loop to wait for a signal"},
140 {"b", LIO_IO_ASYNC | LIO_WAIT_SIGPAUSE, "async i/o using pause"},
142 "async i/o using recall/aio_suspend"},
160 "single stride async listio using recall"},
162 "single stride async listio using pause"},
172 {"async", LIO_IO_ASYNC, "async i/o (reada/writea/aio_read/aio_write)"},
174 {"alistio", LIO_IO_ALISTIO, "single stride async listio"},
183 /* { "nowait", LIO_WAIT_NONE, "do not wait for async io to complete" },*/
209 * Returns -1 on error - the only possible error conditions are illegal values
210 * for nstrides and/or bytes_per_stride - both parameters must be >= 0.
225 return -1; in stride_bounds()
238 nbytes = abs(stride) * (nstrides - 1) + bytes_per_stride; in stride_bounds()
241 max_byte = offset + bytes_per_stride - 1; in stride_bounds()
242 min_byte = max_byte - nbytes + 1; in stride_bounds()
245 max_byte = min_byte + nbytes - 1; in stride_bounds()
272 * This function will parse a string and return desired io-method.
299 return -1; in lio_parse_io_arg1()
326 * This function will parse a string and return the desired io-method.
327 * This function will take a comma separated list of io type and wait
347 return -1; in lio_parse_io_arg2()
386 return (-1); in lio_parse_io_arg2()
456 * This function will randomly choose an io type and wait method
457 * from set of io types and wait methods. Since this information
458 * is stored in a bitmask, it randomly chooses an io type from
459 * the io type bits specified and does the same for wait methods.
462 * This function will return a value with all non choosen io type
472 /* remove random select, io type, and wait method bits from curr_mask */ in lio_random_methods()
475 /* randomly select io type from specified io types */ in lio_random_methods()
500 * that will be used. If no io type bits are set, write will be used.
502 * If async io was attempted and no wait method bits are set then the
514 * choose a io type and wait method from bits in the method argument.
522 * If a system call fails, -errno is returned.
525 * If the io did not fail, the amount of data written is returned.
534 int method, /* contains io type and wait method bitmask */ in lio_write_buffer()
536 int size, /* the size of the io */ in lio_write_buffer()
537 int sig, /* signal to use if async io */ in lio_write_buffer()
546 char *io_type; /* Holds string of type of io */ in lio_write_buffer()
606 /* aiocbp.aio_offset = lseek( fd, 0, SEEK_CUR ); -- set below */ in lio_write_buffer()
618 if ((ret = lseek(fd, 0, SEEK_CUR)) == -1) { in lio_write_buffer()
646 return -errno; in lio_write_buffer()
735 if (((ret = write(fd, buffer, size)) == -1) in lio_write_buffer()
738 "%s/%d write(%d, buf, %d) ret:-1, errno=%d %s", in lio_write_buffer()
741 return -errno; in lio_write_buffer()
744 if (ret != -1) { in lio_write_buffer()
750 size -= ret; in lio_write_buffer()
779 if ((ret = writea(fd, buffer, size, &status, sig)) == -1) { in lio_write_buffer()
781 "%s/%d writea(%d, buf, %d, &stat, %d) ret:-1, errno=%d %s", in lio_write_buffer()
785 return -errno; in lio_write_buffer()
801 if ((ret = aio_write(&aiocbp)) == -1) { in lio_write_buffer()
803 "%s/%d aio_write(fildes=%d, buf, nbytes=%d, signo=%d) ret:-1, errno=%d %s", in lio_write_buffer()
808 return -errno; in lio_write_buffer()
838 if (listio(listio_cmd, &request, 1) == -1) { in lio_write_buffer()
844 return -errno; in lio_write_buffer()
848 printf("DEBUG %s/%d: %s did not return -1\n", in lio_write_buffer()
872 if (lio_listio(listio_cmd, aiolist, 1, NULL) == -1) { in lio_write_buffer()
879 return -errno; in lio_write_buffer()
883 printf("DEBUG %s/%d: %s did not return -1\n", in lio_write_buffer()
904 io_type = "listio(2) async write"; in lio_write_buffer()
916 if (listio(listio_cmd, &request, 1) == -1) { in lio_write_buffer()
922 return -errno; in lio_write_buffer()
928 io_type = "lio_listio(3) async write"; in lio_write_buffer()
941 if (lio_listio(listio_cmd, aiolist, 1, NULL) == -1) { in lio_write_buffer()
948 return -errno; in lio_write_buffer()
963 if ((ret = writev(fd, &iov, 1)) == -1) { in lio_write_buffer()
965 "%s/%d writev(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s", in lio_write_buffer()
968 return -errno; in lio_write_buffer()
996 if ((ret = pwrite(fd, buffer, size, poffset)) == -1) { in lio_write_buffer()
998 "%s/%d pwrite(%d, buf, %d, %lld) ret:-1, errno=%d %s", in lio_write_buffer()
1001 return -errno; in lio_write_buffer()
1021 return -1; in lio_write_buffer()
1025 * wait for async io to complete. in lio_write_buffer()
1035 * If there was an error waiting for async i/o to complete, in lio_write_buffer()
1051 * check that async io was successful. in lio_write_buffer()
1052 * Note: if the there was an system call failure, -errno in lio_write_buffer()
1075 * that will be used. If no io type bits are set, read will be used.
1077 * If async io was attempted and no wait method bits are set then the
1089 * choose a io type and wait method from bits in the method argument.
1097 * If a system call fails, -errno is returned.
1100 * If the io did not fail, the amount of data written is returned.
1109 int method, /* contains io type and wait method bitmask*/ in lio_read_buffer()
1111 int size, /* the size of the io */ in lio_read_buffer()
1112 int sig, /* signal to use if async io */ in lio_read_buffer()
1121 char *io_type; /* Holds string of type of io */ in lio_read_buffer()
1182 /* aiocbp.aio_offset = lseek( fd, 0, SEEK_CUR ); -- set below */ in lio_read_buffer()
1194 if ((ret = lseek(fd, 0, SEEK_CUR)) == -1) { in lio_read_buffer()
1222 return -errno; in lio_read_buffer()
1313 if (((ret = read(fd, buffer, size)) == -1) in lio_read_buffer()
1316 "%s/%d read(%d, buf, %d) ret:-1, errno=%d %s", in lio_read_buffer()
1319 return -errno; in lio_read_buffer()
1324 if (ret != -1) { in lio_read_buffer()
1330 size -= ret; in lio_read_buffer()
1359 if ((ret = reada(fd, buffer, size, &status, sig)) == -1) { in lio_read_buffer()
1361 "%s/%d reada(%d, buf, %d, &stat, %d) ret:-1, errno=%d %s", in lio_read_buffer()
1365 return -errno; in lio_read_buffer()
1381 if ((ret = aio_read(&aiocbp)) == -1) { in lio_read_buffer()
1383 "%s/%d aio_read(fildes=%d, buf, nbytes=%d, signo=%d) ret:-1, errno=%d %s", in lio_read_buffer()
1388 return -errno; in lio_read_buffer()
1418 if (listio(listio_cmd, &request, 1) == -1) { in lio_read_buffer()
1424 return -errno; in lio_read_buffer()
1428 printf("DEBUG %s/%d: %s did not return -1\n", in lio_read_buffer()
1450 if (lio_listio(listio_cmd, aiolist, 1, NULL) == -1) { in lio_read_buffer()
1457 return -errno; in lio_read_buffer()
1461 printf("DEBUG %s/%d: %s did not return -1\n", in lio_read_buffer()
1482 io_type = "listio(2) async read"; in lio_read_buffer()
1494 if (listio(listio_cmd, &request, 1) == -1) { in lio_read_buffer()
1500 return -errno; in lio_read_buffer()
1506 io_type = "lio_listio(3) async read"; in lio_read_buffer()
1519 if (lio_listio(listio_cmd, aiolist, 1, NULL) == -1) { in lio_read_buffer()
1526 return -errno; in lio_read_buffer()
1541 if ((ret = readv(fd, &iov, 1)) == -1) { in lio_read_buffer()
1543 "%s/%d readv(%d, iov, 1) nbyte:%d ret:-1, errno=%d %s", in lio_read_buffer()
1546 return -errno; in lio_read_buffer()
1574 if ((ret = pread(fd, buffer, size, poffset)) == -1) { in lio_read_buffer()
1576 "%s/%d pread(%d, buf, %d, %lld) ret:-1, errno=%d %s", in lio_read_buffer()
1579 return -errno; in lio_read_buffer()
1599 return -1; in lio_read_buffer()
1603 * wait for async io to complete. in lio_read_buffer()
1604 * Note: Sync io should have returned prior to getting here. in lio_read_buffer()
1614 * If there was an error waiting for async i/o to complete, in lio_read_buffer()
1630 * check that async io was successful. in lio_read_buffer()
1631 * Note: if the there was an system call failure, -errno in lio_read_buffer()
1649 * This function will check that async io was successful.
1654 * If status.sw_error is set, -status.sw_error is returned.
1669 if (status->sw_error) {
1673 status->sw_error, strerror(status->sw_error),
1674 status->sw_count);
1675 return -status->sw_error;
1676 } else if (status->sw_count != size) {
1679 __FILE__, __LINE__, io_type, size, status->sw_count);
1683 __FILE__, __LINE__, io_type, status->sw_count);
1686 return status->sw_count;
1697 if (aiocbp->aio_sigevent.sigev_notify == SIGEV_SIGNAL)
1698 sigrelse(aiocbp->aio_sigevent.sigev_signo);
1710 (aiocbp->aio_sigevent.sigev_notify ==
1711 SIGEV_SIGNAL ? "signal" : aiocbp->aio_sigevent.
1714 aiocbp->aio_sigevent.sigev_notify ==
1717 aiocbp->aio_sigevent.sigev_notify ==
1719 return -ret;
1727 return -ret;
1760 * This function will wait for async io to complete.
1771 * 0 : async io was completed
1772 * 1 : async was not waited for, io may not have completed.
1812 return -errno;
1819 (aiocbp->aio_sigevent.sigev_notify ==
1820 SIGEV_SIGNAL ? "signal" : aiocbp->aio_sigevent.
1823 aiocbp->aio_sigevent.sigev_notify ==
1826 aiocbp->aio_sigevent.sigev_notify ==
1831 if ((ret == -1) && (errno == EINTR)) {
1832 if (aiocbp->aio_sigevent.sigev_notify == SIGEV_SIGNAL) {
1835 ("DEBUG %s/%d: aio_suspend received EINTR, sigev_notify=SIGEV_SIGNAL -- ok\n",
1842 (aiocbp->aio_sigevent.sigev_notify ==
1843 SIGEV_SIGNAL ? "signal" : aiocbp->
1847 aiocbp->aio_sigevent.sigev_notify ==
1850 aiocbp->aio_sigevent.sigev_notify ==
1852 return -errno;
1858 return -errno;
1870 * change to non-zero.
1873 while ((*statptr)->sw_flag == 0 &&
1874 (*statptr)->sw_count == 0 && (*statptr)->sw_error == 0) {
1898 /* note: don't do the sigon() for CRAY in this case. why? -- roehrich 6/11/97 */
1899 if (aiocbp->aio_sigevent.sigev_notify == SIGEV_SIGNAL)
1900 sigrelse(aiocbp->aio_sigevent.sigev_signo);
1904 return -1;
1916 if (aiocbp->aio_sigevent.sigev_notify == SIGEV_SIGNAL)
1917 sigrelse(aiocbp->aio_sigevent.sigev_signo);
1921 return -1;
1929 sigrelse(aiocbp->aio_sigevent.sigev_signo);
1940 * It doesn't cause a problem on unicos--probably because of some
1941 * compiler quirk, or an accident. It causes POSIX async I/O
1951 return -1;
1956 return -1;
1969 * Just define add "-DUNIT_TEST=1" to the cc line.
1979 LIO_IO_SYNC, 0, "sync io"}, {
1982 LIO_IO_ASYNC, 0, "async io, def wait"}, {
1984 LIO_IO_ALISTIO, 0, "async listio, def wait"}, {
1985 LIO_IO_ASYNC | LIO_WAIT_ACTIVE, 0, "async active"}, {
1986 LIO_IO_ASYNC | LIO_WAIT_RECALL, 0, "async recall/suspend"}, {
1987 LIO_IO_ASYNC | LIO_WAIT_SIGPAUSE, SIGUSR1, "async sigpause"}, {
1988 LIO_IO_ASYNC | LIO_WAIT_SIGACTIVE, SIGUSR1, "async sigactive"}, {
1989 LIO_IO_ALISTIO | LIO_WAIT_ACTIVE, 0, "async listio active"}, {
1990 LIO_IO_ALISTIO | LIO_WAIT_RECALL, 0, "async listio recall"}, {
1991 LIO_IO_ALISTIO | LIO_WAIT_SIGACTIVE, SIGUSR1, "async listio sigactive"},
1993 LIO_IO_ALISTIO | LIO_WAIT_SIGPAUSE, SIGUSR1, "async listio sigpause"},
1995 LIO_IO_ASYNC, SIGUSR2, "async io, def wait, sigusr2"}, {
1996 LIO_IO_ALISTIO, SIGUSR2, "async listio, def wait, sigusr2"},};
2019 while ((c = getopt(argc, argv, "s:di:")) != -1) {
2034 open("unit_test_file", O_CREAT | O_RDWR | O_TRUNC, 0777)) == -1) {
2043 if ((method = lio_parse_io_arg2(symbols, &err)) == -1) {
2056 if (lseek(fd, 0, 0) == -1) {
2065 ("lio_write_buffer returned -1, err = %s\n",
2071 if (lseek(fd, 0, 0) == -1) {
2080 ("lio_read_buffer returned -1, err = %s\n",
2108 if (lseek(fd, 0, 0) == -1) {
2119 (">>>>> lio_write_buffer(fd,0%x,buffer,%d,%d,err,0) returned -1,\n err = %s\n",
2131 if (lseek(fd, 0, 0) == -1) {
2141 (">>>>> lio_read_buffer(fd,0%x,buffer,%d,%d,err,0) returned -1,\n err = %s\n",