Lines Matching refs:devices
33 sd_device **devices; member
71 static void device_unref_many(sd_device **devices, size_t n) { in device_unref_many() argument
72 assert(devices || n == 0); in device_unref_many()
75 sd_device_unref(devices[i]); in device_unref_many()
82 device_unref_many(enumerator->devices, enumerator->n_devices); in device_enumerator_unref_devices()
83 enumerator->devices = mfree(enumerator->devices); in device_enumerator_unref_devices()
341 sd_device **devices; in enumerator_sort_devices() local
350 devices = new(sd_device*, hashmap_size(enumerator->devices_by_syspath)); in enumerator_sort_devices()
351 if (!devices) in enumerator_sort_devices()
370 devices[n++] = sd_device_ref(device); in enumerator_sort_devices()
383 devices[n++] = sd_device_ref(device); in enumerator_sort_devices()
393 r = sd_device_get_syspath(devices[i], &syspath); in enumerator_sort_devices()
397 … assert_se(hashmap_remove(enumerator->devices_by_syspath, syspath) == devices[i]); in enumerator_sort_devices()
398 sd_device_unref(devices[i]); in enumerator_sort_devices()
405 typesafe_qsort(devices + n_sorted, n - n_sorted, device_compare); in enumerator_sort_devices()
410 devices[n++] = sd_device_ref(device); in enumerator_sort_devices()
417 r = sd_device_get_syspath(devices[i], &syspath); in enumerator_sort_devices()
421 r = hashmap_put(enumerator->devices_by_syspath, syspath, devices[i]); in enumerator_sort_devices()
426 sd_device_ref(devices[i]); in enumerator_sort_devices()
429 typesafe_qsort(devices + n_sorted, n - n_sorted, device_compare); in enumerator_sort_devices()
431 device_unref_many(enumerator->devices, enumerator->n_devices); in enumerator_sort_devices()
434 free_and_replace(enumerator->devices, devices); in enumerator_sort_devices()
440 device_unref_many(devices, n); in enumerator_sort_devices()
441 free(devices); in enumerator_sort_devices()
1018 return enumerator->devices[0]; in sd_device_enumerator_get_device_first()
1030 return enumerator->devices[++enumerator->current_device_index]; in sd_device_enumerator_get_device_next()
1085 return enumerator->devices[0]; in sd_device_enumerator_get_subsystem_first()
1097 return enumerator->devices[++enumerator->current_device_index]; in sd_device_enumerator_get_subsystem_next()
1158 return enumerator->devices[0]; in device_enumerator_get_first()
1169 return enumerator->devices[++enumerator->current_device_index]; in device_enumerator_get_next()
1183 return enumerator->devices; in device_enumerator_get_devices()