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 133314 2004-08-08 06:49:07Z 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 cp = g_new_consumer(gp);
134 g_attach(cp, pp);
135 error = g_access(cp, 1, 1, 1);
136 if (error) {
137 g_detach(cp);
138 g_destroy_consumer(cp);
139 g_destroy_geom(gp);
140 gctl_error(req, "could not access consumer");
--- 128 unchanged lines hidden (view full) ---
269 gctl_error(req, "unknown verb");
270 }
271}
272
273static struct g_class g_bde_class = {
274 .name = BDE_CLASS_NAME,
275 .destroy_geom = g_bde_destroy_geom,
276 .ctlreq = g_bde_ctlreq,
277 .start = g_bde_start,
278 .orphan = g_bde_orphan,
279 .access = g_bde_access,
280 .spoiled = g_std_spoiled,
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 133314 2004-08-08 06:49:07Z 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 cp = g_new_consumer(gp);
134 g_attach(cp, pp);
135 error = g_access(cp, 1, 1, 1);
136 if (error) {
137 g_detach(cp);
138 g_destroy_consumer(cp);
139 g_destroy_geom(gp);
140 gctl_error(req, "could not access consumer");
--- 128 unchanged lines hidden (view full) ---
269 gctl_error(req, "unknown verb");
270 }
271}
272
273static struct g_class g_bde_class = {
274 .name = BDE_CLASS_NAME,
275 .destroy_geom = g_bde_destroy_geom,
276 .ctlreq = g_bde_ctlreq,
277 .start = g_bde_start,
278 .orphan = g_bde_orphan,
279 .access = g_bde_access,
280 .spoiled = g_std_spoiled,
281};
282
283DECLARE_GEOM_CLASS(g_bde_class, g_bde);