- int nob = 0;
-/*
- lookup hit total cached create
- env: ...... ...... ...... ...... ......
-*/
- if (h)
- nob += snprintf(page, count,
- " lookup hit total busy create\n");
-
- nob += snprintf(page + nob, count - nob,
- "%5.5s: %6u %6u %6u %6u %6u",
- cs->cs_name,
- cfs_atomic_read(&cs->cs_lookup),
- cfs_atomic_read(&cs->cs_hit),
- cfs_atomic_read(&cs->cs_total),
- cfs_atomic_read(&cs->cs_busy),
- cfs_atomic_read(&cs->cs_created));
- return nob;
+ int nob = 0;
+ int i;
+ /*
+ * lookup hit total cached create
+ * env: ...... ...... ...... ...... ......
+ */
+ if (h) {
+ const char *names[CS_NR] = CS_NAMES;
+
+ nob += snprintf(page + nob, count - nob, "%6s", " ");
+ for (i = 0; i < CS_NR; i++)
+ nob += snprintf(page + nob, count - nob,
+ "%8s", names[i]);
+ nob += snprintf(page + nob, count - nob, "\n");
+ }
+
+ nob += snprintf(page + nob, count - nob, "%5.5s:", cs->cs_name);
+ for (i = 0; i < CS_NR; i++)
+ nob += snprintf(page + nob, count - nob, "%8u",
+ cfs_atomic_read(&cs->cs_stats[i]));
+ return nob;