Re: [PATCH v5 01/15] packfile: introduce a new `struct packfile_store`
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Sep 17, 2025, 21:26 UTC
- Message-ID
- <hez25mocjub4zswsptv4j5etgygavllfai6zb6h2tdln2xhmo6@kjvvzrbjmilc>
- In-Reply-To
- <20250915-b4-pks-packfiles-store-v5-1-d6340350934f@pks.im>
On 25/09/15 10:54AM, Patrick Steinhardt wrote:
> Information about a object database's packfiles is currently distributed
s/a object/an object/
Show 33 quoted lines
> across two different structures: > > - `struct packed_git` contains the `next` pointer as well as the > `mru_head`, both of which serve to store the list of packfiles. > > - `struct object_database` contains several fields that relate to the > packfiles. > > So we don't really have a central data structure that tracks our > packfiles, and consequently responsibilities aren't always clear cut. > A consequence for the upcoming pluggable object databases is that this > makes it very hard to move management of packfiles from the object > database level down into the object database source. > > Introduce a new `struct packfile_store` which is about to become the > single source of truth for managing packfiles. Right now this data > structure doesn't yet contain anything, but in subsequent patches we > will move all data structures that relate to packfiles and that are > currently contained in `struct object_database` into this new home. > > Note that this is only a first step: most importantly, we won't (yet) > move the `struct packed_git::next` pointer around. This will happen in a > subsequent patch series though so that `struct packed_git` will really > only host information about the specific packfile it represents. > > Further note that the new structure still sits at the wrong level at the > end of this patch series: as mentioned, it should eventually sit at the > level of the object database source, not at the object database level. > But introducing the packfile store now already makes it way easier to > eventually push down the now-selfcontained data structure by one level. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > ---
[snip]
Show 5 quoted lines
> @@ -91,6 +91,7 @@ struct odb_source {
> };
>
> struct packed_git;
> +struct packfile_store;I find it a bit suprising that we already add a `struct packfile_store` to `struct odb_source` since it doesn't get wired up yet. I suppose it's just acting as a placeholder for what's to come though.
> struct cached_object_entry;
-Justin