Subject: Re: [PATCH 05/17] odb/source: introduce source type for robustness

From: Justin Tobler <[email-masked]>
Date: Wed, 4 Mar 2026 14:46:38 -0600

On 26/02/23 05:17PM, Patrick Steinhardt wrote:
> 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