left-shift the "else" part of the if(!lp_SubmitReconBuffer) condition.
Cleanup. No real functional changes, just more readable.
This commit is contained in:
parent
824f2ed930
commit
b7bb3e3c62
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: rf_reconstruct.c,v 1.61 2003/12/31 03:29:11 oster Exp $ */
|
||||
/* $NetBSD: rf_reconstruct.c,v 1.62 2003/12/31 03:51:28 oster Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1995 Carnegie-Mellon University.
|
||||
* All rights reserved.
|
||||
|
@ -33,7 +33,7 @@
|
|||
************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.61 2003/12/31 03:29:11 oster Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.62 2003/12/31 03:51:28 oster Exp $");
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sys/buf.h>
|
||||
|
@ -370,7 +370,8 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
/* wakeup anyone who might be waiting to do a reconstruct */
|
||||
RF_SIGNAL_COND(raidPtr->waitForReconCond);
|
||||
return(EIO);
|
||||
} else {
|
||||
}
|
||||
|
||||
/*
|
||||
* The current infrastructure only supports reconstructing one
|
||||
* disk at a time for each array.
|
||||
|
@ -395,15 +396,14 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
raidPtr->reconInProgress++;
|
||||
|
||||
|
||||
/* first look for a spare drive onto which to reconstruct
|
||||
the data. spare disk descriptors are stored in row 0.
|
||||
This may have to change eventually */
|
||||
/* first look for a spare drive onto which to reconstruct the
|
||||
data. spare disk descriptors are stored in row 0. This
|
||||
may have to change eventually */
|
||||
|
||||
/* Actually, we don't care if it's failed or not...
|
||||
On a RAID set with correct parity, this function
|
||||
should be callable on any component without ill affects. */
|
||||
/* RF_ASSERT(raidPtr->Disks[col].status == rf_ds_failed);
|
||||
*/
|
||||
/* Actually, we don't care if it's failed or not... On a RAID
|
||||
set with correct parity, this function should be callable
|
||||
on any component without ill affects. */
|
||||
/* RF_ASSERT(raidPtr->Disks[col].status == rf_ds_failed); */
|
||||
|
||||
if (raidPtr->Layout.map->flags & RF_DISTRIBUTE_SPARE) {
|
||||
RF_ERRORMSG1("Unable to reconstruct to disk at col %d: operation not supported for RF_DISTRIBUTE_SPARE\n", col);
|
||||
|
@ -438,8 +438,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
raidPtr->Disks[col].devname);
|
||||
#endif
|
||||
RF_UNLOCK_MUTEX(raidPtr->mutex);
|
||||
retcode = raidlookup(raidPtr->Disks[col].devname,
|
||||
proc, &vp);
|
||||
retcode = raidlookup(raidPtr->Disks[col].devname, proc, &vp);
|
||||
|
||||
if (retcode) {
|
||||
printf("raid%d: rebuilding: raidlookup on device: %s failed: %d!\n",raidPtr->raidid,
|
||||
|
@ -453,7 +452,6 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
return(retcode);
|
||||
|
||||
} else {
|
||||
|
||||
/* Ok, so we can at least do a lookup...
|
||||
How about actually getting a vp for it? */
|
||||
|
||||
|
@ -473,23 +471,20 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
return(retcode);
|
||||
}
|
||||
RF_LOCK_MUTEX(raidPtr->mutex);
|
||||
raidPtr->Disks[col].blockSize =
|
||||
dpart.disklab->d_secsize;
|
||||
raidPtr->Disks[col].blockSize = dpart.disklab->d_secsize;
|
||||
|
||||
raidPtr->Disks[col].numBlocks =
|
||||
dpart.part->p_size - rf_protectedSectors;
|
||||
raidPtr->Disks[col].numBlocks = dpart.part->p_size -
|
||||
rf_protectedSectors;
|
||||
|
||||
raidPtr->raid_cinfo[col].ci_vp = vp;
|
||||
raidPtr->raid_cinfo[col].ci_dev = va.va_rdev;
|
||||
|
||||
raidPtr->Disks[col].dev = va.va_rdev;
|
||||
|
||||
/* we allow the user to specify that only a
|
||||
fraction of the disks should be used this is
|
||||
just for debug: it speeds up
|
||||
* the parity scan */
|
||||
raidPtr->Disks[col].numBlocks =
|
||||
raidPtr->Disks[col].numBlocks *
|
||||
/* we allow the user to specify that only a fraction
|
||||
of the disks should be used this is just for debug:
|
||||
it speeds up * the parity scan */
|
||||
raidPtr->Disks[col].numBlocks = raidPtr->Disks[col].numBlocks *
|
||||
rf_sizePercentage / 100;
|
||||
RF_UNLOCK_MUTEX(raidPtr->mutex);
|
||||
}
|
||||
|
@ -499,11 +494,11 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
spareDiskPtr = &raidPtr->Disks[col];
|
||||
spareDiskPtr->status = rf_ds_used_spare;
|
||||
|
||||
printf("raid%d: initiating in-place reconstruction on column %d\n", raidPtr->raidid, col);
|
||||
printf("raid%d: initiating in-place reconstruction on column %d\n",
|
||||
raidPtr->raidid, col);
|
||||
|
||||
reconDesc = AllocRaidReconDesc((void *) raidPtr, col,
|
||||
spareDiskPtr, numDisksDone,
|
||||
col);
|
||||
reconDesc = AllocRaidReconDesc((void *) raidPtr, col, spareDiskPtr,
|
||||
numDisksDone, col);
|
||||
raidPtr->reconDesc = (void *) reconDesc;
|
||||
#if RF_RECON_STATS > 0
|
||||
reconDesc->hsStallCount = 0;
|
||||
|
@ -519,8 +514,6 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
|
|||
raidPtr->reconInProgress--;
|
||||
RF_UNLOCK_MUTEX(raidPtr->mutex);
|
||||
|
||||
}
|
||||
|
||||
if (!rc) {
|
||||
RF_LOCK_MUTEX(raidPtr->mutex);
|
||||
/* Need to set these here, as at this point it'll be claiming
|
||||
|
|
Loading…
Reference in New Issue