Re: [PATCH GSoC v3 3/8] fetch-object-info: pass arguments directly instead of a struct
"Pablo Sabater" <[email protected]> Tue, 04 Aug 2026 17:34:36 +0200
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
On Tue Aug 4, 2026 at 5:23 PM CEST, Karthik Nayak wrote: > Pablo Sabater <[email protected]> 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]: > - 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/[email protected]= .net/ I'll reword it in the next reroll, Pablo