Looking at data structures in the block layer
Dealing with block devices is fairly complex as the kernel has to implement features such as queue management, scheduling, and the ability to access data randomly. The speed of block devices is much higher than character devices. This makes block devices extremely performance-sensitive and the kernel has to make intelligent decisions to extract their maximum performance. Thus, it makes sense to handle the two devices differently. Because of this, there is an entire kernel subsystem dedicated to managing block devices. All this makes the block layer the most sophisticated piece of code in the Linux kernel.
Throughout this book, we’ve referred to the relevant pieces of kernel code so that you can familiarize yourself with the implementations of certain concepts. If you’re interested in pursuing kernel development, this may seem like a good starting point. However, if you are more focused on theoretical understanding, the...