Deleted Added
full compact
ctl.c (292290) ctl.c (293350)
1/*-
2 * Copyright (c) 2003-2009 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * Copyright (c) 2015 Alexander Motin <mav@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

--- 29 unchanged lines hidden (view full) ---

38 * CAM Target Layer, a SCSI device emulation subsystem.
39 *
40 * Author: Ken Merry <ken@FreeBSD.org>
41 */
42
43#define _CTL_C
44
45#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003-2009 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * Copyright (c) 2015 Alexander Motin <mav@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Portions of this software were developed by Edward Tomasz Napierala
8 * under sponsorship from the FreeBSD Foundation.

--- 29 unchanged lines hidden (view full) ---

38 * CAM Target Layer, a SCSI device emulation subsystem.
39 *
40 * Author: Ken Merry <ken@FreeBSD.org>
41 */
42
43#define _CTL_C
44
45#include <sys/cdefs.h>
46__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl.c 292290 2015-12-15 21:19:32Z mav $");
46__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl.c 293350 2016-01-07 20:22:55Z kib $");
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/ctype.h>
51#include <sys/kernel.h>
52#include <sys/types.h>
53#include <sys/kthread.h>
54#include <sys/bio.h>

--- 1718 unchanged lines hidden (view full) ---

1773 }
1774 mtx_unlock(&softc->ctl_lock);
1775 return (0);
1776}
1777
1778static int
1779ctl_init(void)
1780{
47
48#include <sys/param.h>
49#include <sys/systm.h>
50#include <sys/ctype.h>
51#include <sys/kernel.h>
52#include <sys/types.h>
53#include <sys/kthread.h>
54#include <sys/bio.h>

--- 1718 unchanged lines hidden (view full) ---

1773 }
1774 mtx_unlock(&softc->ctl_lock);
1775 return (0);
1776}
1777
1778static int
1779ctl_init(void)
1780{
1781 struct make_dev_args args;
1781 struct ctl_softc *softc;
1782 void *other_pool;
1783 int i, error;
1784
1785 softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF,
1786 M_WAITOK | M_ZERO);
1787
1782 struct ctl_softc *softc;
1783 void *other_pool;
1784 int i, error;
1785
1786 softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF,
1787 M_WAITOK | M_ZERO);
1788
1788 softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600,
1789 "cam/ctl");
1790 softc->dev->si_drv1 = softc;
1789 make_dev_args_init(&args);
1790 args.mda_devsw = &ctl_cdevsw;
1791 args.mda_uid = UID_ROOT;
1792 args.mda_gid = GID_OPERATOR;
1793 args.mda_mode = 0600;
1794 args.mda_si_drv1 = softc;
1795 error = make_dev_s(&args, &softc->dev, "cam/ctl");
1796 if (error != 0) {
1797 free(control_softc, M_DEVBUF);
1798 return (error);
1799 }
1791
1792 sysctl_ctx_init(&softc->sysctl_ctx);
1793 softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
1794 SYSCTL_STATIC_CHILDREN(_kern_cam), OID_AUTO, "ctl",
1795 CTLFLAG_RD, 0, "CAM Target Layer");
1796
1797 if (softc->sysctl_tree == NULL) {
1798 printf("%s: unable to allocate sysctl tree\n", __func__);

--- 11978 unchanged lines hidden ---
1800
1801 sysctl_ctx_init(&softc->sysctl_ctx);
1802 softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
1803 SYSCTL_STATIC_CHILDREN(_kern_cam), OID_AUTO, "ctl",
1804 CTLFLAG_RD, 0, "CAM Target Layer");
1805
1806 if (softc->sysctl_tree == NULL) {
1807 printf("%s: unable to allocate sysctl tree\n", __func__);

--- 11978 unchanged lines hidden ---