diff options
Diffstat (limited to 'sys/dev/softraid.c')
-rw-r--r-- | sys/dev/softraid.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index ef83413e148..d6c269a9bc7 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.180 2009/11/22 17:01:18 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.181 2009/11/23 16:33:59 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -103,7 +103,8 @@ int sr_ioctl_createraid(struct sr_softc *, struct bioc_createraid *, int); int sr_ioctl_deleteraid(struct sr_softc *, struct bioc_deleteraid *); -int sr_ioctl_discipline(struct sr_softc *, u_long, caddr_t); +int sr_ioctl_discipline(struct sr_softc *, + struct bioc_discipline *); void sr_chunks_unwind(struct sr_softc *, struct sr_chunk_head *); void sr_discipline_free(struct sr_discipline *); @@ -1984,6 +1985,11 @@ sr_ioctl(struct device *dev, u_long cmd, caddr_t addr) case BIOCDELETERAID: rv = sr_ioctl_deleteraid(sc, (struct bioc_deleteraid *)addr); break; + + case BIOCDISCIPLINE: + rv = sr_ioctl_discipline(sc, (struct bioc_discipline *)addr); + break; + default: DNPRINTF(SR_D_IOCTL, "invalid ioctl\n"); rv = ENOTTY; @@ -3106,10 +3112,9 @@ bad: } int -sr_ioctl_discipline(struct sr_softc *sc, u_long cmd, caddr_t addr) +sr_ioctl_discipline(struct sr_softc *sc, struct bioc_discipline *bd) { struct sr_discipline *sd = NULL; - struct bio_device *bc = (struct bio_device *)addr; int i, rv = 1; /* Dispatch a discipline specific ioctl. */ @@ -3120,7 +3125,7 @@ sr_ioctl_discipline(struct sr_softc *sc, u_long cmd, caddr_t addr) for (i = 0; i < SR_MAXSCSIBUS; i++) if (sc->sc_dis[i]) { if (!strncmp(sc->sc_dis[i]->sd_meta->ssd_devname, - bc->dev, + bd->bd_dev, sizeof(sc->sc_dis[i]->sd_meta->ssd_devname))) { sd = sc->sc_dis[i]; break; @@ -3128,7 +3133,7 @@ sr_ioctl_discipline(struct sr_softc *sc, u_long cmd, caddr_t addr) } if (sd && sd->sd_ioctl_handler) - rv = sd->sd_ioctl_handler(sd, cmd, addr); + rv = sd->sd_ioctl_handler(sd, bd); return (rv); } |