diff -aur -X diff-exclude 2.6.9-orig/fs/proc/proc_misc.c 2.6.9-limiter/fs/proc/proc_misc.c --- 2.6.9-orig/fs/proc/proc_misc.c 2004-10-18 17:53:21.000000000 -0400 +++ 2.6.9-limiter/fs/proc/proc_misc.c 2004-11-23 00:52:17.018038593 -0500 @@ -50,6 +50,8 @@ #include #include +#include "ubd_user.h" + #define LOAD_INT(x) ((x) >> FSHIFT) #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) /* @@ -247,6 +249,26 @@ .release = seq_release, }; +static int io_status_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + char str[256]; + + sprintf(str, "io_count=%d io_rate=%d io_tokens=%d token_refill=%d token_max=%d\n", + get_io_count(), + get_io_rate(), + get_io_tokens(), + get_token_refill(), + get_token_max() + ); + + strcpy(page, str); + len = strlen(page); + + return proc_calc_metrics(page, start, off, count, eof, len); +} + static int version_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -595,6 +617,7 @@ {"cmdline", cmdline_read_proc}, {"locks", locks_read_proc}, {"execdomains", execdomains_read_proc}, + {"io_status", io_status_read_proc}, {NULL,} }; for (p = simple_ones; p->name; p++)