1/*-
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
--- 15 unchanged lines hidden (view full) ---
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/geom/bde/g_bde.c 125803 2004-02-14 17:59:44Z phk $
33 *
34 */
35
36#include <sys/param.h>
37#include <sys/bio.h>
38#include <sys/lock.h>
39#include <sys/mutex.h>
40#include <sys/malloc.h>
--- 84 unchanged lines hidden (view full) ---
125 void *key;
126
127 g_trace(G_T_TOPOLOGY, "g_bde_create_geom(%s, %s)", mp->name, pp->name);
128 g_topology_assert();
129 gp = NULL;
130
131
132 gp = g_new_geomf(mp, "%s.bde", pp->name);
133 gp->start = g_bde_start;
134 gp->orphan = g_bde_orphan;
135 gp->access = g_bde_access;
136 gp->spoiled = g_std_spoiled;
137 cp = g_new_consumer(gp);
138 g_attach(cp, pp);
139 error = g_access(cp, 1, 1, 1);
140 if (error) {
141 g_detach(cp);
142 g_destroy_consumer(cp);
143 g_destroy_geom(gp);
144 gctl_error(req, "could not access consumer");
--- 128 unchanged lines hidden (view full) ---
273 gctl_error(req, "unknown verb");
274 }
275}
276
277static struct g_class g_bde_class = {
278 .name = BDE_CLASS_NAME,
279 .destroy_geom = g_bde_destroy_geom,
280 .ctlreq = g_bde_ctlreq,
281};
282
283DECLARE_GEOM_CLASS(g_bde_class, g_bde);
2 * Copyright (c) 2002 Poul-Henning Kamp
3 * Copyright (c) 2002 Networks Associates Technology, Inc.
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp
7 * and NAI Labs, the Security Research Division of Network Associates, Inc.
8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
--- 15 unchanged lines hidden (view full) ---
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/geom/bde/g_bde.c 125803 2004-02-14 17:59:44Z phk $
33 *
34 */
35
36#include <sys/param.h>
37#include <sys/bio.h>
38#include <sys/lock.h>
39#include <sys/mutex.h>
40#include <sys/malloc.h>
--- 84 unchanged lines hidden (view full) ---
125 void *key;
126
127 g_trace(G_T_TOPOLOGY, "g_bde_create_geom(%s, %s)", mp->name, pp->name);
128 g_topology_assert();
129 gp = NULL;
130
131
132 gp = g_new_geomf(mp, "%s.bde", pp->name);
133 gp->start = g_bde_start;
134 gp->orphan = g_bde_orphan;
135 gp->access = g_bde_access;
136 gp->spoiled = g_std_spoiled;
137 cp = g_new_consumer(gp);
138 g_attach(cp, pp);
139 error = g_access(cp, 1, 1, 1);
140 if (error) {
141 g_detach(cp);
142 g_destroy_consumer(cp);
143 g_destroy_geom(gp);
144 gctl_error(req, "could not access consumer");
--- 128 unchanged lines hidden (view full) ---
273 gctl_error(req, "unknown verb");
274 }
275}
276
277static struct g_class g_bde_class = {
278 .name = BDE_CLASS_NAME,
279 .destroy_geom = g_bde_destroy_geom,
280 .ctlreq = g_bde_ctlreq,
281};
282
283DECLARE_GEOM_CLASS(g_bde_class, g_bde);