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
--- 18 unchanged lines hidden (view full) ---
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/geom/geom_disk.c 110116 2003-01-30 19:43:50Z phk $
36 */
37
38#include "opt_geom.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>
43#include <sys/sysctl.h>
44#include <sys/bio.h>
45#include <sys/conf.h>
46#include <sys/disk.h>
47#include <sys/disklabel.h>
48#include <sys/malloc.h>
49#include <sys/sysctl.h>
50#include <sys/stdint.h>
51#include <machine/md_var.h>
52
53
54#include <sys/lock.h>
55#include <sys/mutex.h>
--- 214 unchanged lines hidden (view full) ---
270{
271 dev_t dev;
272
273 dev = g_malloc(sizeof *dev, M_ZERO);
274 dp->d_dev = dev;
275 dp->d_devsw = cdevsw;
276 dev->si_devsw = cdevsw;
277 dev->si_disk = dp;
278 dev->si_udev = dkmakeminor(unit, 1, RAW_PART);
279 sprintf(dev->si_name, "%s%d", cdevsw->d_name, unit);
280 g_call_me(g_disk_create, dev);
281 return (dev);
282}
283
284void
285disk_destroy(dev_t dev)
286{
--- 48 unchanged lines hidden ---
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
--- 18 unchanged lines hidden (view full) ---
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/geom/geom_disk.c 110116 2003-01-30 19:43:50Z phk $
36 */
37
38#include "opt_geom.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>
43#include <sys/sysctl.h>
44#include <sys/bio.h>
45#include <sys/conf.h>
46#include <sys/disk.h>
47#include <sys/disklabel.h>
48#include <sys/malloc.h>
49#include <sys/sysctl.h>
50#include <sys/stdint.h>
51#include <machine/md_var.h>
52
53
54#include <sys/lock.h>
55#include <sys/mutex.h>
--- 214 unchanged lines hidden (view full) ---
270{
271 dev_t dev;
272
273 dev = g_malloc(sizeof *dev, M_ZERO);
274 dp->d_dev = dev;
275 dp->d_devsw = cdevsw;
276 dev->si_devsw = cdevsw;
277 dev->si_disk = dp;
278 dev->si_udev = dkmakeminor(unit, 1, RAW_PART);
279 sprintf(dev->si_name, "%s%d", cdevsw->d_name, unit);
280 g_call_me(g_disk_create, dev);
281 return (dev);
282}
283
284void
285disk_destroy(dev_t dev)
286{
--- 48 unchanged lines hidden ---