Re: [PATCH 08/17] odb/source: make `close()` function pluggable
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Mar 4, 2026, 21:03 UTC
- Message-ID
- <aaidbdpkpH7tfn9x@denethor>
- In-Reply-To
- <20260223-b4-pks-odb-source-pluggable-v1-8-253bac1db598@pks.im>
On 26/02/23 05:17PM, Patrick Steinhardt wrote:
Show 5 quoted lines
> Introduce a new callback function in `struct odb_source` to make the > function pluggable. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > ---
[snip]
Show 9 quoted lines
> +/*
> + * Close the object database source without releasing he underlying data. The
> + * source can still be used going forward, but it first needs to be reopened.
> + * This can be useful to reduce resource usage.
> + */
> +static inline void odb_source_close(struct odb_source *source)
> +{
> + source->close(source);
> +}Just to be safe, should we BUG()/ASSERT() in case the provide source is NULL? Or do we expect the calling pattern to always provide an actual source?
-Justin