Lines Matching defs:dev
217 static int device_update_description(Unit *u, struct udev_device *dev, const char *path) {
222 assert(dev);
225 model = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE");
227 model = udev_device_get_property_value(dev, "ID_MODEL");
233 label = udev_device_get_property_value(dev, "ID_FS_LABEL");
235 label = udev_device_get_property_value(dev, "ID_PART_ENTRY_NAME");
237 label = udev_device_get_property_value(dev, "ID_PART_ENTRY_NUMBER");
258 static int device_add_udev_wants(Unit *u, struct udev_device *dev) {
266 assert(dev);
269 wants = udev_device_get_property_value(dev, property);
289 log_unit_warning(u, "Property %s on %s has trailing garbage, ignoring.", property, strna(udev_device_get_syspath(dev)));
294 static int device_setup_unit(Manager *m, struct udev_device *dev, const char *path, bool main) {
304 if (dev) {
305 sysfs = udev_device_get_syspath(dev);
354 (void) device_update_description(u, dev, path);
359 (void) device_add_udev_wants(u, dev);
378 static int device_process_new(Manager *m, struct udev_device *dev) {
385 sysfs = udev_device_get_syspath(dev);
390 r = device_setup_unit(m, dev, sysfs, true);
395 dn = udev_device_get_devnode(dev);
397 (void) device_setup_unit(m, dev, dn, false);
400 first = udev_device_get_devlinks_list_entry(dev);
405 /* Don't bother with the /dev/block links */
408 if (path_startswith(p, "/dev/block/") ||
409 path_startswith(p, "/dev/char/"))
415 * same /dev/disk/by-label/xxx link because they have
421 st.st_rdev != udev_device_get_devnum(dev))
424 (void) device_setup_unit(m, dev, p, false);
429 alias = udev_device_get_property_value(dev, "SYSTEMD_ALIAS");
441 (void) device_setup_unit(m, dev, e, false);
523 static bool device_is_ready(struct udev_device *dev) {
526 assert(dev);
528 ready = udev_device_get_property_value(dev, "SYSTEMD_READY");
675 _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
680 dev = udev_device_new_from_syspath(m->udev, sysfs);
681 if (!dev) {
686 if (!device_is_ready(dev))
689 (void) device_process_new(m, dev);
701 _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
721 dev = udev_monitor_receive_device(m->udev_monitor);
722 if (!dev)
725 sysfs = udev_device_get_syspath(dev);
731 action = udev_device_get_action(dev);
738 r = swap_process_device_remove(m, dev);
747 } else if (device_is_ready(dev)) {
749 (void) device_process_new(m, dev);
751 r = swap_process_device_new(m, dev);
784 _cleanup_udev_device_unref_ struct udev_device *dev = NULL;
801 if (!path_startswith(node, "/dev"))
818 dev = udev_device_new_from_devnum(m->udev, S_ISBLK(st.st_mode) ? 'b' : 'c', st.st_rdev);
819 if (!dev && errno != ENOENT)
830 (void) device_setup_unit(m, dev, node, false);