This is the source for the "simple block driver" example, which is discussed in detail in this article, which is part of the the LWN.net Porting Drivers to 2.6 Series.