version 1.16.2.2.2.1, 1999/06/21 01:18:58 |
version 1.16.2.2.2.2, 1999/08/02 22:05:32 |
Line 268 struct raid_softc { |
|
Line 268 struct raid_softc { |
|
#define raidunit(x) DISKUNIT(x) |
#define raidunit(x) DISKUNIT(x) |
static int numraid = 0; |
static int numraid = 0; |
|
|
|
/* |
|
* Allow RAIDOUTSTANDING number of simultaneous IO's to this RAID device. |
|
* Be aware that large numbers can allow the driver to consume a lot of |
|
* kernel memory, especially on writes... |
|
*/ |
|
|
|
#ifndef RAIDOUTSTANDING |
|
#define RAIDOUTSTANDING 10 |
|
#endif |
|
|
#define RAIDLABELDEV(dev) \ |
#define RAIDLABELDEV(dev) \ |
(MAKEDISKDEV(major((dev)), raidunit((dev)), RAW_PART)) |
(MAKEDISKDEV(major((dev)), raidunit((dev)), RAW_PART)) |
|
|
Line 673 raidioctl(dev, cmd, data, flag, p) |
|
Line 683 raidioctl(dev, cmd, data, flag, p) |
|
int retcode = 0; |
int retcode = 0; |
int row; |
int row; |
int column; |
int column; |
|
int s; |
struct rf_recon_req *rrcopy, *rr; |
struct rf_recon_req *rrcopy, *rr; |
RF_ComponentLabel_t *component_label; |
RF_ComponentLabel_t *component_label; |
RF_ComponentLabel_t ci_label; |
RF_ComponentLabel_t ci_label; |
Line 790 raidioctl(dev, cmd, data, flag, p) |
|
Line 801 raidioctl(dev, cmd, data, flag, p) |
|
/* configure the system */ |
/* configure the system */ |
|
|
raidPtrs[unit]->raidid = unit; |
raidPtrs[unit]->raidid = unit; |
|
|
retcode = rf_Configure(raidPtrs[unit], k_cfg); |
retcode = rf_Configure(raidPtrs[unit], k_cfg); |
|
|
|
/* allow this many simultaneous IO's to this RAID device */ |
|
raidPtrs[unit]->openings = RAIDOUTSTANDING; |
|
|
if (retcode == 0) { |
if (retcode == 0) { |
retcode = raidinit(dev, raidPtrs[unit], unit); |
retcode = raidinit(dev, raidPtrs[unit], unit); |
Line 1011 raidioctl(dev, cmd, data, flag, p) |
|
Line 1025 raidioctl(dev, cmd, data, flag, p) |
|
return(EINVAL); |
return(EINVAL); |
} |
} |
printf("Attempting a rebuild in place\n"); |
printf("Attempting a rebuild in place\n"); |
|
s = splbio(); |
raidPtrs[unit]->proc = p; /* Blah... :-p GO */ |
raidPtrs[unit]->proc = p; /* Blah... :-p GO */ |
retcode = rf_ReconstructInPlace(raidPtrs[unit], row, column); |
retcode = rf_ReconstructInPlace(raidPtrs[unit], row, column); |
|
splx(s); |
return(retcode); |
return(retcode); |
|
|
/* issue a test-unit-ready through raidframe to the indicated |
/* issue a test-unit-ready through raidframe to the indicated |
Line 1135 raidioctl(dev, cmd, data, flag, p) |
|
Line 1151 raidioctl(dev, cmd, data, flag, p) |
|
case RAIDFRAME_COPYBACK: |
case RAIDFRAME_COPYBACK: |
/* borrow the current thread to get this done */ |
/* borrow the current thread to get this done */ |
raidPtrs[unit]->proc = p; /* ICK.. but needed :-p GO */ |
raidPtrs[unit]->proc = p; /* ICK.. but needed :-p GO */ |
|
s = splbio(); |
rf_CopybackReconstructedData(raidPtrs[unit]); |
rf_CopybackReconstructedData(raidPtrs[unit]); |
|
splx(s); |
return (0); |
return (0); |
|
|
/* return the percentage completion of reconstruction */ |
/* return the percentage completion of reconstruction */ |
Line 1476 rf_DoAccessKernel(raidPtr, bp, flags, cb |
|
Line 1494 rf_DoAccessKernel(raidPtr, bp, flags, cb |
|
} |
} |
db1_printf(("Calling DoAccess..\n")); |
db1_printf(("Calling DoAccess..\n")); |
|
|
|
|
|
/* Put a throttle on the number of requests we handle simultanously */ |
|
|
|
RF_LOCK_MUTEX(raidPtr->mutex); |
|
|
|
while(raidPtr->openings <= 0) { |
|
RF_UNLOCK_MUTEX(raidPtr->mutex); |
|
(void)tsleep(&raidPtr->openings, PRIBIO, "rfdwait", 0); |
|
RF_LOCK_MUTEX(raidPtr->mutex); |
|
} |
|
raidPtr->openings--; |
|
|
|
RF_UNLOCK_MUTEX(raidPtr->mutex); |
|
|
/* |
/* |
* XXX For now, all writes are sync |
* Everything is async. |
*/ |
*/ |
do_async = 1; |
do_async = 1; |
if ((bp->b_flags & B_READ) == 0) |
|
do_async = 0; |
|
|
|
/* don't ever condition on bp->b_flags & B_WRITE. always condition on |
/* don't ever condition on bp->b_flags & B_WRITE. always condition on |
* B_READ instead */ |
* B_READ instead */ |
Line 1496 rf_DoAccessKernel(raidPtr, bp, flags, cb |
|
Line 1526 rf_DoAccessKernel(raidPtr, bp, flags, cb |
|
bp->b_data, (int) bp->b_resid)); |
bp->b_data, (int) bp->b_resid)); |
#endif |
#endif |
|
|
/* |
|
* If we requested sync I/O, sleep here. |
|
*/ |
|
if ((retcode == 0) && (do_async == 0)) |
|
tsleep(bp, PRIBIO, "raidsyncio", 0); |
|
|
|
return (retcode); |
return (retcode); |
} |
} |
/* invoke an I/O from kernel mode. Disk queue should be locked upon entry */ |
/* invoke an I/O from kernel mode. Disk queue should be locked upon entry */ |