Use deviter(9) instead of accessing alldevs directly. Compile-tested,
only.
This commit is contained in:
parent
2e43373a96
commit
c6acecde0a
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: rf_netbsdkintf.c,v 1.267 2009/10/13 22:46:28 pooka Exp $ */
|
/* $NetBSD: rf_netbsdkintf.c,v 1.268 2009/11/05 17:52:32 dyoung Exp $ */
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
|
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
@ -139,7 +139,7 @@
|
|||||||
***********************************************************/
|
***********************************************************/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.267 2009/10/13 22:46:28 pooka Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.268 2009/11/05 17:52:32 dyoung Exp $");
|
||||||
|
|
||||||
#ifdef _KERNEL_OPT
|
#ifdef _KERNEL_OPT
|
||||||
#include "opt_compat_netbsd.h"
|
#include "opt_compat_netbsd.h"
|
||||||
@ -2871,6 +2871,7 @@ rf_find_raid_components(void)
|
|||||||
struct vnode *vp;
|
struct vnode *vp;
|
||||||
struct disklabel label;
|
struct disklabel label;
|
||||||
device_t dv;
|
device_t dv;
|
||||||
|
deviter_t di;
|
||||||
dev_t dev;
|
dev_t dev;
|
||||||
int bmajor, bminor, wedge;
|
int bmajor, bminor, wedge;
|
||||||
int error;
|
int error;
|
||||||
@ -2883,8 +2884,8 @@ rf_find_raid_components(void)
|
|||||||
|
|
||||||
/* we begin by trolling through *all* the devices on the system */
|
/* we begin by trolling through *all* the devices on the system */
|
||||||
|
|
||||||
for (dv = alldevs.tqh_first; dv != NULL;
|
for (dv = deviter_first(&di, DEVITER_F_ROOT_FIRST); dv != NULL;
|
||||||
dv = dv->dv_list.tqe_next) {
|
dv = deviter_next(&di)) {
|
||||||
|
|
||||||
/* we are only interested in disks... */
|
/* we are only interested in disks... */
|
||||||
if (device_class(dv) != DV_DISK)
|
if (device_class(dv) != DV_DISK)
|
||||||
@ -3005,6 +3006,7 @@ rf_find_raid_components(void)
|
|||||||
label.d_partitions[i].p_size);
|
label.d_partitions[i].p_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
deviter_release(&di);
|
||||||
return ac_list;
|
return ac_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user