Re: [PATCH 05/17] odb/source: introduce source type for robustness
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 4, 2026, 20:46 UTC
- Message-ID
- <aaiZTjrK2oHpqmVQ@denethor>
- In-Reply-To
- <20260223-b4-pks-odb-source-pluggable-v1-5-253bac1db598@pks.im>
On 26/02/23 05:17PM, Patrick Steinhardt wrote:
Show 5 quoted lines
> When a caller holds a `struct odb_source`, they have no way of telling > what type the source is. This doesn't really cause any problems in the > current status quo as we only have a single type anyway, "files". But > going forward we expect to add more types, and if so it will become > necessary to tell the sources apart.
In this patch, it looks like are only using the ODB source "type" to know to properly BUG() out when downcasting. Do we anticipate other uses here?
> Introduce a new enum to cover this use case and assert that the given > source actually matches the target source when performing the downcast.
Does these mean all future source types would be required to have their own enum value defined?
-Justin