Gabriele Monaco <[email protected]> writes:
> +static inline struct da_monitor *da_create_storage(da_id_type id,
> +                                                monitor_target target,
> +                                                struct da_monitor *da_mon,
> +                                                gfp_t flags)
> +{
> +     struct da_monitor_storage *mon_storage;
> +
> +     if (da_mon)
> +             return da_mon;

I think this 'if' should be moved to da_create_conditional() instead,
because the "conditional" part should be implemented in the function
whose name includes "conditional". I think that would make the code
easier to follow, because one would already have a good guess what the
function does without looking into the details.
> +static inline bool da_handle_start_event(da_id_type id, monitor_target 
> target,
> +                                      enum events event)
> +{
> +     struct da_monitor *da_mon;
> +
> +     if (!da_monitor_enabled())
> +             return 0;
> +     guard(rcu)();
> +     da_mon = da_get_monitor(id, target);
> +     da_mon = da_monitor_start_hook(id, target, da_mon);

Do you plan this da_monitor_start_hook() macro to do anything other than
storage preparation? If not, perhaps it is better to name it
da_monitor_prepare_storage() or something like that, so that this is
easier to follow.

Nam

Reply via email to