Lines Matching defs:error

39 static char *get_device_name(dm_descriptor_t device, int *error);
40 static dmgt_disk_t *get_disk(dm_descriptor_t disk, int *error);
41 static char **get_disk_aliases(dm_descriptor_t disk, char *name, int *error);
42 static int get_disk_online(dm_descriptor_t disk, int *error);
45 const char *name, uint32_t blocksize, int *error);
47 const char *name, uint32_t blocksize, int *in_use, int *error);
49 uint64_t *size, uint32_t *blocksize, int *error);
51 char **used_name, char **used_by, int *error);
53 dm_descriptor_t slice, uint32_t blocksize, int *error);
55 static int slice_in_use(dmgt_slice_t *slice, int *error);
69 get_device_name(dm_descriptor_t device, int *error)
74 *error = 0;
75 name = dm_get_name(device, error);
76 if (*error) {
82 *error = -1;
96 * 1. Success: error is set to 0 and a dmgt_disk_t is returned
98 * 2. Failure: error is set to -1 and NULL is returned
101 get_disk(dm_descriptor_t disk, int *error)
104 *error = 0;
109 *error = -1;
113 dp->name = get_device_name(disk, error);
114 if (!*error) {
117 dp->aliases = get_disk_aliases(disk, dp->name, error);
118 if (!*error) {
123 DM_MEDIA, error);
124 if (*error != 0 || media == NULL ||
129 *error = -1;
134 error);
135 if (!*error) {
141 &(dp->in_use), error);
149 if (*error) {
150 /* Normalize error */
151 *error = -1;
163 get_disk_aliases(dm_descriptor_t disk, char *name, int *error)
168 *error = 0;
169 aliases = dm_get_associated_descriptors(disk, DM_ALIAS, error);
170 if (*error || aliases == NULL) {
171 *error = -1;
182 *error = -1;
187 for (j = 0; *error == 0 && aliases[j] != NULL; j++) {
190 char *aname = dm_get_name(alias, error);
191 if (*error) {
197 *error = -1;
209 if (*error && names != NULL) {
218 get_disk_online(dm_descriptor_t disk, int *error)
223 *error = 0;
224 attrs = dm_get_attributes(disk, error);
225 if (*error) {
236 *error = 1;
250 * 1. Success: error is set to 0 and slices are returned
252 * 2. Failure: error is set to -1 and NULL is returned
256 int *error)
261 *error = 0;
262 slices = dm_get_associated_descriptors(media, DM_SLICE, error);
263 if (*error != 0) {
270 for (j = 0; *error == 0 &&
275 get_slice(slices[j], blocksize, error);
276 if (!*error) {
284 *error = -1;
301 if (*error) {
302 /* Normalize error */
303 *error = -1;
354 * 1. Success: error is set to 0 and slices are returned
356 * 2. Failure: error is set to -1 and NULL is returned
360 uint32_t blocksize, int *in_use, int *error)
362 dmgt_slice_t **slices = get_disk_slices(media, name, blocksize, error);
363 if (*error) {
387 s_in_use = slice_in_use(slice, error);
388 if (*error) {
422 if (*error) {
423 /* Normalize error */
424 *error = -1;
438 uint32_t *blocksize, int *error)
443 *error = 0;
445 attrs = dm_get_attributes(media, error);
447 if (*error) {
462 *error = 1;
466 if (*error == 0) {
473 *error = 1;
485 char **used_by, int *error)
488 nvlist_t *stats = dm_get_stats(slice, DM_SLICE_STAT_USE, error);
489 if (*error != 0) {
509 *error = -1;
524 *error = -1;
537 get_slice(dm_descriptor_t slice, uint32_t blocksize, int *error)
540 *error = 0;
543 *error = -1;
548 sp->name = get_device_name(slice, error);
549 if (!*error) {
551 nvlist_t *attrs = dm_get_attributes(slice, error);
552 if (*error) {
567 *error = 1;
586 *error = 1;
595 &(sp->used_by), error);
602 if (*error && sp != NULL) {
639 slice_in_use(dmgt_slice_t *slice, int *error)
645 in_use = dm_inuse(slice->name, &msg, DM_WHO_ZPOOL_FORCE, error);
646 if (*error) {
677 int error = 0;
681 dm_descriptor_t *disks = dm_get_descriptors(DM_DRIVE, filter, &error);
683 if (error) {
693 /* Reset error flag for each disk */
694 error = 0;
697 online = get_disk_online(disk, &error);
698 if (!error && online) {
701 dmgt_disk_t *dp = get_disk(disk, &error);
702 if (!error) {
714 error = -1;
730 return (error);
757 * For clients that need to capture error output.