Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe Address part of PR kern/44972. From YAMAM...
details: https://anonhg.NetBSD.org/src/rev/fab02d420ba2
branches: trunk
changeset: 767925:fab02d420ba2
user: oster <oster%NetBSD.org@localhost>
date: Wed Aug 03 15:00:29 2011 +0000
description:
Address part of PR kern/44972. From YAMAMOTO Takashi. Thanks!
diffstat:
sys/dev/raidframe/rf_reconstruct.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diffs (50 lines):
diff -r b53bbf37d6ec -r fab02d420ba2 sys/dev/raidframe/rf_reconstruct.c
--- a/sys/dev/raidframe/rf_reconstruct.c Wed Aug 03 14:47:28 2011 +0000
+++ b/sys/dev/raidframe/rf_reconstruct.c Wed Aug 03 15:00:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_reconstruct.c,v 1.115 2011/05/28 00:53:04 yamt Exp $ */
+/* $NetBSD: rf_reconstruct.c,v 1.116 2011/08/03 15:00:29 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.115 2011/05/28 00:53:04 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.116 2011/08/03 15:00:29 oster Exp $");
#include <sys/param.h>
#include <sys/time.h>
@@ -348,7 +348,8 @@
const RF_LayoutSW_t *lp;
RF_ComponentLabel_t *c_label;
int numDisksDone = 0, rc;
- struct partinfo dpart;
+ uint64_t numsec;
+ unsigned int secsize;
struct pathbuf *pb;
struct vnode *vp;
struct vattr va;
@@ -464,7 +465,7 @@
return(retcode);
}
- retcode = VOP_IOCTL(vp, DIOCGPART, &dpart, FREAD, curlwp->l_cred);
+ retcode = getdisksize(vp, &numsec, &secsize);
if (retcode) {
vn_close(vp, FREAD | FWRITE, kauth_cred_get());
rf_lock_mutex2(raidPtr->mutex);
@@ -474,10 +475,8 @@
return(retcode);
}
rf_lock_mutex2(raidPtr->mutex);
- raidPtr->Disks[col].blockSize = dpart.disklab->d_secsize;
-
- raidPtr->Disks[col].numBlocks = dpart.part->p_size -
- rf_protectedSectors;
+ raidPtr->Disks[col].blockSize = secsize;
+ raidPtr->Disks[col].numBlocks = numsec - rf_protectedSectors;
raidPtr->raid_cinfo[col].ci_vp = vp;
raidPtr->raid_cinfo[col].ci_dev = va.va_rdev;
Home |
Main Index |
Thread Index |
Old Index