summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authorfvdl <fvdl@NetBSD.org>2003-06-29 22:28:00 +0000
committerfvdl <fvdl@NetBSD.org>2003-06-29 22:28:00 +0000
commitd5aece61d61067d5dd5a0b762c965fbe106fce67 (patch)
tree3fd429cd1fc49cc0e1ed7c45b1a2d185123e8eb5 /sys/dev/raidframe
parent7a5f4f28d0360a953535b84ac213ee6ed4044466 (diff)
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_copyback.c15
-rw-r--r--sys/dev/raidframe/rf_disks.c15
-rw-r--r--sys/dev/raidframe/rf_kintf.h4
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c48
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c16
5 files changed, 46 insertions, 52 deletions
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c
index 545dd4e8c8a..8072028b002 100644
--- a/sys/dev/raidframe/rf_copyback.c
+++ b/sys/dev/raidframe/rf_copyback.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_copyback.c,v 1.24 2003/06/28 14:21:42 darrenr Exp $ */
+/* $NetBSD: rf_copyback.c,v 1.25 2003/06/29 22:30:32 fvdl Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -38,7 +38,7 @@
****************************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.24 2003/06/28 14:21:42 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.25 2003/06/29 22:30:32 fvdl Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -99,7 +99,7 @@ rf_CopybackReconstructedData(raidPtr)
struct partinfo dpart;
struct vnode *vp;
struct vattr va;
- struct lwp *l;
+ struct proc *proc;
int ac;
@@ -123,7 +123,7 @@ rf_CopybackReconstructedData(raidPtr)
}
badDisk = &raidPtr->Disks[frow][fcol];
- l = LIST_FIRST(&raidPtr->engine_thread->p_lwps);
+ proc = raidPtr->engine_thread;
/* This device may have been opened successfully the first time. Close
* it before trying to open it again.. */
@@ -143,7 +143,7 @@ rf_CopybackReconstructedData(raidPtr)
printf("About to (re-)open the device: %s\n",
raidPtr->Disks[frow][fcol].devname);
- retcode = raidlookup(raidPtr->Disks[frow][fcol].devname, l, &vp);
+ retcode = raidlookup(raidPtr->Disks[frow][fcol].devname, proc, &vp);
if (retcode) {
printf("raid%d: copyback: raidlookup on device: %s failed: %d!\n",
@@ -159,12 +159,11 @@ rf_CopybackReconstructedData(raidPtr)
/* Ok, so we can at least do a lookup... How about actually
* getting a vp for it? */
- if ((retcode = VOP_GETATTR(vp, &va,
- l->l_proc->p_ucred, l)) != 0) {
+ if ((retcode = VOP_GETATTR(vp, &va, proc->p_ucred, proc)) != 0) {
return;
}
retcode = VOP_IOCTL(vp, DIOCGPART, &dpart,
- FREAD, l->l_proc->p_ucred, l);
+ FREAD, proc->p_ucred, proc);
if (retcode) {
return;
}
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 88db78a0f9c..0c80ad43f30 100644
--- a/sys/dev/raidframe/rf_disks.c
+++ b/sys/dev/raidframe/rf_disks.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_disks.c,v 1.43 2003/06/28 14:21:42 darrenr Exp $ */
+/* $NetBSD: rf_disks.c,v 1.44 2003/06/29 22:30:32 fvdl Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -67,7 +67,7 @@
***************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.43 2003/06/28 14:21:42 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.44 2003/06/29 22:30:32 fvdl Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -613,7 +613,7 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col)
struct partinfo dpart;
struct vnode *vp;
struct vattr va;
- struct lwp *l;
+ struct proc *proc;
int error;
p = rf_find_non_white(buf);
@@ -623,7 +623,7 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col)
}
(void) strcpy(diskPtr->devname, p);
- l = LIST_FIRST(&raidPtr->engine_thread->p_lwps);
+ proc = raidPtr->engine_thread;
/* Let's start by claiming the component is fine and well... */
diskPtr->status = rf_ds_optimal;
@@ -631,7 +631,7 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col)
raidPtr->raid_cinfo[row][col].ci_vp = NULL;
raidPtr->raid_cinfo[row][col].ci_dev = NULL;
- error = raidlookup(diskPtr->devname, l, &vp);
+ error = raidlookup(diskPtr->devname, proc, &vp);
if (error) {
printf("raidlookup on device: %s failed!\n", diskPtr->devname);
if (error == ENXIO) {
@@ -643,12 +643,11 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col)
}
if (diskPtr->status == rf_ds_optimal) {
- if ((error = VOP_GETATTR(vp, &va,
- l->l_proc->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vp, &va, proc->p_ucred, proc)) != 0) {
return (error);
}
error = VOP_IOCTL(vp, DIOCGPART, &dpart,
- FREAD, l->l_proc->p_ucred, l);
+ FREAD, proc->p_ucred, proc);
if (error) {
return (error);
}
diff --git a/sys/dev/raidframe/rf_kintf.h b/sys/dev/raidframe/rf_kintf.h
index f5047a3a69a..566ed472418 100644
--- a/sys/dev/raidframe/rf_kintf.h
+++ b/sys/dev/raidframe/rf_kintf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_kintf.h,v 1.17 2003/06/28 14:21:42 darrenr Exp $ */
+/* $NetBSD: rf_kintf.h,v 1.18 2003/06/29 22:30:32 fvdl Exp $ */
/*
* rf_kintf.h
*
@@ -47,7 +47,7 @@ int raidread_component_label(dev_t, struct vnode *, RF_ComponentLabel_t *);
#define RF_NORMAL_COMPONENT_UPDATE 0
#define RF_FINAL_COMPONENT_UPDATE 1
void rf_update_component_labels(RF_Raid_t *, int);
-int raidlookup(char *, struct lwp *, struct vnode **);
+int raidlookup(char *, struct proc *, struct vnode **);
int raidmarkclean(dev_t dev, struct vnode *b_vp, int);
int raidmarkdirty(dev_t dev, struct vnode *b_vp, int);
void raid_init_component_label(RF_Raid_t *, RF_ComponentLabel_t *);
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index ff17e26f42b..600e2035632 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.160 2003/06/28 14:21:42 darrenr Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.161 2003/06/29 22:30:33 fvdl Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -111,7 +111,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.160 2003/06/28 14:21:42 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.161 2003/06/29 22:30:33 fvdl Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -175,7 +175,7 @@ static void InitBP(struct buf * bp, struct vnode *, unsigned rw_flag,
dev_t dev, RF_SectorNum_t startSect,
RF_SectorCount_t numSect, caddr_t buf,
void (*cbFunc) (struct buf *), void *cbArg,
- int logBytesPerSector, struct proc * proc);
+ int logBytesPerSector, struct proc * b_proc);
static void raidinit(RF_Raid_t *);
void raidattach(int);
@@ -498,7 +498,7 @@ raidsize(dev)
omask = rs->sc_dkdev.dk_openmask & (1 << part);
lp = rs->sc_dkdev.dk_label;
- if (omask == 0 && raidopen(dev, 0, S_IFBLK, curlwp))
+ if (omask == 0 && raidopen(dev, 0, S_IFBLK, curproc))
return (-1);
if (lp->d_partitions[part].p_fstype != FS_SWAP)
@@ -507,7 +507,7 @@ raidsize(dev)
size = lp->d_partitions[part].p_size *
(lp->d_secsize / DEV_BSIZE);
- if (omask == 0 && raidclose(dev, 0, S_IFBLK, curlwp))
+ if (omask == 0 && raidclose(dev, 0, S_IFBLK, curproc))
return (-1);
return (size);
@@ -526,10 +526,10 @@ raiddump(dev, blkno, va, size)
}
/* ARGSUSED */
int
-raidopen(dev, flags, fmt, l)
+raidopen(dev, flags, fmt, p)
dev_t dev;
int flags, fmt;
- struct lwp *l;
+ struct proc *p;
{
int unit = raidunit(dev);
struct raid_softc *rs;
@@ -599,10 +599,10 @@ raidopen(dev, flags, fmt, l)
}
/* ARGSUSED */
int
-raidclose(dev, flags, fmt, l)
+raidclose(dev, flags, fmt, p)
dev_t dev;
int flags, fmt;
- struct lwp *l;
+ struct proc *p;
{
int unit = raidunit(dev);
struct raid_softc *rs;
@@ -767,12 +767,12 @@ raidwrite(dev, uio, flags)
}
int
-raidioctl(dev, cmd, data, flag, l)
+raidioctl(dev, cmd, data, flag, p)
dev_t dev;
u_long cmd;
caddr_t data;
int flag;
- struct lwp *l;
+ struct proc *p;
{
int unit = raidunit(dev);
int error = 0;
@@ -1989,7 +1989,7 @@ KernelWakeupFunc(vbp)
*/
static void
InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg,
- logBytesPerSector, p)
+ logBytesPerSector, b_proc)
struct buf *bp;
struct vnode *b_vp;
unsigned rw_flag;
@@ -2000,7 +2000,7 @@ InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg,
void (*cbFunc) (struct buf *);
void *cbArg;
int logBytesPerSector;
- struct proc *p;
+ struct proc *b_proc;
{
/* bp->b_flags = B_PHYS | rw_flag; */
bp->b_flags = B_CALL | rw_flag; /* XXX need B_PHYS here too??? */
@@ -2014,7 +2014,7 @@ InitBP(bp, b_vp, rw_flag, dev, startSect, numSect, buf, cbFunc, cbArg,
if (bp->b_bcount == 0) {
panic("bp->b_bcount is zero in InitBP!!");
}
- bp->b_proc = p;
+ bp->b_proc = b_proc;
bp->b_iodone = cbFunc;
bp->b_vp = b_vp;
@@ -2140,37 +2140,35 @@ raidmakedisklabel(rs)
* You'll find the original of this in ccd.c
*/
int
-raidlookup(path, l, vpp)
+raidlookup(path, p, vpp)
char *path;
- struct lwp *l;
+ struct proc *p;
struct vnode **vpp; /* result */
{
struct nameidata nd;
struct vnode *vp;
- struct proc *p;
struct vattr va;
int error;
- p = l ? l->l_proc : NULL;
- NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, l);
+ NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p);
if ((error = vn_open(&nd, FREAD | FWRITE, 0)) != 0) {
return (error);
}
vp = nd.ni_vp;
if (vp->v_usecount > 1) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);
return (EBUSY);
}
- if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)) != 0) {
+ if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)) != 0) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);
return (error);
}
/* XXX: eventually we should handle VREG, too. */
if (va.va_type != VBLK) {
VOP_UNLOCK(vp, 0);
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);
return (ENOTBLK);
}
VOP_UNLOCK(vp, 0);
@@ -2517,10 +2515,8 @@ rf_close_component(raidPtr, vp, auto_configured)
int auto_configured;
{
struct proc *p;
- struct lwp *l;
p = raidPtr->engine_thread;
- l = LIST_FIRST(&p->p_lwps);
if (vp != NULL) {
if (auto_configured == 1) {
@@ -2529,7 +2525,7 @@ rf_close_component(raidPtr, vp, auto_configured)
vput(vp);
} else {
- (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l);
+ (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p);
}
}
}
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c
index 221fd1eb72f..2487d97678b 100644
--- a/sys/dev/raidframe/rf_reconstruct.c
+++ b/sys/dev/raidframe/rf_reconstruct.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.55 2003/06/28 14:21:42 darrenr Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.56 2003/06/29 22:30:34 fvdl 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.55 2003/06/28 14:21:42 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.56 2003/06/29 22:30:34 fvdl Exp $");
#include <sys/time.h>
#include <sys/buf.h>
@@ -409,7 +409,7 @@ rf_ReconstructInPlace(raidPtr, row, col)
struct partinfo dpart;
struct vnode *vp;
struct vattr va;
- struct lwp *lwp;
+ struct proc *proc;
int retcode;
int ac;
@@ -457,7 +457,7 @@ rf_ReconstructInPlace(raidPtr, row, col)
return (EINVAL);
}
- lwp = LIST_FIRST(&raidPtr->engine_thread->p_lwps);
+ proc = raidPtr->engine_thread;
/* This device may have been opened successfully the
first time. Close it before trying to open it again.. */
@@ -483,7 +483,7 @@ rf_ReconstructInPlace(raidPtr, row, col)
#endif
RF_UNLOCK_MUTEX(raidPtr->mutex);
retcode = raidlookup(raidPtr->Disks[row][col].devname,
- lwp, &vp);
+ proc, &vp);
if (retcode) {
printf("raid%d: rebuilding: raidlookup on device: %s failed: %d!\n",raidPtr->raidid,
@@ -501,15 +501,15 @@ rf_ReconstructInPlace(raidPtr, row, col)
/* Ok, so we can at least do a lookup...
How about actually getting a vp for it? */
- if ((retcode = VOP_GETATTR(vp, &va, lwp->l_proc->p_ucred,
- lwp)) != 0) {
+ if ((retcode = VOP_GETATTR(vp, &va, proc->p_ucred,
+ proc)) != 0) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;
RF_UNLOCK_MUTEX(raidPtr->mutex);
return(retcode);
}
retcode = VOP_IOCTL(vp, DIOCGPART, &dpart,
- FREAD, lwp->l_proc->p_ucred, lwp);
+ FREAD, proc->p_ucred, proc);
if (retcode) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;