Kernel Programming: Finding the number of I/O requests

Hi

I'd like to know a logic or a strategy to count the number of I/O requests that are being made. I have the PID of the process for which this needed to be done. Does anyone have any clue as to how to do this? This is to be done in Kernel programming in C.

P.S:

This is to be done in linux 2.6.18...

I haven't ported my ancient utility to linux (yet), but a version of what you're interested in for the Mach microkernel as implemented in Tru64 AKA OSF/1 AKA Digital UNIX is available at ftp://raven.alaska.edu/pub/randy/perf_mon_tools/disks-1.0.README and ftp://raven.alaska.edu/pub/randy/perf_mon_tools/disks-1.0.tar.gz

Doubt that that helps, but it may give you an idea or two. Sorry I couldn't be of more help today.

Do you want a count of pending I/O requests or completed I/0 requests for a process?