* The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * See the License for the specific language governing permissions * and limitations under the License. * When distributing Covered Code, include this CDDL HEADER in each * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. #
pragma ident "%Z%%M% %I% %E% SMI" * Declare structure types. The structures themselves are defined below. * list head for UFS list I/O int lio_nent;
/* Number of list I/O's */ int lio_event;
/* Event number for notification */ int lio_port;
/* Port number for notification */ int lio_signo;
/* Signal number for notification */ * Notification parameters int np_port;
/* SIGEV_THREAD or SIGEV_PORT */ int np_lio_port;
/* listio: SIGEV_THREAD or SIGEV_PORT */ * fields protected by _aio_mutex lock. * when req is on the doneq, then req_next is protected by * the _aio_mutex lock. when the req is on a work q, then * req_next is protected by a worker's work_qlock1 lock. * fields protected by a worker's work_qlock1 lock. * fields require no locking. char req_type;
/* AIO_POSIX_REQ or not */ char req_op;
/* AIOREAD, etc. */ /* special lio type that destroys itself when lio refcnt becomes zero */ /* values for aio_state */ /* use KAIO in _aio_rw() */ /* values for _aio_flags */ /* if set, _aiodone() notifies aio_waitn about done requests */ /* if set, _aiodone() wakes up functions waiting for completed I/Os */ * Before a kaio() system call, the fd will be checked * to ensure that kernel async. I/O is supported for this file. * The only way to find out is if a kaio() call returns ENOTSUP, * so the default will always be to try the kaio() call. Only in * the specific instance of a kaio() call returning ENOTSUP * will we stop submitting kaio() calls for that fd. * If the fd is outside the array bounds, we will allow the kaio() * The only way that an fd entry can go from ENOTSUP to supported * is if that fd is freed up by a close(), and close will clear * Each fd gets a bit in the array _kaio_supported[]. * uint32_t _kaio_supported[MAX_KAIO_FDARRAY_SIZE]; * Array is MAX_KAIO_ARRAY_SIZE of 32-bit elements, for 8kb. * If more than (MAX_KAIO_FDARRAY_SIZE * KAIO_FDARRAY_ELEM_SIZE) * files are open, this can be expanded. struct aio_hash {
/* resultp hash table */ void *
hash_pad;
/* ensure sizeof (aio_hash_t) == 32 */ #
define HASHSZ 2048 /* power of 2 */extern int _max_workers;
/* max number of workers permitted */ extern int __uaio_ok;
/* indicates if aio is initialized */ extern int _kaio_ok;
/* indicates if kaio is initialized */ extern int _aiowait_flag;
/* when set, aiowait() is inprogress */