On Mon, Oct 4, 2010 at 5:46 PM, Steven Y. Ko <stevko@xxxxxxxxxxx> wrote: > Hi, > > I am trying to write a virtual device that pretty much does nothing > but inserting itself between a disk device and the filesystem using > the disk device (for now, but later will do some stuff). So it needs > to sit in the normal path and pass everything down. Since it seemed to > me that DRBD is the closest to what I'm trying to do, I took a look. I > must admit that I'm not understanding the whole thing yet, but it uses > bd_claim() & generic_make_request(), and a filesystem would be mounted > on the virtual device. > > So I wonder if this is the way to go. It seems that if you use > generic_make_request() in the virtual device, then you might have to > go through the generic block layer twice, one on the way from the > filesystem to the virtual device, and again on the way from the > virtual device to the actual device. Am I understanding correct? > > Thanks in advance for any information. > > - Steve Steve, drbd got into the kernel despite its architecture, not because of it. I recommend not modeling your code on it if you want to eventually try to get it into vanilla. Assuming your goal is to develop a virtual device that will fit into the kernel block stack 2.6.x way, then I would look at writting a plug-in for device mapper (dm). dm will provide most of the block layer interfacing and you just have to concentrate on your device's logic. dm plug-ins for lots of functionality already exist as well, so you may be able to find one that is closer to what you're trying to do. Greg -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ