/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RDC_DISKQ_H
#define _RDC_DISKQ_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
typedef struct qentry {
int magic;
int flag;
int iostatus;
void *next;
} q_data;
typedef union io_dat {
} io_hdr;
/* type */
#ifdef NSC_MULTI_TERABYTE
#else
#endif
typedef struct diskqheader1 {
int magic;
int vers;
int state;
typedef struct diskqheader2 {
int magic;
int vers;
int state;
#ifdef NSC_MULTI_TERABYTE
#ifdef _LP64
#else
#endif
#else
#endif
typedef union headr {
diskq_header h;
} dqheader;
/* flags for the state field in the header */
long nitems_hwm;
long blocks_hwm;
long throttle_delay;
/* and all things in dqheader */
int busycnt;
} disk_queue;
/* diskq macros (gets) */
/* diskq macros (sets) */
#define WRAPQTAIL(q) \
do { \
if (QWRAP(q)) { \
SET_AUXQWRAP(q, QTAIL(q)); \
} else { \
} \
SET_QTAIL(q, RDC_DISKQ_DATA_OFF); \
} while (0)
#define DO_AUXQWRAP(q) \
do { \
SET_AUXQWRAP(q, 0); \
} while (0)
/* these can be wrapped by different threads, avoid the race */
#define WRAPQHEAD(q) \
do { \
if (IS_QSTATE(q, QNXTIOWRAPD)) { \
if (AUXQWRAP(q)) { \
DO_AUXQWRAP(q); \
} else { \
SET_QWRAP(q, 0); \
} \
CLR_QSTATE(q, QNXTIOWRAPD); \
} else { \
SET_QSTATE(q, QHEADWRAPD); \
} \
SET_QHEAD(q, RDC_DISKQ_DATA_OFF); \
} while (0)
#define WRAPQNXTIO(q) \
do { \
if (IS_QSTATE(q, QHEADWRAPD)) { \
if (AUXQWRAP(q)) { \
DO_AUXQWRAP(q); \
} else { \
SET_QWRAP(q, 0); \
} \
CLR_QSTATE(q, QHEADWRAPD); \
} else { \
SET_QSTATE(q, QNXTIOWRAPD); \
} \
SET_QNXTIO(q, RDC_DISKQ_DATA_OFF); \
} while (0)
#define FITSONQ(q, n) \
/* CSTYLED */
#define RDC_BETWEEN(a,b,c) (a<b?((c>=a)&&(c<=b)):((a!=b)&&((c<b)||(c>=a))))
/* CSTYLED */
QCOALBOUNDS(q))):\
" a: %" NSC_SZFMT, \
/* Disk queue flusher state */
#define RDC_QFILL_AWAKE (0)
/* functions */
int rdc_lookup_diskq(char *path);
void rdc_dump_iohdrs(disk_queue *q);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _RDC_DISKQ_H */