summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2008-01-26 20:44:37 +0000
committeroster <oster@NetBSD.org>2008-01-26 20:44:37 +0000
commit287ee4e9a9d15fe57edf5231af23f4bf682e0e9d (patch)
tree362bcdc607457226b20ff762886105fafb967437 /sys/dev/raidframe
parentb5e9addd22eabcce2e017947a3b5e8569ca6500a (diff)
In a land before time, when kernel processes roamed the system, we
needed to keep track of the kernel process that opened a device in order to close it with the right credentials. Flash forward to today where curlwp is now quite sufficient.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_copyback.c13
-rw-r--r--sys/dev/raidframe/rf_disks.c13
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c12
3 files changed, 15 insertions, 23 deletions
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c
index 82348f96add..ba3d09b9c1c 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.40 2007/11/26 19:01:37 pooka Exp $ */
+/* $NetBSD: rf_copyback.c,v 1.41 2008/01/26 20:44:37 oster 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.40 2007/11/26 19:01:37 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.41 2008/01/26 20:44:37 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -95,7 +95,6 @@ rf_CopybackReconstructedData(RF_Raid_t *raidPtr)
struct vnode *vp;
struct vattr va;
- struct lwp *l;
int ac;
@@ -116,8 +115,6 @@ rf_CopybackReconstructedData(RF_Raid_t *raidPtr)
badDisk = &raidPtr->Disks[fcol];
- l = raidPtr->engine_thread;
-
/* This device may have been opened successfully the first time. Close
* it before trying to open it again.. */
@@ -136,7 +133,7 @@ rf_CopybackReconstructedData(RF_Raid_t *raidPtr)
printf("About to (re-)open the device: %s\n",
raidPtr->Disks[fcol].devname);
- retcode = dk_lookup(raidPtr->Disks[fcol].devname, l, &vp,
+ retcode = dk_lookup(raidPtr->Disks[fcol].devname, curlwp, &vp,
UIO_SYSSPACE);
if (retcode) {
@@ -153,9 +150,9 @@ rf_CopybackReconstructedData(RF_Raid_t *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_cred)) != 0)
+ if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0)
return;
- retcode = rf_getdisksize(vp, l, &raidPtr->Disks[fcol]);
+ retcode = rf_getdisksize(vp, curlwp, &raidPtr->Disks[fcol]);
if (retcode) {
return;
}
diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c
index 574d2bf0469..6c19d851534 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.68 2007/11/26 19:01:37 pooka Exp $ */
+/* $NetBSD: rf_disks.c,v 1.69 2008/01/26 20:44:47 oster 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.68 2007/11/26 19:01:37 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.69 2008/01/26 20:44:47 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -577,7 +577,6 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr,
char *p;
struct vnode *vp;
struct vattr va;
- struct lwp *l;
int error;
p = rf_find_non_white(bf);
@@ -587,8 +586,6 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr,
}
(void) strcpy(diskPtr->devname, p);
- l = raidPtr->engine_thread;
-
/* Let's start by claiming the component is fine and well... */
diskPtr->status = rf_ds_optimal;
@@ -602,7 +599,7 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr,
return (0);
}
- error = dk_lookup(diskPtr->devname, l, &vp, UIO_SYSSPACE);
+ error = dk_lookup(diskPtr->devname, curlwp, &vp, UIO_SYSSPACE);
if (error) {
printf("dk_lookup on device: %s failed!\n", diskPtr->devname);
if (error == ENXIO) {
@@ -614,9 +611,9 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr,
}
if (diskPtr->status == rf_ds_optimal) {
- if ((error = VOP_GETATTR(vp, &va, l->l_cred)) != 0)
+ if ((error = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0)
return (error);
- if ((error = rf_getdisksize(vp, l, diskPtr)) != 0)
+ if ((error = rf_getdisksize(vp, curlwp, diskPtr)) != 0)
return (error);
raidPtr->raid_cinfo[col].ci_vp = vp;
diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c
index 2c34db048e9..a4ea84ada65 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.100 2007/11/26 19:01:40 pooka Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.101 2008/01/26 20:45:06 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.100 2007/11/26 19:01:40 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.101 2008/01/26 20:45:06 oster Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -357,7 +357,6 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
struct partinfo dpart;
struct vnode *vp;
struct vattr va;
- struct lwp *lwp;
int retcode;
int ac;
@@ -412,7 +411,6 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
return (EINVAL);
}
#endif
- lwp = raidPtr->engine_thread;
/* This device may have been opened successfully the
first time. Close it before trying to open it again.. */
@@ -437,7 +435,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
raidPtr->Disks[col].devname);
#endif
RF_UNLOCK_MUTEX(raidPtr->mutex);
- retcode = dk_lookup(raidPtr->Disks[col].devname, lwp, &vp, UIO_SYSSPACE);
+ retcode = dk_lookup(raidPtr->Disks[col].devname, curlwp, &vp, UIO_SYSSPACE);
if (retcode) {
printf("raid%d: rebuilding: dk_lookup on device: %s failed: %d!\n",raidPtr->raidid,
@@ -455,7 +453,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t 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_cred)) != 0) {
+ if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;
RF_UNLOCK_MUTEX(raidPtr->mutex);
@@ -463,7 +461,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col)
return(retcode);
}
- retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, lwp->l_cred);
+ retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, curlwp->l_cred);
if (retcode) {
RF_LOCK_MUTEX(raidPtr->mutex);
raidPtr->reconInProgress--;