Got user space pullreq.
One idea. You add _one_ struct metric to kmetrics struct
with one additonal flag "more". Read from it fetches head of list of errors
and drops it. So, when reading metrics users space doing one
read gets the first element and indication that there are more.
If there are mor
Also:
+ spin_lock(&metrics->lock);
+
+ list_for_each_entry(metric, &metrics->fuse_rpc_error_metric_list, list)
+ if (pcs_netaddr_cmp_ignore_port(&metric->m.addr, addr) == 0)
+ goto out;
+
+ metric = kzalloc(sizeof(*metric), GFP_KERNEL);
You ca
Hello!
Technical question:
metric = fuse_rpc_error_metric_get_or_create(metrics, addr);
What does protect metric to be freed right here? I do not see any
refcnt, rcu. Anything?
+ if (metric)
+ metric->m.err[err] += val;
IMHO just increase is under spinlock. You saved