aboutsummaryrefslogtreecommitdiff
path: root/libs/kstd
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-09-10 10:03:46 +0200
committerFelix Morgner <felix.morgner@ost.ch>2026-09-10 10:03:46 +0200
commit00f2a986760c7720fac58c365f427720bd71b755 (patch)
treed9cd035c85d26e5414cb18e254396b67c38cc02b /libs/kstd
parentae3c7b2026011a6e31a2fd9eb1cd1a68faf462a7 (diff)
downloadkernel-00f2a986760c7720fac58c365f427720bd71b755.tar.xz
kernel-00f2a986760c7720fac58c365f427720bd71b755.zip
kernel/vfs: reduce number registry pruning
Previously, the number registry did a pruning pass whenever elements, either all or a filtered subset, were queried by a consumer. This meant, that every access to elements did an additional O(n) scan of the entire registry, to ensure no expired devices were still registered. This used to be necessary, when the ownership model for devices was still in flux. With the established device ownership model, this has become obsolete. Additionally, devices get numbered automatically when a device gains a facet the is observed by the device number registry. Since registering this type of facet is the responsibility of the device driver, since only a driver can know how to implement that facet for any given device, it also becomes the responsibility of the driver to revoke that facet if and when a device is detached from the system. Any device is always owned by the bus it is attached to. This means it is the bus' responsibility to inform drivers about devices disappearing. This closes the chain of responsibility cleanly, meaning the device number registry will never have to prune itself in any accessors. Instead, it will be informed by the facet registry that a facet for a device has been revoked, allowing it to un-number that device if applicable.
Diffstat (limited to 'libs/kstd')
0 files changed, 0 insertions, 0 deletions