geom_dev.c (104357) | geom_dev.c (104452) |
---|---|
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 * | 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_dev.c 104357 2002-10-02 07:48:39Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_dev.c 104452 2002-10-04 10:38:36Z phk $ |
36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/conf.h> 43#include <sys/bio.h> --- 182 unchanged lines hidden (view full) --- 226{ 227 struct g_geom *gp, *gp2; 228 struct g_consumer *cp; 229 struct g_provider *pp2; 230 struct g_kerneldump kd; 231 int i, error; 232 u_int u; 233 struct g_ioctl *gio; | 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/malloc.h> 41#include <sys/kernel.h> 42#include <sys/conf.h> 43#include <sys/bio.h> --- 182 unchanged lines hidden (view full) --- 226{ 227 struct g_geom *gp, *gp2; 228 struct g_consumer *cp; 229 struct g_provider *pp2; 230 struct g_kerneldump kd; 231 int i, error; 232 u_int u; 233 struct g_ioctl *gio; |
234#if 0 |
|
234 struct sbuf *usb, *sb; | 235 struct sbuf *usb, *sb; |
236#endif |
|
235 236 gp = dev->si_drv1; 237 cp = dev->si_drv2; 238 pp2 = cp->provider; 239 gp2 = pp2->geom; 240 241 error = 0; 242 DROP_GIANT(); --- 24 unchanged lines hidden (view full) --- 267 } 268 kd.offset = 0; 269 kd.length = OFF_MAX; 270 i = sizeof kd; 271 error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); 272 if (!error) 273 dev->si_flags |= SI_DUMPDEV; 274 break; | 237 238 gp = dev->si_drv1; 239 cp = dev->si_drv2; 240 pp2 = cp->provider; 241 gp2 = pp2->geom; 242 243 error = 0; 244 DROP_GIANT(); --- 24 unchanged lines hidden (view full) --- 269 } 270 kd.offset = 0; 271 kd.length = OFF_MAX; 272 i = sizeof kd; 273 error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); 274 if (!error) 275 dev->si_flags |= SI_DUMPDEV; 276 break; |
277#if 0 |
|
275 case GEOMGETCONF: 276 /* we bogusly pass cp to avoid getting any consumers listed */ 277 sb = g_conf_specific(gp2->class, gp2, pp2, cp); 278 usb = (struct sbuf *)data; 279 if (usb->s_size - 1 < sbuf_len(sb)) 280 error = ENOMEM; 281 else 282 error = copyout(sbuf_data(sb), usb->s_buf, sbuf_len(sb) + 1); 283 if (!error) 284 usb->s_len = sbuf_len(sb); 285 break; | 278 case GEOMGETCONF: 279 /* we bogusly pass cp to avoid getting any consumers listed */ 280 sb = g_conf_specific(gp2->class, gp2, pp2, cp); 281 usb = (struct sbuf *)data; 282 if (usb->s_size - 1 < sbuf_len(sb)) 283 error = ENOMEM; 284 else 285 error = copyout(sbuf_data(sb), usb->s_buf, sbuf_len(sb) + 1); 286 if (!error) 287 usb->s_len = sbuf_len(sb); 288 break; |
289#endif |
|
286 default: 287 gio = g_malloc(sizeof *gio, M_WAITOK); 288 gio->cmd = cmd; 289 gio->data = data; 290 gio->fflag = fflag; 291 gio->td = td; 292 i = sizeof *gio; 293 if (cmd & IOC_IN) --- 124 unchanged lines hidden --- | 290 default: 291 gio = g_malloc(sizeof *gio, M_WAITOK); 292 gio->cmd = cmd; 293 gio->data = data; 294 gio->fflag = fflag; 295 gio->td = td; 296 i = sizeof *gio; 297 if (cmd & IOC_IN) --- 124 unchanged lines hidden --- |