Lokking at 2.5.17 I see the following:
-#define QUOTAFILENAME "quota"
-#define QUOTAGROUP "staff"
As usuall we can see what goes to /proc is apparently
random bulls*it as always. I love in esp. the assumption about
some group name on a system!
But it get's removed this time. So let's peer where
it get's reintroduced:
Ah... yes, patch-2.5.17, here it is:
+#ifdef CONFIG_PROC_FS
+static int read_stats(char *buffer, char **start, off_t offset, int count, int
*eof, void *data)
+{
+
int len;
+
struct quota_format_type *actqf;
+
+
dqstats.allocated_dquots = nr_dquots;
+
dqstats.free_dquots = nr_free_dquots;
+
+
len = sprintf(buffer, "Version %u\n", __DQUOT_NUM_VERSION__);
+
len += sprintf(buffer + len, "Formats");
+
lock_kernel();
+
for (actqf = quota_formats; actqf; actqf = actqf->qf_next)
+
len += sprintf(buffer + len, " %u", actqf->qf_fmt_id);
unlock_kernel();
-
return ret;
+
len += sprintf(buffer + len, "\n%u %u %u %u %u %u %u %u\n",
+
dqstats.lookups, dqstats.drops,
+
dqstats.reads, dqstats.writes,
+
dqstats.cache_hits, dqstats.allocated_dquots,
+
dqstats.free_dquots, dqstats.syncs);
+
+
if (offset >= len) {
+
*start = buffer;
+
*eof = 1;
+
return 0;
+
}
+
*start = buffer + offset;
+
if ((len -= offset) > count)
+
return count;
+
*eof = 1;
+
+
return len;
+}
+#endif
What can we see in the above:
1. Those are first grade candidates for sysctl read-only entires, since they
are system global statistics which should belong to /proc/sys/fs/
We even have already fs.dquot-nr there! Why the hell don't put them
alongside?
2. Typical string formating and value copy and termination
problems inherent to string stuff...
3. The futile hope that tools using it will even bother to check the
Version... gtop just *right today* showed that user space programmers
won't care about it, so it gains us literally *nothing*.
If it where sysctl numbers they would just vanish beneath them if something
changed semantincally and they *would have no chance* to do it wrong.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/