summaryrefslogtreecommitdiffstats
path: root/sys/dev/softraid_raid0.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-03-31 11:12:06 +0000
committerjsing <jsing@openbsd.org>2013-03-31 11:12:06 +0000
commitfc627a5c7c1ac06c524fde49b452d96cf7c96cf0 (patch)
tree20cdfecbe8bfae948ea0ebcfa2d59b599f1a89e8 /sys/dev/softraid_raid0.c
parentPull the initialisation of runtime values out into a separate init (diff)
downloadwireguard-openbsd-fc627a5c7c1ac06c524fde49b452d96cf7c96cf0.tar.xz
wireguard-openbsd-fc627a5c7c1ac06c524fde49b452d96cf7c96cf0.zip
Provide default resource allocation and free functions. Convert all
disciplines except for AOE and CRYPTO, which require custom handlers.
Diffstat (limited to 'sys/dev/softraid_raid0.c')
-rw-r--r--sys/dev/softraid_raid0.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c
index 700e401b08c..fbe6529f750 100644
--- a/sys/dev/softraid_raid0.c
+++ b/sys/dev/softraid_raid0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_raid0.c,v 1.37 2013/03/31 10:41:16 jsing Exp $ */
+/* $OpenBSD: softraid_raid0.c,v 1.38 2013/03/31 11:12:06 jsing Exp $ */
/*
* Copyright (c) 2008 Marco Peereboom <marco@peereboom.us>
*
@@ -49,8 +49,6 @@ int sr_raid0_create(struct sr_discipline *, struct bioc_createraid *,
int sr_raid0_assemble(struct sr_discipline *, struct bioc_createraid *,
int, void *);
int sr_raid0_init(struct sr_discipline *);
-int sr_raid0_alloc_resources(struct sr_discipline *);
-int sr_raid0_free_resources(struct sr_discipline *);
int sr_raid0_rw(struct sr_workunit *);
/* Discipline initialisation. */
@@ -65,10 +63,8 @@ sr_raid0_discipline_init(struct sr_discipline *sd)
sd->sd_max_wu = SR_RAID0_NOWU;
/* Setup discipline specific function pointers. */
- sd->sd_alloc_resources = sr_raid0_alloc_resources;
sd->sd_assemble = sr_raid0_assemble;
sd->sd_create = sr_raid0_create;
- sd->sd_free_resources = sr_raid0_free_resources;
sd->sd_scsi_rw = sr_raid0_rw;
}
@@ -117,39 +113,6 @@ sr_raid0_init(struct sr_discipline *sd)
}
int
-sr_raid0_alloc_resources(struct sr_discipline *sd)
-{
- int rv = EINVAL;
-
- DNPRINTF(SR_D_DIS, "%s: sr_raid0_alloc_resources\n",
- DEVNAME(sd->sd_sc));
-
- if (sr_wu_alloc(sd))
- goto bad;
- if (sr_ccb_alloc(sd))
- goto bad;
-
- rv = 0;
-bad:
- return (rv);
-}
-
-int
-sr_raid0_free_resources(struct sr_discipline *sd)
-{
- int rv = EINVAL;
-
- DNPRINTF(SR_D_DIS, "%s: sr_raid0_free_resources\n",
- DEVNAME(sd->sd_sc));
-
- sr_wu_free(sd);
- sr_ccb_free(sd);
-
- rv = 0;
- return (rv);
-}
-
-int
sr_raid0_rw(struct sr_workunit *wu)
{
struct sr_discipline *sd = wu->swu_dis;