Remove a 'struct proc *'-passing abomination that's been bugging me

for quite some time.
This commit is contained in:
oster 1999-08-14 03:10:03 +00:00
parent 4a058e82c5
commit 6409e641a6
6 changed files with 12 additions and 29 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_copyback.c,v 1.8 1999/08/13 03:41:53 oster Exp $ */
/* $NetBSD: rf_copyback.c,v 1.9 1999/08/14 03:10:03 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -123,7 +123,7 @@ rf_CopybackReconstructedData(raidPtr)
}
badDisk = &raidPtr->Disks[frow][fcol];
proc = raidPtr->proc; /* XXX Yes, this is not nice.. */
proc = raidPtr->engine_thread;
/* This device may have been opened successfully the first time. Close
* it before trying to open it again.. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_disks.c,v 1.12 1999/08/13 03:41:56 oster Exp $ */
/* $NetBSD: rf_disks.c,v 1.13 1999/08/14 03:10:03 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@ -377,7 +377,7 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col)
}
(void) strcpy(diskPtr->devname, p);
proc = raidPtr->proc; /* XXX Yes, this is not nice.. */
proc = raidPtr->engine_thread;
/* Let's start by claiming the component is fine and well... */
diskPtr->status = rf_ds_optimal;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_driver.c,v 1.14 1999/08/13 03:41:58 oster Exp $ */
/* $NetBSD: rf_driver.c,v 1.15 1999/08/14 03:10:03 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@ -331,7 +331,7 @@ rf_UnconfigureVnodes( raidPtr )
/* We take this opportunity to close the vnodes like we should.. */
p = raidPtr->proc; /* XXX */
p = raidPtr->engine_thread;
for (r = 0; r < raidPtr->numRow; r++) {
for (c = 0; c < raidPtr->numCol; c++) {
@ -417,7 +417,6 @@ rf_Configure(raidPtr, cfgPtr)
RF_RowCol_t row, col;
int i, rc;
int unit;
struct proc *p;
if (raidPtr->valid) {
RF_ERRORMSG("RAIDframe configuration not shut down. Aborting configure.\n");
@ -475,10 +474,8 @@ rf_Configure(raidPtr, cfgPtr)
/* XXX this clearing should be moved UP to outside of here.... that,
* or rf_Configure() needs to take more arguments... XXX */
unit = raidPtr->raidid;
p = raidPtr->proc; /* XXX save these... */
bzero((char *) raidPtr, sizeof(RF_Raid_t));
raidPtr->raidid = unit;
raidPtr->proc = p; /* XXX and then recover them.. */
DO_RAID_MUTEX(&raidPtr->mutex);
/* set up the cleanup list. Do this after ConfigureDebug so that
* value of memDebug will be set */

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.26 1999/08/14 02:41:36 oster Exp $ */
/* $NetBSD: rf_netbsdkintf.c,v 1.27 1999/08/14 03:10:03 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@ -789,16 +789,6 @@ raidioctl(dev, cmd, data, flag, p)
/* should do some kind of sanity check on the configuration.
* Store the sum of all the bytes in the last byte? */
#if 0
db1_printf(("Considering configuring the system.:%d 0x%x\n",
unit, p));
#endif
/* We need the pointer to this a little deeper, so stash it
* here... */
raidPtrs[unit]->proc = p;
/* configure the system */
raidPtrs[unit]->raidid = unit;
@ -846,7 +836,6 @@ raidioctl(dev, cmd, data, flag, p)
if (rf_debugKernelAccess) {
printf("call shutdown\n");
}
raidPtrs[unit]->proc = p; /* XXX necessary evil */
retcode = rf_Shutdown(raidPtrs[unit]);
@ -985,7 +974,7 @@ raidioctl(dev, cmd, data, flag, p)
}
/* borrow the thread of the requesting process */
raidPtrs[unit]->proc = p; /* Blah... :-p GO */
s = splbio();
retcode = rf_RewriteParity(raidPtrs[unit]);
splx(s);
@ -1006,7 +995,6 @@ raidioctl(dev, cmd, data, flag, p)
sparePtr = (RF_SingleComponent_t *) data;
memcpy( &hot_spare, sparePtr, sizeof(RF_SingleComponent_t));
printf("Adding spare\n");
raidPtrs[unit]->proc = p; /* Blah... :-p GO */
retcode = rf_add_hot_spare(raidPtrs[unit], &hot_spare);
return(retcode);
@ -1032,7 +1020,6 @@ raidioctl(dev, cmd, data, flag, p)
}
printf("Attempting a rebuild in place\n");
s = splbio();
raidPtrs[unit]->proc = p; /* Blah... :-p GO */
retcode = rf_ReconstructInPlace(raidPtrs[unit], row, column);
splx(s);
return(retcode);
@ -1170,7 +1157,7 @@ raidioctl(dev, cmd, data, flag, p)
}
/* borrow the current thread to get this done */
raidPtrs[unit]->proc = p; /* ICK.. but needed :-p GO */
s = splbio();
rf_CopybackReconstructedData(raidPtrs[unit]);
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_raid.h,v 1.6 1999/07/08 00:45:24 oster Exp $ */
/* $NetBSD: rf_raid.h,v 1.7 1999/08/14 03:10:04 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -222,7 +222,6 @@ struct RF_Raid_s {
int keep_acc_totals;
struct raidcinfo **raid_cinfo; /* array of component info */
struct proc *proc; /* XXX shouldn't be needed here.. :-p */
int terminate_disk_queues;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconstruct.c,v 1.7 1999/08/13 03:41:57 oster Exp $ */
/* $NetBSD: rf_reconstruct.c,v 1.8 1999/08/14 03:10:04 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -491,7 +491,7 @@ rf_ReconstructInPlace(raidPtr, row, col)
badDisk = &raidPtr->Disks[row][col];
proc = raidPtr->proc; /* XXX Yes, this is not nice.. */
proc = raidPtr->engine_thread;
/* This device may have been opened successfully the
first time. Close it before trying to open it again.. */