ARC: Cache arc_c value during arc_evict()
[zfs.git] / lib / libspl / include / sys / mhd.h
blob956009b499ee83518116a750782c8687f5fea720
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or https://opensource.org/licenses/CDDL-1.0.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_MHD_H
28 #define _SYS_MHD_H
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
35 * Definitions for multi-host device I/O control commands
37 #define MHIOC ('M'<<8)
38 #define MHIOCENFAILFAST (MHIOC|1)
39 #define MHIOCTKOWN (MHIOC|2)
40 #define MHIOCRELEASE (MHIOC|3)
41 #define MHIOCSTATUS (MHIOC|4)
42 #define MHIOCGRP_INKEYS (MHIOC|5)
43 #define MHIOCGRP_INRESV (MHIOC|6)
44 #define MHIOCGRP_REGISTER (MHIOC|7)
45 #define MHIOCGRP_RESERVE (MHIOC|8)
46 #define MHIOCGRP_PREEMPTANDABORT (MHIOC|9)
47 #define MHIOCGRP_PREEMPT (MHIOC|10)
48 #define MHIOCGRP_CLEAR (MHIOC|11)
49 #define MHIOCGRP_REGISTERANDIGNOREKEY (MHIOC|14)
50 #define MHIOCQRESERVE (MHIOC|12)
51 #define MHIOCREREGISTERDEVID (MHIOC|13)
54 * Following is the structure to specify the delay parameters in
55 * milliseconds, via the MHIOCTKOWN ioctl.
57 struct mhioctkown {
58 int reinstate_resv_delay;
59 int min_ownership_delay;
60 int max_ownership_delay;
63 #define MHIOC_RESV_KEY_SIZE 8
64 typedef struct mhioc_resv_key {
65 uchar_t key[MHIOC_RESV_KEY_SIZE];
66 } mhioc_resv_key_t;
68 typedef struct mhioc_key_list {
69 uint32_t listsize;
70 uint32_t listlen;
71 mhioc_resv_key_t *list;
72 } mhioc_key_list_t;
74 typedef struct mhioc_inkeys {
75 uint32_t generation;
76 mhioc_key_list_t *li;
77 } mhioc_inkeys_t;
79 #if defined(_SYSCALL32)
80 struct mhioc_key_list32 {
81 uint32_t listsize;
82 uint32_t listlen;
83 caddr32_t list;
84 } mhioc_key_list32_t;
86 struct mhioc_inkeys32 {
87 uint32_t generation;
88 caddr32_t li;
89 } mhioc_inkeys32_t;
90 #endif
92 typedef struct mhioc_resv_desc {
93 mhioc_resv_key_t key;
94 uint8_t type;
95 uint8_t scope;
96 uint32_t scope_specific_addr;
97 } mhioc_resv_desc_t;
99 typedef struct mhioc_resv_desc_list {
100 uint32_t listsize;
101 uint32_t listlen;
102 mhioc_resv_desc_t *list;
103 } mhioc_resv_desc_list_t;
105 typedef struct mhioc_inresvs {
106 uint32_t generation;
107 mhioc_resv_desc_list_t *li;
108 } mhioc_inresvs_t;
110 #if defined(_SYSCALL32)
111 struct mhioc_resv_desc_list32 {
112 uint32_t listsize;
113 uint32_t listlen;
114 caddr32_t list;
115 } mhioc_resv_desc_list32_t;
117 typedef struct mhioc_inresvs32 {
118 uint32_t generation;
119 caddr32_t li;
120 } mhioc_inresvs32_t;
121 #endif
123 typedef struct mhioc_register {
124 mhioc_resv_key_t oldkey;
125 mhioc_resv_key_t newkey;
126 boolean_t aptpl; /* True if persistent across power failures */
127 } mhioc_register_t;
129 typedef struct mhioc_preemptandabort {
130 mhioc_resv_desc_t resvdesc;
131 mhioc_resv_key_t victim_key;
132 } mhioc_preemptandabort_t;
134 typedef struct mhioc_registerandignorekey {
135 mhioc_resv_key_t newkey;
136 boolean_t aptpl; /* True if persistent across power failures */
137 } mhioc_registerandignorekey_t;
140 * SCSI-3 PGR Reservation Type Codes. Codes with the _OBSOLETE suffix
141 * have been removed from the SCSI3 PGR standard.
143 #define SCSI3_RESV_READSHARED_OBSOLETE 0
144 #define SCSI3_RESV_WRITEEXCLUSIVE 1
145 #define SCSI3_RESV_READEXCLUSIVE_OBSOLETE 2
146 #define SCSI3_RESV_EXCLUSIVEACCESS 3
147 #define SCSI3_RESV_SHAREDACCESS_OBSOLETE 4
148 #define SCSI3_RESV_WRITEEXCLUSIVEREGISTRANTSONLY 5
149 #define SCSI3_RESV_EXCLUSIVEACCESSREGISTRANTSONLY 6
151 #define SCSI3_SCOPE_LOGICALUNIT 0
152 #define SCSI3_SCOPE_EXTENT_OBSOLETE 1
153 #define SCSI3_SCOPE_ELEMENT 2
155 #ifdef __cplusplus
157 #endif
159 #endif /* _SYS_MHD_H */