equal
deleted
inserted
replaced
18 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * information: Portions Copyright [yyyy] [name of copyright owner] |
19 * |
19 * |
20 * CDDL HEADER END |
20 * CDDL HEADER END |
21 */ |
21 */ |
22 /* |
22 /* |
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. |
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. |
24 * Use is subject to license terms. |
25 */ |
25 */ |
26 |
26 |
27 #ifndef _LIBDISKMGT_H |
27 #ifndef _LIBDISKMGT_H |
28 #define _LIBDISKMGT_H |
28 #define _LIBDISKMGT_H |
33 extern "C" { |
33 extern "C" { |
34 #endif |
34 #endif |
35 |
35 |
36 #include <libnvpair.h> |
36 #include <libnvpair.h> |
37 |
37 |
38 /* typedef void *dm_descriptor_t; */ |
38 /* |
|
39 * Holds all the data regarding the device. |
|
40 * Private to libdiskmgt. Must use dm_xxx functions to set/get data. |
|
41 */ |
39 typedef uint64_t dm_descriptor_t; |
42 typedef uint64_t dm_descriptor_t; |
|
43 |
|
44 typedef enum { |
|
45 DM_WHO_MKFS = 0, |
|
46 DM_WHO_ZPOOL, |
|
47 DM_WHO_FORMAT, |
|
48 DM_WHO_SWAP, |
|
49 DM_WHO_DUMP |
|
50 } dm_who_type_t; |
40 |
51 |
41 typedef enum { |
52 typedef enum { |
42 DM_DRIVE = 0, |
53 DM_DRIVE = 0, |
43 DM_CONTROLLER, |
54 DM_CONTROLLER, |
44 DM_MEDIA, |
55 DM_MEDIA, |
197 #define DM_USE_LU "lu" |
208 #define DM_USE_LU "lu" |
198 #define DM_USE_DUMP "dump" |
209 #define DM_USE_DUMP "dump" |
199 #define DM_USE_VXVM "vxvm" |
210 #define DM_USE_VXVM "vxvm" |
200 #define DM_USE_FS "fs" |
211 #define DM_USE_FS "fs" |
201 #define DM_USE_VFSTAB "vfstab" |
212 #define DM_USE_VFSTAB "vfstab" |
|
213 #define DM_USE_ZPOOL "zpool" |
202 |
214 |
203 /* event */ |
215 /* event */ |
204 #define DM_EV_NAME "name" |
216 #define DM_EV_NAME "name" |
205 #define DM_EV_DTYPE "edtype" |
217 #define DM_EV_DTYPE "edtype" |
206 #define DM_EV_TYPE "evtype" |
218 #define DM_EV_TYPE "evtype" |
230 nvlist_t *dm_get_stats(dm_descriptor_t desc, int stat_type, |
242 nvlist_t *dm_get_stats(dm_descriptor_t desc, int stat_type, |
231 int *errp); |
243 int *errp); |
232 void dm_init_event_queue(void(*callback)(nvlist_t *, int), |
244 void dm_init_event_queue(void(*callback)(nvlist_t *, int), |
233 int *errp); |
245 int *errp); |
234 nvlist_t *dm_get_event(int *errp); |
246 nvlist_t *dm_get_event(int *errp); |
|
247 void dm_get_slices(char *drive, dm_descriptor_t **slices, |
|
248 int *errp); |
|
249 void dm_get_slice_stats(char *slice, nvlist_t **dev_stats, |
|
250 int *errp); |
|
251 void dm_get_usage_string(char *who, char *data, char **msg); |
|
252 int dm_inuse(char *dev_name, char **msg, dm_who_type_t who, |
|
253 int *errp); |
235 |
254 |
236 #ifdef __cplusplus |
255 #ifdef __cplusplus |
237 } |
256 } |
238 #endif |
257 #endif |
239 |
258 |