On Wed, 10/08 11:05, Benoît Canet wrote: > On Wed, Oct 08, 2014 at 02:53:38PM +0800, Fam Zheng wrote: > > > > Does this mean that after this series, all the throttle_states must be > > contained inside its own throttle group? If so, we could embed ThrottleGroup > > fields in ThrottleState. > > > > It's weird when a function called throttle_group_compare takes a parameter > > of > > ThrottleState pointer, and cast it back to ThrottleGroup with container_of. > > It's done like this to fullfill a design goal: the throttle should be reusable > without the groups and any reference to block related stuff. > So it's just a way to split the responsabilities.
I see. Having both ThrottleGroup and ThrottleState interfaces is more complicated than just use ThrottleGroup, where a one-member group is exactly the same as ThrottleState. Fam