diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2008-09-28 12:02:44 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-09-28 14:11:47 +0200 |
commit | 41b7a00922bdb1a501cbf2e39282fe64bb94cb6d (patch) | |
tree | 2c212da9aa9a2e773a344f11fb9b0de2889aed3f /udev/udev_rules.h | |
parent | 669ed8675f7a8bc3987ad501d11f7623b70698e6 (diff) |
avoid repeated scans for goto targets (udev_iter_find_label)
The scans are now performed up-front at parse-time, instead of being
repeated for each event at run-time.
Cachegrind reports a 5% reduction in cpu cycles
(excluding the time spent in-kernel).
Diffstat (limited to 'udev/udev_rules.h')
-rw-r--r-- | udev/udev_rules.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/udev/udev_rules.h b/udev/udev_rules.h index 02685e1834..af96b8119b 100644 --- a/udev/udev_rules.h +++ b/udev/udev_rules.h @@ -84,6 +84,7 @@ struct udev_rule { struct key wait_for; struct key label; struct key goto_label; + size_t goto_rule_off; struct key name; struct key symlink; @@ -122,7 +123,7 @@ extern void udev_rules_cleanup(struct udev_rules *rules); extern void udev_rules_iter_init(struct udev_rules_iter *iter, struct udev_rules *rules); extern struct udev_rule *udev_rules_iter_next(struct udev_rules_iter *iter); -extern struct udev_rule *udev_rules_iter_label(struct udev_rules_iter *iter, const char *label); +extern struct udev_rule *udev_rules_iter_goto(struct udev_rules_iter *iter, size_t rule_off); extern int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev); extern int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev); |