Lines Matching refs:errp
62 static dm_descriptor_t *ptr_array_to_desc_array(descriptor_t **ptrs, int *errp);
63 static descriptor_t **desc_array_to_ptr_array(dm_descriptor_t *da, int *errp);
65 int *found, int *errp);
111 int *errp)
123 *errp = EBADF;
130 *errp = ENODEV;
136 descs = drive_get_assoc_descriptors(dp, type, errp);
139 descs = bus_get_assoc_descriptors(dp, type, errp);
142 descs = controller_get_assoc_descriptors(dp, type, errp);
145 descs = media_get_assoc_descriptors(dp, type, errp);
148 descs = slice_get_assoc_descriptors(dp, type, errp);
151 descs = partition_get_assoc_descriptors(dp, type, errp);
154 descs = path_get_assoc_descriptors(dp, type, errp);
157 descs = alias_get_assoc_descriptors(dp, type, errp);
160 *errp = EINVAL;
166 return (ptr_array_to_desc_array(descs, errp));
195 dm_get_attributes(dm_descriptor_t desc, int *errp)
207 *errp = EBADF;
214 *errp = ENODEV;
220 attrs = drive_get_attributes(dp, errp);
223 attrs = bus_get_attributes(dp, errp);
226 attrs = controller_get_attributes(dp, errp);
229 attrs = media_get_attributes(dp, errp);
232 attrs = slice_get_attributes(dp, errp);
235 attrs = partition_get_attributes(dp, errp);
238 attrs = path_get_attributes(dp, errp);
241 attrs = alias_get_attributes(dp, errp);
244 *errp = EINVAL;
254 dm_get_descriptor_by_name(dm_desc_type_t desc_type, char *name, int *errp)
263 desc = (uintptr_t)drive_get_descriptor_by_name(name, errp);
266 desc = (uintptr_t)bus_get_descriptor_by_name(name, errp);
270 errp);
273 desc = (uintptr_t)media_get_descriptor_by_name(name, errp);
276 desc = (uintptr_t)slice_get_descriptor_by_name(name, errp);
280 errp);
283 desc = (uintptr_t)path_get_descriptor_by_name(name, errp);
286 desc = (uintptr_t)alias_get_descriptor_by_name(name, errp);
289 *errp = EINVAL;
299 dm_get_descriptors(dm_desc_type_t type, int filter[], int *errp)
308 descs = drive_get_descriptors(filter, errp);
311 descs = bus_get_descriptors(filter, errp);
314 descs = controller_get_descriptors(filter, errp);
317 descs = media_get_descriptors(filter, errp);
320 descs = slice_get_descriptors(filter, errp);
323 descs = partition_get_descriptors(filter, errp);
326 descs = path_get_descriptors(filter, errp);
329 descs = alias_get_descriptors(filter, errp);
332 *errp = EINVAL;
338 return (ptr_array_to_desc_array(descs, errp));
342 dm_get_name(dm_descriptor_t desc, int *errp)
354 *errp = EBADF;
361 *errp = ENODEV;
394 *errp = 0;
398 *errp = ENOMEM;
407 dm_get_stats(dm_descriptor_t desc, int stat_type, int *errp)
419 *errp = EBADF;
426 *errp = ENODEV;
432 stats = drive_get_stats(dp, stat_type, errp);
435 stats = bus_get_stats(dp, stat_type, errp);
438 stats = controller_get_stats(dp, stat_type, errp);
441 stats = media_get_stats(dp, stat_type, errp);
455 stats = slice_get_stats(dp, stat_type, errp);
458 stats = partition_get_stats(dp, stat_type, errp);
461 stats = path_get_stats(dp, stat_type, errp);
464 stats = alias_get_stats(dp, stat_type, errp);
467 *errp = EINVAL;
499 dm_get_slices(char *drive, dm_descriptor_t **slices, int *errp)
506 *errp = 0;
512 alias = dm_get_descriptor_by_name(DM_ALIAS, drive, errp);
520 disk = dm_get_associated_descriptors(alias, DM_DRIVE, errp);
524 DM_MEDIA, errp);
528 DM_SLICE, errp);
538 dm_get_slice_stats(char *slice, nvlist_t **dev_stats, int *errp)
543 *errp = 0;
553 devp = dm_get_descriptor_by_name(DM_SLICE, slice, errp);
556 errp);
567 dm_isoverlapping(char *slicename, char **overlaps_with, int *errp)
582 slice = dm_get_descriptor_by_name(DM_SLICE, slicename, errp);
590 media = dm_get_associated_descriptors(slice, DM_MEDIA, errp);
591 if (media == NULL || *media == NULL || *errp != 0)
594 slices = dm_get_associated_descriptors(*media, DM_SLICE, errp);
595 if (slices == NULL || *slices == NULL || *errp != 0)
598 media_attrs = dm_get_attributes(*media, errp);
599 if (media_attrs == NULL || *errp)
602 *errp = nvlist_lookup_uint64(media_attrs, DM_NACCESSIBLE, &media_size);
603 if (*errp != 0)
606 slice_attrs = dm_get_attributes(slice, errp);
607 if (slice_attrs == NULL || *errp != 0)
610 *errp = nvlist_lookup_uint64(slice_attrs, DM_START, &start_block);
611 if (*errp != 0)
614 *errp = nvlist_lookup_uint64(slice_attrs, DM_SIZE, &size);
615 if (*errp != 0)
618 *errp = nvlist_lookup_uint32(slice_attrs, DM_INDEX, &in_snum);
619 if (*errp != 0)
630 nvlist_t *other_attrs = dm_get_attributes(slices[i], errp);
635 if (*errp != 0)
638 *errp = nvlist_lookup_uint64(other_attrs, DM_START,
640 if (*errp) {
645 *errp = nvlist_lookup_uint64(other_attrs, DM_SIZE,
648 if (*errp) {
656 *errp = nvlist_lookup_uint32(other_attrs, DM_INDEX,
659 if (*errp) {
684 char *str = dm_get_name(slices[i], errp);
685 if (*errp != 0) {
702 char *str = dm_get_name(slices[i], errp);
703 if (*errp != 0) {
739 dm_get_swapentries(swaptbl_t **stp, int *errp)
749 *errp = errno;
760 *errp = ENOMEM;
766 *errp = ENOMEM;
781 *errp = errno;
805 dm_inuse_swap(const char *dev_name, int *errp)
811 *errp = 0;
813 count = dm_get_swapentries(&tbl, errp);
814 if (count < 0 || *errp) {
847 dm_inuse(char *dev_name, char **msg, dm_who_type_t who, int *errp)
857 *errp = 0;
882 if (ANY_ZPOOL_USE(who) && (err = dm_inuse_swap(dname, errp))) {
884 /* on error, dm_inuse_swap sets errp */
892 &found, errp);
901 dm_get_slice_stats(dname, &dev_stats, errp);
913 if (*errp) {
914 if (*errp == ENODEV) {
915 *errp = 0;
963 by, data, msg, &found, errp) != 0) {
964 if (*errp) {
987 by, data, msg, &found, errp) != 0) {
988 if (*errp) {
1005 by, data, msg, &found, errp)) {
1006 if (*errp) {
1017 by, data, msg, &found, errp) != 0) {
1018 if (*errp) {
1031 by, data, msg, &found, errp) != 0) {
1032 if (*errp)
1040 data, msg, &found, errp) != 0) {
1041 if (*errp)
1130 libdiskmgt_add_str(nvlist_t *attrs, char *name, char *val, int *errp)
1132 if (*errp == 0) {
1133 *errp = nvlist_add_string(attrs, name, val);
1138 libdiskmgt_empty_desc_array(int *errp)
1144 *errp = ENOMEM;
1149 *errp = 0;
1196 desc_array_to_ptr_array(dm_descriptor_t *descs, int *errp)
1211 *errp = ENOMEM;
1218 *errp = 0;
1227 ptr_array_to_desc_array(descriptor_t **ptrs, int *errp)
1237 if (*errp != 0 || ptrs == NULL) {
1246 *errp = ENOMEM;
1253 *errp = 0;
1267 int *found, int *errp)
1274 *errp = 0;
1295 *errp = errno;