aio_impl.h revision d2749ac6e20fe35dbfa822f9b55c185325a2147e
/*
* CDDL HEADER START
*
* 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.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.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
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_AIO_IMPL_H
#define _SYS_AIO_IMPL_H
#include <sys/dditypes.h>
#include <sys/port_kernel.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
#define DUPLICATE 1
/*
* an aio_list_t is the head of a list. a group of requests are in
* the same list if their aio_req_list field point to the same list
* head.
*
* a list head is used for notification. a group of requests that
* should only notify a process when they are done will have a
* list head. notification is sent when the group of requests are
* done.
*/
typedef struct aio_lio {
int lio_nent; /* number of requests in list */
int lio_refcnt; /* number of requests active */
int lio_port; /* port number notification */
} aio_lio_t;
/*
* async I/O request struct - one per I/O request.
*/
/*
* Clustering: The aio_req_t structure is used by the PXFS module
* as a contract private interface.
*/
typedef struct aio_req_t {
int aio_req_fd; /* aio's file descriptor */
int aio_req_flags; /* flags */
int (*aio_req_cancel)(); /* driver's cancel cb. */
union {
} aio_req_iocb;
int aio_req_port; /* port id */
} aio_req_t;
/*
* Struct for asynchronous I/O (aio) information per process.
* Each proc stucture has a field pointing to this struct.
* The field will be null if no aio is used.
*/
typedef struct aio {
int aio_pending; /* # uncompleted requests */
int aio_outstanding; /* total # of requests */
int aio_ok; /* everything ok when set */
int aio_flags; /* flags */
int aio_rqclnup; /* cleanup request used by DR */
int aio_portpendcnt; /* # pending req. per port */
int aio_notifycnt; /* # user-level notifications */
} aio_t;
/*
* aio_flags for an aio_t.
*/
#define AIO_CLEANUP_PORT 0x0010
/*
* aio_req_flags for an aio_req_t
*/
/* flag argument of aio_cleanup() */
#define AIO_CLEANUP_POLL 0 /* check kaio poll queue */
/* functions exported by common/os/aio_subr.c */
struct aio_req *);
extern void aphysio_unlock(aio_req_t *);
extern void aio_cleanup(int);
extern void aio_cleanup_exit(void);
extern void aio_zerolen(aio_req_t *);
extern void aio_copyout_result(aio_req_t *);
/* Clustering: PXFS module uses this interface */
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_AIO_IMPL_H */