Lines Matching defs:sysfs

52         if (!d->sysfs)
56 * same sysfs path. */
58 first = hashmap_get(devices, d->sysfs);
62 hashmap_remove_and_replace(devices, d->sysfs, first->sysfs, first);
64 hashmap_remove(devices, d->sysfs);
66 d->sysfs = mfree(d->sysfs);
69 static int device_set_sysfs(Device *d, const char *sysfs) {
76 if (streq_ptr(d->sysfs, sysfs))
83 copy = strdup(sysfs);
89 first = hashmap_get(UNIT(d)->manager->devices_by_sysfs, sysfs);
99 d->sysfs = copy;
202 prefix, strna(d->sysfs));
296 const char *sysfs = NULL;
305 sysfs = udev_device_get_syspath(dev);
306 if (!sysfs)
324 if (!path_equal(DEVICE(u)->sysfs, sysfs)) {
325 log_unit_error(u, "Dev %s appeared twice with different sysfs paths %s and %s",
326 e, DEVICE(u)->sysfs, sysfs);
347 * actually been seen yet ->sysfs will not be
349 if (sysfs) {
350 r = device_set_sysfs(DEVICE(u), sysfs);
379 const char *sysfs, *dn, *alias;
385 sysfs = udev_device_get_syspath(dev);
386 if (!sysfs)
389 /* Add the main unit named after the sysfs path */
390 r = device_setup_unit(m, dev, sysfs, true);
443 log_warning("SYSTEMD_ALIAS for %s is not an absolute path, ignoring: %s", sysfs, e);
446 log_warning("SYSTEMD_ALIAS for %s has trailing garbage, ignoring.", sysfs);
484 static int device_update_found_by_sysfs(Manager *m, const char *sysfs, bool add, DeviceFound found, bool now) {
488 assert(sysfs);
493 l = hashmap_get(m->devices_by_sysfs, sysfs);
544 /* Make everybody follow the unit that's named after the sysfs path */
676 const char *sysfs;
678 sysfs = udev_list_entry_get_name(item);
680 dev = udev_device_new_from_syspath(m->udev, sysfs);
691 device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, false);
703 const char *action, *sysfs;
725 sysfs = udev_device_get_syspath(dev);
726 if (!sysfs) {
745 device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP, true);
758 device_update_found_by_sysfs(m, sysfs, true, DEVICE_FOUND_UDEV, true);
765 device_update_found_by_sysfs(m, sysfs, false, DEVICE_FOUND_UDEV, true);