tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ataraid(4) and VOP_OPENing the same block device




On Aug,Tuesday 26 2008, at 7:18 PM, Juan Romero Pardines wrote:

2008/8/26 Adam Hamsik <haaaad%gmail.com@localhost>:

I think that it is not possible to VOP_OPEN block device more than once,
but you can open raw devices  as many times as you want.

In my device-mapper driver I created
struct pdev {
      struct vnode pdev_vnode;
      . . .
};

Which is in SLIST shared between all dm devices in system. When dm device is created I VOP_OPEN selected disk device and add it's vnode to pdev SLIST. When another dm device with same disk is created I search SLIST list for
vnode
return it. You can look at this code at haad-dm branch in
sys/dev/dm/dm_pdev.c.

You probably need to do the same in ld0, or you can use device- mapper to do
it
for you and only write own target.

Thanks for the suggestion, but this won't work with the ld(4) driver where
it uses the d_strategy method of bdevsw extensively.

You mean ldstrategy in ld(4) driver here ?


I should note that just after I encountered this problem, my next step was to use the character device... but I noticed that it doesn't have the d_strategy
method.

read and write calls on raw devices are transformed to strategy call by physio routine.

Regards

Adam.



Home | Main Index | Thread Index | Old Index