I am writing a storage filter driver and need to keep track of all
read/write
requests. So for every device (volume) that I monitor, I have a small cache
in the device object (in device extension). As soon as a read/write request
comes in, I add this info to this cache.
I need to synchronize access to this cache. So I have a mutex (wont work on
multiprocessor but this is just a demo) which guards the code that
manipulates
the cache. All this is working fine but I am kind of doubtful about this
access
to the cache.
Since I am adding this synchronization object to keep track of the IRP’s,
I am kind of slowing down the behavior because of the synchronized access
to the cache. Every Read/Write request will have to wait to access this
cache.
So I am kind of skeptical about this design. Is there a better way to do
this?
I feel that the IRP’s being “tunnelled” thru will affect overall
performance.
Thanks,
Gary.