tech-kern archive

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

ataraid(4) and VOP_OPENing the same block device


for the past days I've been playing again with ataraid(4) and after adding
support for reading JMicron metadata, that was time for the Intel MatrixRAID.

Intel MatrixRAID offers a feature that allows you to create multiple volumes
on the same disks, so that you can for example have a RAID 0 volume
for half of the size and another RAID 1 volume for the other half.

Alright, the code I got is almost ready for own consumption.

ataraid0: found 2 RAID volumes
ld0 at ataraid0 vendtype 5 unit 0: Intel MatrixRAID ATA RAID-0 array < wd3 wd4 >
ld0: 233 GB, 30416 cyl, 255 head, 63 sec, 512 bytes/sect x 488636416 sectors
ld1 at ataraid0 vendtype 5 unit 1: Intel MatrixRAID ATA RAID-1 array < wd3 wd4 >
ld1: disabled

But the problem is that I can't use multiple volumes, because this VOP_OPEN
in ld_ataraid.c returns EBUSY:

         * Configure all the component disks.
        for (i = 0; i < aai->aai_ndisks; i++) {
                adi = &aai->aai_disks[i];
                int bmajor, error;
                dev_t dev;

                bmajor = devsw_name2blk(device_xname(adi->adi_dev), NULL, 0);
                dev = MAKEDISKDEV(bmajor, device_unit(adi->adi_dev), RAW_PART);
                error = bdevvp(dev, &vp);
                if (error)
                error = VOP_OPEN(vp, FREAD|FWRITE, NOCRED);
                if (error) {
                         * XXX This is bogus.  We should just mark the
                         * XXX component as FAILED, and write-back new
                         * XXX config blocks.

                VOP_UNLOCK(vp, 0);
                sc->sc_vnodes[i] = vp;

The question is, is there any way to open the same VBLK vnode for the same
device multiple times, to allow Intel MatrixRAID to fully exploit this feature?

Please add me to CC, I'm not subscribed... thanks.

Home | Main Index | Thread Index | Old Index