diff options
| author | darrenr <darrenr@NetBSD.org> | 2003-06-28 14:20:43 +0000 |
|---|---|---|
| committer | darrenr <darrenr@NetBSD.org> | 2003-06-28 14:20:43 +0000 |
| commit | 960df3c8d11a934b85f6f7d3ac388ec5ee57c12f (patch) | |
| tree | 04eacdb0da6eefa4c57bf27833661e791d6a5853 /sys/dev/raidframe | |
| parent | da6b84e29093b9bfc2c3f38bfa199d379d8984d5 (diff) | |
Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.
Bump the kernel rev up to 1.6V
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_copyback.c | 15 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_disks.c | 15 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_kintf.h | 4 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_netbsdkintf.c | 48 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 16 |
5 files changed, 52 insertions, 46 deletions
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c index 7d0d996abe5..545dd4e8c8a 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.23 2003/03/21 23:11:22 dsl Exp $ */ +/* $NetBSD: rf_copyback.c,v 1.24 2003/06/28 14:21:42 darrenr 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.23 2003/03/21 23:11:22 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.24 2003/06/28 14:21:42 darrenr Exp $"); #include <dev/raidframe/raidframevar.h> @@ -99,7 +99,7 @@ rf_CopybackReconstructedData(raidPtr) struct partinfo dpart; struct vnode *vp; struct vattr va; - struct proc *proc; + struct lwp *l; int ac; @@ -123,7 +123,7 @@ rf_CopybackReconstructedData(raidPtr) } badDisk = &raidPtr->Disks[frow][fcol]; - proc = raidPtr->engine_thread; + l = LIST_FIRST(&raidPtr->engine_thread->p_lwps); /* 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, proc, &vp); + retcode = raidlookup(raidPtr->Disks[frow][fcol].devname, l, &vp); if (retcode) { printf("raid%d: copyback: raidlookup on device: %s failed: %d!\n", @@ -159,11 +159,12 @@ 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, proc->p_ucred, proc)) != 0) { + if ((retcode = VOP_GETATTR(vp, &va, + l->l_proc->p_ucred, l)) != 0) { return; } retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, - FREAD, proc->p_ucred, proc); + FREAD, l->l_proc->p_ucred, l); if (retcode) { return; } diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c index 41a5e477b08..88db78a0f9c 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.42 2003/04/13 22:07:11 oster Exp $ */ +/* $NetBSD: rf_disks.c,v 1.43 2003/06/28 14:21:42 darrenr 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.42 2003/04/13 22:07:11 oster Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.43 2003/06/28 14:21:42 darrenr 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 proc *proc; + struct lwp *l; int error; p = rf_find_non_white(buf); @@ -623,7 +623,7 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col) } (void) strcpy(diskPtr->devname, p); - proc = raidPtr->engine_thread; + l = LIST_FIRST(&raidPtr->engine_thread->p_lwps); /* 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, proc, &vp); + error = raidlookup(diskPtr->devname, l, &vp); if (error) { printf("raidlookup on device: %s failed!\n", diskPtr->devname); if (error == ENXIO) { @@ -643,11 +643,12 @@ rf_ConfigureDisk(raidPtr, buf, diskPtr, row, col) } if (diskPtr->status == rf_ds_optimal) { - if ((error = VOP_GETATTR(vp, &va, proc->p_ucred, proc)) != 0) { + if ((error = VOP_GETATTR(vp, &va, + l->l_proc->p_ucred, l)) != 0) { return (error); } error = VOP_IOCTL(vp, DIOCGPART, &dpart, - FREAD, proc->p_ucred, proc); + FREAD, l->l_proc->p_ucred, l); if (error) { return (error); } diff --git a/sys/dev/raidframe/rf_kintf.h b/sys/dev/raidframe/rf_kintf.h index 38da10188c9..f5047a3a69a 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.16 2001/10/04 15:58:54 oster Exp $ */ +/* $NetBSD: rf_kintf.h,v 1.17 2003/06/28 14:21:42 darrenr 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 proc *, struct vnode **); +int raidlookup(char *, struct lwp *, 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 0ac791067be..ff17e26f42b 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.159 2003/05/10 23:12:46 thorpej Exp $ */ +/* $NetBSD: rf_netbsdkintf.c,v 1.160 2003/06/28 14:21:42 darrenr 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.159 2003/05/10 23:12:46 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.160 2003/06/28 14:21:42 darrenr 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 * b_proc); + int logBytesPerSector, struct proc * 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, curproc)) + if (omask == 0 && raidopen(dev, 0, S_IFBLK, curlwp)) 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, curproc)) + if (omask == 0 && raidclose(dev, 0, S_IFBLK, curlwp)) return (-1); return (size); @@ -526,10 +526,10 @@ raiddump(dev, blkno, va, size) } /* ARGSUSED */ int -raidopen(dev, flags, fmt, p) +raidopen(dev, flags, fmt, l) dev_t dev; int flags, fmt; - struct proc *p; + struct lwp *l; { int unit = raidunit(dev); struct raid_softc *rs; @@ -599,10 +599,10 @@ raidopen(dev, flags, fmt, p) } /* ARGSUSED */ int -raidclose(dev, flags, fmt, p) +raidclose(dev, flags, fmt, l) dev_t dev; int flags, fmt; - struct proc *p; + struct lwp *l; { int unit = raidunit(dev); struct raid_softc *rs; @@ -767,12 +767,12 @@ raidwrite(dev, uio, flags) } int -raidioctl(dev, cmd, data, flag, p) +raidioctl(dev, cmd, data, flag, l) dev_t dev; u_long cmd; caddr_t data; int flag; - struct proc *p; + struct lwp *l; { 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, b_proc) + logBytesPerSector, p) 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 *b_proc; + struct proc *p; { /* 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 = b_proc; + bp->b_proc = p; bp->b_iodone = cbFunc; bp->b_vp = b_vp; @@ -2140,35 +2140,37 @@ raidmakedisklabel(rs) * You'll find the original of this in ccd.c */ int -raidlookup(path, p, vpp) +raidlookup(path, l, vpp) char *path; - struct proc *p; + struct lwp *l; struct vnode **vpp; /* result */ { struct nameidata nd; struct vnode *vp; + struct proc *p; struct vattr va; int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, p); + p = l ? l->l_proc : NULL; + NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, l); 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, p); + (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l); return (EBUSY); } - if ((error = VOP_GETATTR(vp, &va, p->p_ucred, p)) != 0) { + if ((error = VOP_GETATTR(vp, &va, p->p_ucred, l)) != 0) { VOP_UNLOCK(vp, 0); - (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p); + (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l); 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, p); + (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l); return (ENOTBLK); } VOP_UNLOCK(vp, 0); @@ -2515,8 +2517,10 @@ 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) { @@ -2525,7 +2529,7 @@ rf_close_component(raidPtr, vp, auto_configured) vput(vp); } else { - (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, p); + (void) vn_close(vp, FREAD | FWRITE, p->p_ucred, l); } } } diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index 125d1860edc..221fd1eb72f 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.54 2003/04/10 04:11:50 simonb Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.55 2003/06/28 14:21:42 darrenr 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.54 2003/04/10 04:11:50 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.55 2003/06/28 14:21:42 darrenr 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 proc *proc; + struct lwp *lwp; int retcode; int ac; @@ -457,7 +457,7 @@ rf_ReconstructInPlace(raidPtr, row, col) return (EINVAL); } - proc = raidPtr->engine_thread; + lwp = LIST_FIRST(&raidPtr->engine_thread->p_lwps); /* 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, - proc, &vp); + lwp, &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, proc->p_ucred, - proc)) != 0) { + if ((retcode = VOP_GETATTR(vp, &va, lwp->l_proc->p_ucred, + lwp)) != 0) { RF_LOCK_MUTEX(raidPtr->mutex); raidPtr->reconInProgress--; RF_UNLOCK_MUTEX(raidPtr->mutex); return(retcode); } retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, - FREAD, proc->p_ucred, proc); + FREAD, lwp->l_proc->p_ucred, lwp); if (retcode) { RF_LOCK_MUTEX(raidPtr->mutex); raidPtr->reconInProgress--; |
