tech-kern archive

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

Re: [patch] - add support for >2TB raid devices



In article <10782.1287539407%splode.eterna.com.au@localhost>,
matthew green  <mrg%eterna.com.au@localhost> wrote:
>
>hi folks.
>
[:stuff deleted:]
>
>i have a slightly different version of this in testing for netbsd-5
>as well (netbsd-5 has no getdisksize(9)) and will send pullups for
>that when i'm more confident.  you can find that patch at:
>
>       http://www.netbsd.org/~mrg/rf-2tb-netbsd-5.diff
>
>for anyone extremely keen.

Thank, great stuff. I have to go and buy myself some disks now!

christos

>+      if (c_label->version == RF_COMPONENT_LABEL_VERSION)
>+              c_label->partitionSizeHi =
>+                  raidPtr->Disks[fcol].partitionSize >> 32;

All these tests should really be:

+       if (c_label->version > RF_COMPONENT_LABEL_VERSION_1)
+               c_label->partitionSizeHi =
+                   raidPtr->Disks[fcol].partitionSize >> 32;

because if you bump the version to version 3, then you will
not execute the code for version 2 which already supported it.

>!              blocknum = bp->b_blkno << DEV_BSHIFT >> 
>raidPtr->logBytesPerSector;

This should be a macro:

#define BLOCK_TO_SECTOR(block, bytes_per_sector) \
        (((block) << DEV_BSHIFT) >> (bytes_per_sector))

>!      bp->b_blkno = startSect << logBytesPerSector >> DEV_BSHIFT;

And this:

#define SECTOR_TO_BLOCK(sector, bytes_per_sector) \
        (((sector) << (bytes_per_sector)) >> DEV_BSHIFT)


christos



Home | Main Index | Thread Index | Old Index