diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-08 14:22:42 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2012-10-08 14:22:42 +0000 |
commit | 5b2a45ea0d47f6fee606b25f02c4295e6eb9a225 (patch) | |
tree | de02269d0757652435b6abd7d1d00c041ef623e2 /sys/dev | |
parent | d761a819b77d84f1dff67e475b61fc7afaf73b86 (diff) |
Provide a mechanism for the kernel to pass data through to the discipline
during volume assembly.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/softraid.c | 14 | ||||
-rw-r--r-- | sys/dev/softraid_aoe.c | 10 | ||||
-rw-r--r-- | sys/dev/softraid_concat.c | 6 | ||||
-rw-r--r-- | sys/dev/softraid_crypto.c | 6 | ||||
-rw-r--r-- | sys/dev/softraid_raid0.c | 6 | ||||
-rw-r--r-- | sys/dev/softraid_raid1.c | 6 | ||||
-rw-r--r-- | sys/dev/softraid_raid6.c | 6 | ||||
-rw-r--r-- | sys/dev/softraid_raidp.c | 6 | ||||
-rw-r--r-- | sys/dev/softraidvar.h | 4 |
9 files changed, 33 insertions, 31 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c index 95968cc74cf..dfa24f799f5 100644 --- a/sys/dev/softraid.c +++ b/sys/dev/softraid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid.c,v 1.276 2012/10/08 13:25:46 jsing Exp $ */ +/* $OpenBSD: softraid.c,v 1.277 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -104,7 +104,7 @@ int sr_ioctl_disk(struct sr_softc *, struct bioc_disk *); int sr_ioctl_setstate(struct sr_softc *, struct bioc_setstate *); int sr_ioctl_createraid(struct sr_softc *, - struct bioc_createraid *, int); + struct bioc_createraid *, int, void *); int sr_ioctl_deleteraid(struct sr_softc *, struct bioc_deleteraid *); int sr_ioctl_discipline(struct sr_softc *, @@ -1437,7 +1437,7 @@ sr_boot_assembly(struct sr_softc *sc) rw_enter_write(&sc->sc_lock); bio_status_init(&sc->sc_status, &sc->sc_dev); - sr_ioctl_createraid(sc, &bcr, 0); + sr_ioctl_createraid(sc, &bcr, 0, NULL); rw_exit_write(&sc->sc_lock); rv++; @@ -2309,7 +2309,8 @@ sr_bio_ioctl(struct device *dev, u_long cmd, caddr_t addr) case BIOCCREATERAID: DNPRINTF(SR_D_IOCTL, "createraid\n"); - rv = sr_ioctl_createraid(sc, (struct bioc_createraid *)addr, 1); + rv = sr_ioctl_createraid(sc, (struct bioc_createraid *)addr, + 1, NULL); break; case BIOCDELETERAID: @@ -3058,7 +3059,8 @@ sr_roam_chunks(struct sr_discipline *sd) } int -sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) +sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, + int user, void *data) { struct sr_meta_opt_item *omi; struct sr_chunk_head *cl; @@ -3211,7 +3213,7 @@ sr_ioctl_createraid(struct sr_softc *sc, struct bioc_createraid *bc, int user) sr_meta_opt_handler(sd, omi->omi_som); if (sd->sd_assemble) { - if ((i = sd->sd_assemble(sd, bc, no_chunk))) { + if ((i = sd->sd_assemble(sd, bc, no_chunk, data))) { rv = i; goto unwind; } diff --git a/sys/dev/softraid_aoe.c b/sys/dev/softraid_aoe.c index 978a1905c4f..938b791d2cc 100644 --- a/sys/dev/softraid_aoe.c +++ b/sys/dev/softraid_aoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_aoe.c,v 1.25 2011/12/26 14:54:52 jsing Exp $ */ +/* $OpenBSD: softraid_aoe.c,v 1.26 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2008 Ted Unangst <tedu@openbsd.org> * Copyright (c) 2008 Marco Peereboom <marco@openbsd.org> @@ -58,7 +58,7 @@ int sr_aoe_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_aoe_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_aoe_alloc_resources(struct sr_discipline *); int sr_aoe_free_resources(struct sr_discipline *); int sr_aoe_rw(struct sr_workunit *); @@ -67,7 +67,7 @@ int sr_aoe_rw(struct sr_workunit *); int sr_aoe_server_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_aoe_server_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_aoe_server_alloc_resources(struct sr_discipline *); int sr_aoe_server_free_resources(struct sr_discipline *); int sr_aoe_server_start(struct sr_discipline *); @@ -139,7 +139,7 @@ sr_aoe_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_aoe_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { struct ifnet *ifp; struct aoe_handler *ah; @@ -586,7 +586,7 @@ sr_aoe_server_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_aoe_server_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { sd->sd_max_ccb_per_wu = sd->sd_meta->ssdi.ssd_chunk_no; diff --git a/sys/dev/softraid_concat.c b/sys/dev/softraid_concat.c index ffa206c63b8..8061915c82a 100644 --- a/sys/dev/softraid_concat.c +++ b/sys/dev/softraid_concat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_concat.c,v 1.2 2012/01/22 11:13:32 jsing Exp $ */ +/* $OpenBSD: softraid_concat.c,v 1.3 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2011 Joel Sing <jsing@openbsd.org> @@ -35,7 +35,7 @@ int sr_concat_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_concat_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_concat_alloc_resources(struct sr_discipline *); int sr_concat_free_resources(struct sr_discipline *); int sr_concat_rw(struct sr_workunit *); @@ -84,7 +84,7 @@ sr_concat_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_concat_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { sd->sd_max_ccb_per_wu = SR_CONCAT_NOWU * no_chunk; diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c index 7e34e519e3f..5423acb2ba4 100644 --- a/sys/dev/softraid_crypto.c +++ b/sys/dev/softraid_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_crypto.c,v 1.80 2012/01/30 13:13:03 jsing Exp $ */ +/* $OpenBSD: softraid_crypto.c,v 1.81 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org> @@ -85,7 +85,7 @@ int sr_crypto_change_maskkey(struct sr_discipline *, int sr_crypto_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_crypto_assemble(struct sr_discipline *, - struct bioc_createraid *, int); + struct bioc_createraid *, int, void *); int sr_crypto_alloc_resources(struct sr_discipline *); int sr_crypto_free_resources(struct sr_discipline *); int sr_crypto_ioctl(struct sr_discipline *, @@ -194,7 +194,7 @@ done: int sr_crypto_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { int rv = EINVAL; diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c index a686fef700e..61f36c573dc 100644 --- a/sys/dev/softraid_raid0.c +++ b/sys/dev/softraid_raid0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid0.c,v 1.26 2012/01/22 11:13:32 jsing Exp $ */ +/* $OpenBSD: softraid_raid0.c,v 1.27 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * @@ -47,7 +47,7 @@ int sr_raid0_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_raid0_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_raid0_alloc_resources(struct sr_discipline *); int sr_raid0_free_resources(struct sr_discipline *); int sr_raid0_rw(struct sr_workunit *); @@ -98,7 +98,7 @@ sr_raid0_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_raid0_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunks) + int no_chunks, void *data) { sd->sd_max_ccb_per_wu = diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c index bc61f87d2d5..73da7b174e7 100644 --- a/sys/dev/softraid_raid1.c +++ b/sys/dev/softraid_raid1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid1.c,v 1.31 2012/01/22 11:13:32 jsing Exp $ */ +/* $OpenBSD: softraid_raid1.c,v 1.32 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * @@ -47,7 +47,7 @@ int sr_raid1_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_raid1_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_raid1_alloc_resources(struct sr_discipline *); int sr_raid1_free_resources(struct sr_discipline *); int sr_raid1_rw(struct sr_workunit *); @@ -97,7 +97,7 @@ sr_raid1_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_raid1_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { sd->sd_max_ccb_per_wu = sd->sd_meta->ssdi.ssd_chunk_no; diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c index 85e91415a4f..e457d03447b 100644 --- a/sys/dev/softraid_raid6.c +++ b/sys/dev/softraid_raid6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid6.c,v 1.25 2011/12/25 15:28:17 jsing Exp $ */ +/* $OpenBSD: softraid_raid6.c,v 1.26 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org> @@ -52,7 +52,7 @@ int gf_log[256]; int sr_raid6_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_raid6_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_raid6_alloc_resources(struct sr_discipline *); int sr_raid6_free_resources(struct sr_discipline *); int sr_raid6_rw(struct sr_workunit *); @@ -141,7 +141,7 @@ sr_raid6_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_raid6_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { /* only if stripsize <= MAXPHYS */ diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c index f121cc0c404..0738b74e644 100644 --- a/sys/dev/softraid_raidp.c +++ b/sys/dev/softraid_raidp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raidp.c,v 1.23 2011/12/25 15:28:17 jsing Exp $ */ +/* $OpenBSD: softraid_raidp.c,v 1.24 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org> @@ -48,7 +48,7 @@ int sr_raidp_create(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int sr_raidp_assemble(struct sr_discipline *, struct bioc_createraid *, - int); + int, void *); int sr_raidp_alloc_resources(struct sr_discipline *); int sr_raidp_free_resources(struct sr_discipline *); int sr_raidp_rw(struct sr_workunit *); @@ -116,7 +116,7 @@ sr_raidp_create(struct sr_discipline *sd, struct bioc_createraid *bc, int sr_raidp_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, - int no_chunk) + int no_chunk, void *data) { return 0; diff --git a/sys/dev/softraidvar.h b/sys/dev/softraidvar.h index d0add339ebd..0def3f1db9e 100644 --- a/sys/dev/softraidvar.h +++ b/sys/dev/softraidvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: softraidvar.h,v 1.116 2012/01/28 14:40:04 jsing Exp $ */ +/* $OpenBSD: softraidvar.h,v 1.117 2012/10/08 14:22:41 jsing Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org> @@ -573,7 +573,7 @@ struct sr_discipline { int (*sd_create)(struct sr_discipline *, struct bioc_createraid *, int, int64_t); int (*sd_assemble)(struct sr_discipline *, - struct bioc_createraid *, int); + struct bioc_createraid *, int, void *); int (*sd_alloc_resources)(struct sr_discipline *); int (*sd_free_resources)(struct sr_discipline *); int (*sd_ioctl_handler)(struct sr_discipline *, |