+
+}
+
+/*
+ * We sum two kinds of stats - one that is time based, in which case we
+ * apply the proper summing technique, and then one that is iops/bw
+ * numbers. For group_reporting, we should just add those up, not make
+ * them the mean of everything.
+ */
+static void sum_stat(struct io_stat *dst, struct io_stat *src, bool first,
+ bool pure_sum)
+{
+ if (src->samples == 0)
+ return;
+
+ if (!pure_sum) {
+ __sum_stat(dst, src, first);
+ return;
+ }
+
+ if (first) {
+ dst->min_val = src->min_val;
+ dst->max_val = src->max_val;
+ dst->samples = src->samples;
+ dst->mean.u.f = src->mean.u.f;
+ dst->S.u.f = src->S.u.f;
+ } else {
+ dst->min_val += src->min_val;
+ dst->max_val += src->max_val;
+ dst->samples += src->samples;
+ dst->mean.u.f += src->mean.u.f;
+ dst->S.u.f += src->S.u.f;
+ }