dconf.c (a10acbd6b2fd751eb85d16ec41398d20ff8c067e) | dconf.c (e7cbe64f7a72dae5cb44f100db60ca88f3313c65) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. 24 */ 25 26#pragma ident "%Z%%M% %I% %E% SMI" 27 28#include <sys/types.h> 29#include <sys/stat.h> 30#include <sys/swap.h> 31#include <sys/dumpadm.h> 32#include <sys/utsname.h> 33 34#include <unistd.h> 35#include <string.h> 36#include <stdlib.h> 37#include <stdio.h> 38#include <fcntl.h> 39#include <errno.h> 40#include <libdiskmgt.h> | 23 * Use is subject to license terms. 24 */ 25 26#pragma ident "%Z%%M% %I% %E% SMI" 27 28#include <sys/types.h> 29#include <sys/stat.h> 30#include <sys/swap.h> 31#include <sys/dumpadm.h> 32#include <sys/utsname.h> 33 34#include <unistd.h> 35#include <string.h> 36#include <stdlib.h> 37#include <stdio.h> 38#include <fcntl.h> 39#include <errno.h> 40#include <libdiskmgt.h> |
41#include <libzfs.h> |
|
41 42#include "dconf.h" 43#include "minfree.h" 44#include "utils.h" 45#include "swap.h" 46 47typedef struct dc_token { 48 const char *tok_name; --- 289 unchanged lines hidden (view full) --- 338 339 switch (errno) { 340 case ENOTSUP: 341 warn(gettext("dumps not supported on %s\n"), dcp->dc_device); 342 break; 343 case EBUSY: 344 warn(gettext("device %s is already in use\n"), dcp->dc_device); 345 break; | 42 43#include "dconf.h" 44#include "minfree.h" 45#include "utils.h" 46#include "swap.h" 47 48typedef struct dc_token { 49 const char *tok_name; --- 289 unchanged lines hidden (view full) --- 339 340 switch (errno) { 341 case ENOTSUP: 342 warn(gettext("dumps not supported on %s\n"), dcp->dc_device); 343 break; 344 case EBUSY: 345 warn(gettext("device %s is already in use\n"), dcp->dc_device); 346 break; |
347 case EBADR: 348 /* ZFS pool is too fragmented to support a dump device */ 349 warn(gettext("device %s is too fragmented to be used as " 350 "a dump device\n"), dcp->dc_device); 351 break; |
|
346 default: 347 /* 348 * NOTE: The stmsboot(1M) command's boot-up script parses this 349 * error to get the dump device name. If you change the format 350 * of this message, make sure that stmsboot(1M) is in sync. 351 */ 352 warn(gettext("cannot use %s as dump device"), dcp->dc_device); 353 } --- 88 unchanged lines hidden (view full) --- 442 goto err; 443 444 if (open_stat64(dcp->dc_device, &st) == -1) { 445 warn(gettext("failed to access %s"), 446 dcp->dc_device); 447 goto err; 448 } 449 | 352 default: 353 /* 354 * NOTE: The stmsboot(1M) command's boot-up script parses this 355 * error to get the dump device name. If you change the format 356 * of this message, make sure that stmsboot(1M) is in sync. 357 */ 358 warn(gettext("cannot use %s as dump device"), dcp->dc_device); 359 } --- 88 unchanged lines hidden (view full) --- 448 goto err; 449 450 if (open_stat64(dcp->dc_device, &st) == -1) { 451 warn(gettext("failed to access %s"), 452 dcp->dc_device); 453 goto err; 454 } 455 |
456 if ((error = zvol_check_dump_config( 457 dcp->dc_device)) > 0) 458 goto err; |
|
450 if (ioctl(dcp->dc_dump_fd, DIOCGETDUMPSIZE, &d) == -1) { 451 warn(gettext("failed to get kernel dump size")); 452 goto err; 453 } 454 455 if (st.st_size < d) { 456 warn(gettext("dump device %s is too small to " 457 "hold a system dump\ndump size %llu " --- 168 unchanged lines hidden --- | 459 if (ioctl(dcp->dc_dump_fd, DIOCGETDUMPSIZE, &d) == -1) { 460 warn(gettext("failed to get kernel dump size")); 461 goto err; 462 } 463 464 if (st.st_size < d) { 465 warn(gettext("dump device %s is too small to " 466 "hold a system dump\ndump size %llu " --- 168 unchanged lines hidden --- |