Reputation: 185
I was searching for a way to find out the length of a request_queue (that is defined as a structure in linux/include/linux/blkdev.h). However I am new to the kernel development and can't figure out where is the actual list of requests to be processed by an elevator. Is there a way to iterate requests in a queue or at least find a number of them?
Upvotes: 0
Views: 295
Reputation: 13786
The requests of a queue are linked by struct list_head queue_head
. You can iterating all the request using the linked list functions, you can see some examples here:
http://lxr.free-electrons.com/source/include/linux/blkdev.h?v=2.4.37#L271
Upvotes: 1