Re: [PATCH v2 04/17] odb/source-packed: store pointer to "files" instead of generic source
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 17, 2026, 07:26 UTC
- Message-ID
- <ajJMQfXpPNlxqhNa@pks.im>
- In-Reply-To
- <ajG69JZHx_u2mt7q@denethor>
On Tue, Jun 16, 2026 at 04:14:02PM -0500, Justin Tobler wrote:
> On 26/06/09 10:50AM, Patrick Steinhardt wrote:
[snip]
Show 17 quoted lines
> > Detangling this mess is somewhat intricate though, and is made even more > > intricate because it's not always clear which kind of source one is > > holding at a specific point in time -- either the parent "files" source, > > or the child "packed" source. > > > > Make this relationship more explicit by storing a pointer to the "files" > > source instead of storing a pointer to a generic `struct odb_source`. > > This will help make subsequent steps a bit clearer. > > > > Note that this is a temporary step, only. At the end of this series > > we will have dropped the parent pointer completely. > > Ok, so IIUC the eventual goal is to get rid of the pointer entirely, but > for now we are just making its concrete type explicit without having to > downcast. It's not immediately obvious to me how this step gets us > closer to that goal, but that may become more obvious in the next > patches. :)
The reason this helps is that during the intermediate steps, it's at times very hard to see which source you're holding if we have both the generic `base` and the generic `parent` pointer. That makes it quite easy to confuse those two. So by turning the latter into the `files` source, some of the intermediate steps become easier to reason about.
Patrick