Re: [PATCH GSoC v3 3/8] fetch-object-info: pass arguments directly instead of a struct
- From
Pablo Sabater <pabloosabaterr@gmail.com>
- Date
- Aug 4, 2026, 15:34 UTC
- Message-ID
- <DKG9PMUYWK0O.NJ4R6R7H9J0G@gmail.com>
- In-Reply-To
- <CAOLa=ZQbbziEK8HiPU7Lpsn0NmWfEnh=-L4wSBFt4qHJWAbJHw@mail.gmail.com>
On Tue Aug 4, 2026 at 5:23 PM CEST, Karthik Nayak wrote:
Show 11 quoted lines
> Pablo Sabater <pabloosabaterr@gmail.com> writes: > >> struct object_info_args groups three pointers that already live in the >> transport and are given to fetch_object_info(). >> Grouping them into a struct reduces the number of parameters, but it >> suggests that fetch_object_info() uses all three of them. >> > > But it does use all of them, no? Not sure I follow the reasoning here. > > [snip]
Yes, I meant that it suggests the three of them are used together, but in the end everything is accessed as args->*.
And because object_info_args is built just before calling fetch_object_info() it doesn't make much sense.
citing Peff [1]:
Show 7 quoted lines
> - there are a lot of semi-opaque structs, like object_info_args. It > would seem simpler to me to pass those elements around independently > to the functions that need them. Likewise, we seem to stuff a lot of > data into the transport struct rather than passing it to the > relevant functions, even though many of those elements are really > just used for one function call, and aren't a property of the > transport at all.
[1]: https://lore.kernel.org/git/20260802154309.GA17844@coredump.intra.peff.net/
I'll reword it in the next reroll, Pablo