geom_ccd.c (181463) | geom_ccd.c (185318) |
---|---|
1/*- 2 * Copyright (c) 2003 Poul-Henning Kamp. 3 * Copyright (c) 1995 Jason R. Thorpe. 4 * Copyright (c) 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * All rights reserved. 7 * Copyright (c) 1988 University of Utah. 8 * --- 36 unchanged lines hidden (view full) --- 45 * Moffett Field, CA 94035 46 * 47 * from: Utah $Hdr: cd.c 1.6 90/11/28$ 48 * @(#)cd.c 8.2 (Berkeley) 11/16/93 49 * $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ 50 */ 51 52#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 Poul-Henning Kamp. 3 * Copyright (c) 1995 Jason R. Thorpe. 4 * Copyright (c) 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * All rights reserved. 7 * Copyright (c) 1988 University of Utah. 8 * --- 36 unchanged lines hidden (view full) --- 45 * Moffett Field, CA 94035 46 * 47 * from: Utah $Hdr: cd.c 1.6 90/11/28$ 48 * @(#)cd.c 8.2 (Berkeley) 11/16/93 49 * $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ 50 */ 51 52#include <sys/cdefs.h> |
53__FBSDID("$FreeBSD: head/sys/geom/geom_ccd.c 181463 2008-08-09 11:14:05Z des $"); | 53__FBSDID("$FreeBSD: head/sys/geom/geom_ccd.c 185318 2008-11-25 20:28:33Z lulf $"); |
54 55#include <sys/param.h> 56#include <sys/systm.h> 57#include <sys/kernel.h> 58#include <sys/module.h> 59#include <sys/bio.h> 60#include <sys/malloc.h> 61#include <geom/geom.h> --- 642 unchanged lines hidden (view full) --- 704 struct g_provider *pp; 705 struct ccd_s *sc; 706 struct sbuf *sb; 707 char buf[20]; 708 int i, error; 709 710 g_topology_assert(); 711 unit = gctl_get_paraml(req, "unit", sizeof (*unit)); | 54 55#include <sys/param.h> 56#include <sys/systm.h> 57#include <sys/kernel.h> 58#include <sys/module.h> 59#include <sys/bio.h> 60#include <sys/malloc.h> 61#include <geom/geom.h> --- 642 unchanged lines hidden (view full) --- 704 struct g_provider *pp; 705 struct ccd_s *sc; 706 struct sbuf *sb; 707 char buf[20]; 708 int i, error; 709 710 g_topology_assert(); 711 unit = gctl_get_paraml(req, "unit", sizeof (*unit)); |
712 if (unit == NULL) { 713 gctl_error(req, "unit parameter not given"); 714 return; 715 } |
|
712 ileave = gctl_get_paraml(req, "ileave", sizeof (*ileave)); | 716 ileave = gctl_get_paraml(req, "ileave", sizeof (*ileave)); |
717 if (ileave == NULL) { 718 gctl_error(req, "ileave parameter not given"); 719 return; 720 } |
|
713 nprovider = gctl_get_paraml(req, "nprovider", sizeof (*nprovider)); | 721 nprovider = gctl_get_paraml(req, "nprovider", sizeof (*nprovider)); |
722 if (nprovider == NULL) { 723 gctl_error(req, "nprovider parameter not given"); 724 return; 725 } |
|
714 715 /* Check for duplicate unit */ 716 LIST_FOREACH(gp, &mp->geom, geom) { 717 sc = gp->softc; 718 if (sc != NULL && sc->sc_unit == *unit) { 719 gctl_error(req, "Unit %d already configured", *unit); 720 return; 721 } --- 111 unchanged lines hidden (view full) --- 833static void 834g_ccd_list(struct gctl_req *req, struct g_class *mp) 835{ 836 struct sbuf *sb; 837 struct ccd_s *cs; 838 struct g_geom *gp; 839 int i, unit, *up; 840 | 726 727 /* Check for duplicate unit */ 728 LIST_FOREACH(gp, &mp->geom, geom) { 729 sc = gp->softc; 730 if (sc != NULL && sc->sc_unit == *unit) { 731 gctl_error(req, "Unit %d already configured", *unit); 732 return; 733 } --- 111 unchanged lines hidden (view full) --- 845static void 846g_ccd_list(struct gctl_req *req, struct g_class *mp) 847{ 848 struct sbuf *sb; 849 struct ccd_s *cs; 850 struct g_geom *gp; 851 int i, unit, *up; 852 |
841 up = gctl_get_paraml(req, "unit", sizeof (int)); | 853 up = gctl_get_paraml(req, "unit", sizeof (*up)); 854 if (up == NULL) { 855 gctl_error(req, "unit parameter not given"); 856 return; 857 } |
842 unit = *up; 843 sb = sbuf_new_auto(); 844 LIST_FOREACH(gp, &mp->geom, geom) { 845 cs = gp->softc; 846 if (cs == NULL || (unit >= 0 && unit != cs->sc_unit)) 847 continue; 848 sbuf_printf(sb, "ccd%d\t\t%d\t%d\t", 849 cs->sc_unit, cs->sc_ileave, cs->sc_flags & CCDF_USERMASK); --- 42 unchanged lines hidden --- | 858 unit = *up; 859 sb = sbuf_new_auto(); 860 LIST_FOREACH(gp, &mp->geom, geom) { 861 cs = gp->softc; 862 if (cs == NULL || (unit >= 0 && unit != cs->sc_unit)) 863 continue; 864 sbuf_printf(sb, "ccd%d\t\t%d\t%d\t", 865 cs->sc_unit, cs->sc_ileave, cs->sc_flags & CCDF_USERMASK); --- 42 unchanged lines hidden --- |