Re: [PATCH 5/5] odb: make creation of on-disk structures pluggable

Patrick Steinhardt <[email protected]> Tue, 4 Aug 2026 09:21:15 +0200
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
On Sun, Jul 26, 2026 at 01:42:09PM -0700, Junio C Hamano wrote:
> Patrick Steinhardt <[email protected]> writes:
> > @@ -271,6 +289,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,
> >  
> >  	files->base.free = odb_source_files_free;
> >  	files->base.close = odb_source_files_close;
> > +	files->base.create_on_disk = odb_source_files_create_on_disk;
> >  	files->base.prepare = odb_source_files_prepare;
> >  	files->base.read_object_info = odb_source_files_read_object_info;
> >  	files->base.read_object_stream = odb_source_files_read_object_stream;
> 
> If we are going to write a brand new object backing store that does
> not use an on-disk filesystem (or a network filesystem, for that
> matter) but still requires some sort of "initialization", for
> example, an object database in the cloud that needs provisioning
> before its first use, would this virtual function be the ideal place
> to do so?

It would, even though...

> I wonder if we can give it a name better suited to its purpose by
> moving away from the '_on_disk' suffix.

... the name is admittedly a bit misleading. I couldn't really come up
with a better name though, and the `on_disk()` suffix is what we already
use in the reference subsystem, too (see `ref_store_create_on_disk()`).
So I'm inclined to leave the name as-is for the sake of consistency.

Patrick