Yu Watanabe
77ad202c72
udevadm-test: replace udev_device by sd_device
2018-11-07 13:35:03 +09:00
Yu Watanabe
cf28ad4689
udev-event: make udev_event_new() take sd_device instead of udev_device
2018-11-07 13:35:03 +09:00
Yu Watanabe
cf697ec00e
udev-rules: replace udev_device by sd_device in udev_rules_apply_to_event()
2018-11-07 13:35:03 +09:00
Yu Watanabe
dbea7f24d2
udev-rules: replace two udev_list_entry_foreach() by corresponding FOREACH_DEVICE_*() macros
2018-11-07 13:35:03 +09:00
Yu Watanabe
1017d66bf5
udev-rules: use structured initializer
2018-11-07 13:35:03 +09:00
Yu Watanabe
92b80c6baa
udev-rules: drop unused member file_list in struct udev_rules
2018-11-07 13:35:03 +09:00
Yu Watanabe
1ce7fecb4f
udev-rules: make import_parent_into_properties() take sd_device
2018-11-07 13:35:03 +09:00
Yu Watanabe
13c7b75f2f
udev-rules: make import_file_into_properties() take sd_device
2018-11-07 13:35:03 +09:00
Yu Watanabe
29b5eb5adf
udev-rules: make import_property_from_string() take sd_device
...
Also, this makes the function return negative errno, though its
return value is always ignored.
2018-11-07 13:35:03 +09:00
Yu Watanabe
f3d241feb2
udev: use sd_device for udev_event.dev_parent
2018-11-07 13:35:03 +09:00
Yu Watanabe
5ba7e79885
udev-rules: make match_attr() take sd_device instead of udev_device
2018-11-07 13:35:03 +09:00
Yu Watanabe
480ecb7d28
udev: use sd_device for udev_event.dev_db
...
Also, this adds sd_device_unref for the object in udev_event_free()
for safety and readability of code.
2018-11-07 13:35:03 +09:00
Yu Watanabe
e0bb2ff94b
udev-event: make udev_event_new() take sd_netlink and take a reference of that
2018-11-07 13:35:03 +09:00
Yu Watanabe
0f86dc900e
udev-event: make udev_event_new() take exec_delay
2018-11-07 13:35:03 +09:00
Lennart Poettering
39adc47495
Merge pull request #10658 from yuwata/udevd-worker-performance
...
udev: improve performance
2018-11-06 20:01:37 +03:00
Lennart Poettering
9edcbc4f44
Merge pull request #10602 from yuwata/sd-device-logs
...
update log messages
2018-11-06 19:33:51 +03:00
Yu Watanabe
faae64fa3d
udevd: increase default number of workers
...
The uevent handling in udevd is not cpu hungry.
So, let's increase the default number of workers per cpu.
This decrease the number of queued uevents.
Without this commit (children_max is 16 on my laptop)
```
$ journalctl -b -u systemd-udevd.service | grep reached | wc -l
1544
```
With this commit (children_max is 30 on my laptop)
```
$ journalctl -b -u systemd-udevd.service | grep reached | wc -l
7
```
2018-11-07 00:25:20 +09:00
Yu Watanabe
eca195ec23
udevd: wait 3 seconds before killing worker processes
...
During boot process, many worker processes are forked and killed.
To decrease cycles of forking and killing worker, let's wait
3 seconds before killing workers. If new uevent or inotify event
comes within the delay, the killing porcess will be cancelled.
2018-11-07 00:25:13 +09:00
Yu Watanabe
da14313418
udevd: drop redundant logic of receiving uevent
...
If there exists pending uevents, then sd-event invokes uevent handler.
So, it is not necessary to receive the next uevent in inotify event.
2018-11-06 23:53:55 +09:00
Yu Watanabe
b6107f010a
udevd: decrease indentation
2018-11-06 23:53:50 +09:00
Yu Watanabe
05e6d9c64b
udevd: merge conditions to decrease indentation
2018-11-06 23:21:25 +09:00
Yu Watanabe
57512c893e
tree-wide: set WRITE_STRING_FILE_DISABLE_BUFFER flag when we write files under /proc or /sys
2018-11-06 21:24:03 +09:00
Yu Watanabe
76cdddfb9d
udevd: use set_oom_score_adjust() to set OOM score
2018-11-06 21:24:03 +09:00
Yu Watanabe
92c40e1dc8
udevadm: use write_string_file() helper function
2018-11-06 21:24:03 +09:00
Yu Watanabe
6bee206591
udev-node: add one more debug log when failed to create symlink
2018-11-06 15:45:22 +09:00
Yu Watanabe
a126a38a9f
udev-node: drop redundant log message
...
As node_symlink() logs almost same message.
2018-11-06 15:45:22 +09:00
Yu Watanabe
6174a243f9
udev: setting the same log level to SYSTEMD realm
...
Otherwise, many debug logs from libsystemd are dropped.
2018-11-06 15:45:22 +09:00
Yu Watanabe
cc0bf5e148
udev-watch: adjust level of log messages
2018-11-06 11:15:39 +09:00
Yu Watanabe
7fe3324c5e
udev-watch: make udev_watch_lookup() return 1 when device found
2018-11-06 11:15:39 +09:00
Yu Watanabe
b7759e0403
udev: drop redundant log message and fix returned error code
2018-11-06 11:15:39 +09:00
Yu Watanabe
4375dab58d
udev-event: fix timeout log messages
...
Follow-up for e81c3a4c5f
.
2018-10-31 09:29:51 +09:00
Yu Watanabe
7af1c7808b
udev-event: do not store unused devnum
2018-10-31 09:29:51 +09:00
Yu Watanabe
d4a95a952e
udev-event: check whether device has devnum before calling udev_node_remove()
...
This fixes a bug in 'remove' event handling, which was introduced by
eb1f9e30ec
, as 'devnum' variable may
not be initialized.
2018-10-31 09:29:51 +09:00
Yu Watanabe
4cade7a15b
udev-event: replace udev_device in subst_format_var() by sd_device
2018-10-27 07:25:27 +09:00
Yu Watanabe
a315999de6
udev-event: drop prototype of nonexistent function
2018-10-27 07:25:27 +09:00
Yu Watanabe
9204d8023f
udev-event: move definition of struct subst_map
2018-10-27 07:25:27 +09:00
Yu Watanabe
eb1f9e30ec
udev-event: replace udev_device in udev_event_execute_rules() by sd_device
...
Also, this adds many logs.
2018-10-27 07:25:27 +09:00
Yu Watanabe
e52eaf5649
udev-event: move devnode handling logic to a new function
...
Also, replace udev_device by sd_device.
2018-10-27 07:25:27 +09:00
Yu Watanabe
2740750d40
udev-event: move conditions to rename network interface into rename_netif()
...
Also, replace udev_device by sd_device.
2018-10-27 07:24:03 +09:00
Yu Watanabe
c1118ceba4
udev-event: rename udev_event_unref() to udev_event_free()
...
As struct udev_event does not have a reference counter.
2018-10-27 07:03:39 +09:00
Yu Watanabe
d737197154
udev-event: fix memleak in udev_event
...
The leak was introduced by 29448498c7
.
2018-10-27 07:03:39 +09:00
Yu Watanabe
89665d0920
udev-event: use structured initializer at one more place
2018-10-27 07:03:39 +09:00
Yu Watanabe
a368732bc4
udev-event: add more assert()
2018-10-27 07:03:39 +09:00
Yu Watanabe
dc8aec36a6
udev-event: check command is not empty before executing
2018-10-27 07:03:39 +09:00
Yu Watanabe
e9343893f7
udev-event: include device name in error message one more place
2018-10-27 07:03:39 +09:00
Yu Watanabe
7606377e2c
network,udev: drop unnecessary check whether ifindex is positive
...
As sd_device_get_ifindex() now returns positive ifindex when it
succeeds.
2018-10-27 07:03:39 +09:00
Lennart Poettering
7388cea30d
udev: use right error variable to make level decision
2018-10-24 20:47:52 +02:00
Lennart Poettering
dc4fedd8cb
udev: fix bad if {}
...
CID 1396318
CID 1396319
2018-10-24 20:46:41 +02:00
Lennart Poettering
d1db1c438f
Merge pull request #10484 from yuwata/udev-spawn-simplify
...
udev-event: cleanups about udev_event_spawn()
2018-10-24 10:57:45 +02:00
Lennart Poettering
e7b48c45ae
Merge pull request #10498 from yuwata/udev-builtin-log
...
udev-builtin: use log_device_*() macros
2018-10-24 10:53:35 +02:00