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
--- 20 unchanged lines hidden (view full) ---
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
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 227309 2011-11-07 15:43:11Z ed $");
38
39#include "opt_geom.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>
44#include <sys/sysctl.h>
45#include <sys/bio.h>
--- 24 unchanged lines hidden (view full) ---
70static struct mtx g_disk_done_mtx;
71
72static g_access_t g_disk_access;
73static g_init_t g_disk_init;
74static g_fini_t g_disk_fini;
75static g_start_t g_disk_start;
76static g_ioctl_t g_disk_ioctl;
77static g_dumpconf_t g_disk_dumpconf;
78
79static struct g_class g_disk_class = {
80 .name = "DISK",
81 .version = G_VERSION,
82 .init = g_disk_init,
83 .fini = g_disk_fini,
84 .start = g_disk_start,
85 .access = g_disk_access,
86 .ioctl = g_disk_ioctl,
87 .dumpconf = g_disk_dumpconf,
88};
89
90SYSCTL_DECL(_kern_geom);
91static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW, 0,
92 "GEOM_DISK stuff");
93
94static void
--- 387 unchanged lines hidden (view full) ---
482 CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led),
483 "LED name");
484 }
485 pp->private = sc;
486 dp->d_geom = gp;
487 g_error_provider(pp, 0);
488}
489
490static void
491g_disk_destroy(void *ptr, int flag)
492{
493 struct disk *dp;
494 struct g_geom *gp;
495 struct g_disk_softc *sc;
496
497 g_topology_assert();
498 dp = ptr;
--- 46 unchanged lines hidden (view full) ---
545
546 return (g_malloc(sizeof(struct disk), M_WAITOK | M_ZERO));
547}
548
549void
550disk_create(struct disk *dp, int version)
551{
552
553 if (version != DISK_VERSION_00 && version != DISK_VERSION_01) {
554 printf("WARNING: Attempt to add disk %s%d %s",
555 dp->d_name, dp->d_unit,
556 " using incompatible ABI version of disk(9)\n");
557 printf("WARNING: Ignoring disk %s%d\n",
558 dp->d_name, dp->d_unit);
559 return;
560 }
561 KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy"));
--- 80 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
--- 20 unchanged lines hidden (view full) ---
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
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/geom/geom_disk.c 227309 2011-11-07 15:43:11Z ed $");
38
39#include "opt_geom.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>
44#include <sys/sysctl.h>
45#include <sys/bio.h>
--- 24 unchanged lines hidden (view full) ---
70static struct mtx g_disk_done_mtx;
71
72static g_access_t g_disk_access;
73static g_init_t g_disk_init;
74static g_fini_t g_disk_fini;
75static g_start_t g_disk_start;
76static g_ioctl_t g_disk_ioctl;
77static g_dumpconf_t g_disk_dumpconf;
78
79static struct g_class g_disk_class = {
80 .name = "DISK",
81 .version = G_VERSION,
82 .init = g_disk_init,
83 .fini = g_disk_fini,
84 .start = g_disk_start,
85 .access = g_disk_access,
86 .ioctl = g_disk_ioctl,
87 .dumpconf = g_disk_dumpconf,
88};
89
90SYSCTL_DECL(_kern_geom);
91static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW, 0,
92 "GEOM_DISK stuff");
93
94static void
--- 387 unchanged lines hidden (view full) ---
482 CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led),
483 "LED name");
484 }
485 pp->private = sc;
486 dp->d_geom = gp;
487 g_error_provider(pp, 0);
488}
489
490static void
491g_disk_destroy(void *ptr, int flag)
492{
493 struct disk *dp;
494 struct g_geom *gp;
495 struct g_disk_softc *sc;
496
497 g_topology_assert();
498 dp = ptr;
--- 46 unchanged lines hidden (view full) ---
545
546 return (g_malloc(sizeof(struct disk), M_WAITOK | M_ZERO));
547}
548
549void
550disk_create(struct disk *dp, int version)
551{
552
553 if (version != DISK_VERSION_00 && version != DISK_VERSION_01) {
554 printf("WARNING: Attempt to add disk %s%d %s",
555 dp->d_name, dp->d_unit,
556 " using incompatible ABI version of disk(9)\n");
557 printf("WARNING: Ignoring disk %s%d\n",
558 dp->d_name, dp->d_unit);
559 return;
560 }
561 KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy"));
--- 80 unchanged lines hidden ---