--- linode27/fs/proc/proc_misc.c 2003-11-28 13:26:21.000000000 -0500 +++ linode28/fs/proc/proc_misc.c 2004-05-18 16:32:29.998964120 -0400 @@ -42,6 +42,8 @@ #include #include +#include "ubd_user.h" + #define LOAD_INT(x) ((x) >> FSHIFT) #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) /* @@ -215,6 +217,26 @@ #undef K } +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) { @@ -621,6 +643,7 @@ {"locks", locks_read_proc}, {"swaps", swaps_read_proc}, {"execdomains", execdomains_read_proc}, + {"io_status", io_status_read_proc}, {NULL,} }; for (p = simple_ones; p->name; p++)