HomeFreeBSD

bus: Add device_has_children predicate

Description

bus: Add device_has_children predicate

Add a device_has_children() function which can be used to check if a
device has children without allocating a list of them which we aren't
going to use, or even counting them.

Also modify device_get_children() so it can be used to query the count
without allocating a list.

MFC after: 1 week
Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D53918

(cherry picked from commit 330d4437f2100fc05e576763f4f6a7198080663a)

Details

Provenance
desAuthored on Nov 28 2025, 9:14 AM
Reviewer
imp
Differential Revision
D53918: bus: Add device_has_children predicate
Parents
rG844f76c2426d: libc: Simplify __get_locale()
Branches
Unknown
Tags
Unknown