summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe/rf_reconstruct.c
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/rf_reconstruct.c
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/rf_reconstruct.c')
-rw-r--r--sys/dev/raidframe/rf_reconstruct.c12
1 files changed, 5 insertions, 7 deletions
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--;