Re: [PATCH v3 1/6] odb: introduce interface to generate packfiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




On Thu, Aug 20, 2026 at 03:16:37AM -0700, Karthik Nayak wrote:
> Patrick Steinhardt <ps@xxxxxx> writes:
> > diff --git a/odb/source.h b/odb/source.h
> > index d69f8e2d1c..e2129766fc 100644
> > --- a/odb/source.h
> > +++ b/odb/source.h
> > @@ -278,6 +278,23 @@ struct odb_source {
> > 	 */
> > 	bool (*optimize_required)(struct odb_source *source,
> > 				 const struct odb_optimize_options *opts);
> > +
> > +	/*
> > +	 * This callback is expected to start generating a packfile with the
> > +	 * given options. The pack shall be generated asynchronously so that
> > +	 * the caller can consume the pack data and progress output while the
> > +	 * pack is being generated.
> > +	 *
> > +	 * This callback is optional. Sources that cannot generate packfiles
> > +	 * shall leave it unset.
> > +	 *
> > +	 * The callback is expected to return 0 on success and populate the
> > +	 * `out` pointer with the pack generator, a negative error code
> > +	 * otherwise.
> > +	 */
> > +	int (*generate_pack)(struct odb_source *source,
> > +			 struct odb_pack_generator **out,
> > +			 const struct odb_generate_pack_options *opts);
> > };
> >
>
> Nit: I see that `source` is unused anyways, do we need to pass it in? Or
> is just for consistency?
Our specific implementation does not use it, but others might want. So
it's mostly for consistency to give the callback enough context.
Patrick

[Index of Archives] [Linux Kernel Development] [Gcc Help] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [V4L] [Bugtraq] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [Fedora Users]

(追記) (追記ここまで)
Powered by Linux

AltStyle によって変換されたページ (->オリジナル) /