On Wed, 30 Sep 2020 20:36:24 +0200 Johannes Berg wrote: > On Wed, 2020-09-30 at 09:44 -0700, Jakub Kicinski wrote: > > > I started with a get_policy() callback, but I didn't like it much. > > Static data is much more pleasant for a client of the API IMHO. > > Yeah, true. > > > What do you think about "ops light"? Insufficiently flexible? > > TBH, I'm not really sure how you'd do it?
There are very few users who actually access ops, I was thinking that callers to genl_get_cmd() should declare a full struct genl_ops on the stack (or in some context, not sure yet), and then genl_get_cmd() will fill it in. If family has full ops it will do a memcpy(); if the ops are "light" it can assign the right pointers. Plus it can propagate the policy and maxattr from family if needed in both cases. Don't have the code yet, but shouldnt take long to get a PoC...