PERFORCE change 30283 for review
Marcel Moolenaar
marcel at FreeBSD.org
Wed Apr 30 22:14:04 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=30283
Change 30283 by marcel at marcel_pluto1 on 2003/04/30 22:13:54
IFC @30282
Affected files ...
.. //depot/projects/ia64/bin/pax/tar.1#6 integrate
.. //depot/projects/ia64/sbin/vinum/commands.c#6 integrate
.. //depot/projects/ia64/sbin/vinum/list.c#6 integrate
.. //depot/projects/ia64/sbin/vinum/v.c#5 integrate
.. //depot/projects/ia64/sbin/vinum/vext.h#6 integrate
.. //depot/projects/ia64/sys/amd64/Makefile#1 branch
.. //depot/projects/ia64/sys/amd64/acpica/OsdEnvironment.c#1 branch
.. //depot/projects/ia64/sys/amd64/acpica/acpi_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/acpica/acpi_wakeup.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/atomic.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/autoconf.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/busdma_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/critical.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/dump_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/elf_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/exception.s#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/genassym.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/identcpu.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/in_cksum.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/initcpu.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/legacy.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/locore.s#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/mem.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/nexus.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/pmap.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/sigtramp.s#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/support.s#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/swtch.s#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/sys_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/trap.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/tsc.c#1 branch
.. //depot/projects/ia64/sys/amd64/amd64/vm_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/conf/GENERIC#1 branch
.. //depot/projects/ia64/sys/amd64/conf/GENERIC.hints#1 branch
.. //depot/projects/ia64/sys/amd64/conf/Makefile#1 branch
.. //depot/projects/ia64/sys/amd64/conf/gethints.awk#1 branch
.. //depot/projects/ia64/sys/amd64/include/_inttypes.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/_types.h#2 integrate
.. //depot/projects/ia64/sys/amd64/include/asm.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/asmacros.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/atomic.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/bus.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/bus_at386.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/bus_dma.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/bus_memio.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/bus_pio.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/clock.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/cpu.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/cpufunc.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/cputypes.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/critical.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/db_machdep.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/elf.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/endian.h#2 integrate
.. //depot/projects/ia64/sys/amd64/include/exec.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/float.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/floatingpoint.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/frame.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/in_cksum.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/kse.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/legacyvar.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/md_var.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/metadata.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/mutex.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/npx.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/param.h#2 integrate
.. //depot/projects/ia64/sys/amd64/include/pc/display.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/pcb.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/pcb_ext.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/pci_cfgreg.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/pcpu.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/pmap.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/proc.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/profile.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/psl.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/ptrace.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/reg.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/reloc.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/resource.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/runq.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/segments.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/setjmp.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/sigframe.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/signal.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/smp.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/specialreg.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/sysarch.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/trap.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/tss.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/ucontext.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/varargs.h#1 branch
.. //depot/projects/ia64/sys/amd64/include/vmparam.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/clock.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/icu.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/icu_ipl.s#1 branch
.. //depot/projects/ia64/sys/amd64/isa/icu_vector.s#1 branch
.. //depot/projects/ia64/sys/amd64/isa/intr_machdep.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/intr_machdep.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/isa.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/isa.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/isa_dma.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/isa_dma.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/ithread.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/npx.c#1 branch
.. //depot/projects/ia64/sys/amd64/isa/timerreg.h#1 branch
.. //depot/projects/ia64/sys/amd64/isa/vector.s#1 branch
.. //depot/projects/ia64/sys/amd64/pci/pci_bus.c#1 branch
.. //depot/projects/ia64/sys/amd64/pci/pci_cfgreg.c#1 branch
.. //depot/projects/ia64/sys/boot/alpha/libalpha/elf_freebsd.c#2 integrate
.. //depot/projects/ia64/sys/boot/arc/lib/elf_freebsd.c#2 integrate
.. //depot/projects/ia64/sys/boot/common/Makefile.inc#4 integrate
.. //depot/projects/ia64/sys/boot/common/bootstrap.h#6 integrate
.. //depot/projects/ia64/sys/boot/common/load_elf.c#11 integrate
.. //depot/projects/ia64/sys/boot/common/load_elf32.c#1 branch
.. //depot/projects/ia64/sys/boot/common/load_elf64.c#1 branch
.. //depot/projects/ia64/sys/boot/efi/libefi/elf_freebsd.c#8 integrate
.. //depot/projects/ia64/sys/boot/i386/libi386/Makefile#7 integrate
.. //depot/projects/ia64/sys/boot/i386/libi386/amd64_tramp.S#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/biossmap.c#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/bootinfo.c#6 integrate
.. //depot/projects/ia64/sys/boot/i386/libi386/bootinfo32.c#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/bootinfo64.c#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/elf32_freebsd.c#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/elf64_freebsd.c#1 branch
.. //depot/projects/ia64/sys/boot/i386/libi386/elf_freebsd.c#3 delete
.. //depot/projects/ia64/sys/boot/i386/libi386/libi386.h#3 integrate
.. //depot/projects/ia64/sys/boot/i386/loader/conf.c#6 integrate
.. //depot/projects/ia64/sys/boot/i386/loader/main.c#4 integrate
.. //depot/projects/ia64/sys/boot/ia64/libski/elf_freebsd.c#7 integrate
.. //depot/projects/ia64/sys/boot/ofw/libofw/elf_freebsd.c#5 integrate
.. //depot/projects/ia64/sys/boot/sparc64/loader/main.c#12 integrate
.. //depot/projects/ia64/sys/conf/Makefile.amd64#2 integrate
.. //depot/projects/ia64/sys/conf/files.amd64#2 integrate
.. //depot/projects/ia64/sys/conf/ldscript.amd64#2 integrate
.. //depot/projects/ia64/sys/conf/options.amd64#2 integrate
.. //depot/projects/ia64/sys/dev/fb/fbreg.h#7 integrate
.. //depot/projects/ia64/sys/dev/fb/vga.c#11 integrate
.. //depot/projects/ia64/sys/dev/firewire/sbp.c#29 integrate
.. //depot/projects/ia64/sys/dev/kbd/atkbdc.c#6 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinum.c#9 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumconfig.c#9 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumext.h#7 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumio.c#12 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumioctl.c#11 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumkw.h#2 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumlock.c#2 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinummemory.c#4 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumparser.c#3 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumraid5.c#2 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumrequest.c#10 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumrevive.c#7 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumutil.c#2 integrate
.. //depot/projects/ia64/sys/dev/vinum/vinumvar.h#2 integrate
.. //depot/projects/ia64/sys/geom/geom_gpt.c#19 integrate
.. //depot/projects/ia64/sys/i386/include/elf.h#5 integrate
.. //depot/projects/ia64/sys/i386/include/metadata.h#1 branch
.. //depot/projects/ia64/sys/i386/include/specialreg.h#5 integrate
.. //depot/projects/ia64/sys/i386/include/vmparam.h#4 integrate
.. //depot/projects/ia64/sys/isa/vga_isa.c#5 integrate
.. //depot/projects/ia64/sys/kern/vfs_default.c#22 integrate
.. //depot/projects/ia64/sys/kern/vfs_subr.c#44 integrate
.. //depot/projects/ia64/sys/powerpc/include/metadata.h#2 integrate
.. //depot/projects/ia64/sys/powerpc/powerpc/machdep.c#26 integrate
.. //depot/projects/ia64/sys/sparc64/include/metadata.h#3 integrate
.. //depot/projects/ia64/sys/sparc64/sparc64/machdep.c#38 integrate
.. //depot/projects/ia64/sys/sys/linker.h#9 integrate
.. //depot/projects/ia64/sys/vm/vm_object.c#49 integrate
.. //depot/projects/ia64/sys/x86_64/compile/.cvsignore#2 delete
.. //depot/projects/ia64/sys/x86_64/include/_limits.h#3 delete
.. //depot/projects/ia64/sys/x86_64/include/_stdint.h#2 delete
.. //depot/projects/ia64/sys/x86_64/include/_types.h#3 delete
.. //depot/projects/ia64/sys/x86_64/include/endian.h#4 delete
.. //depot/projects/ia64/sys/x86_64/include/limits.h#6 delete
.. //depot/projects/ia64/sys/x86_64/include/param.h#3 delete
.. //depot/projects/ia64/sys/x86_64/include/stdarg.h#5 delete
.. //depot/projects/ia64/usr.bin/m4/eval.c#6 integrate
Differences ...
==== //depot/projects/ia64/bin/pax/tar.1#6 (text+ko) ====
@@ -27,7 +27,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/bin/pax/tar.1,v 1.6 2002/10/06 07:56:27 tjr Exp $
+.\" $FreeBSD: src/bin/pax/tar.1,v 1.7 2003/05/01 02:37:46 tjr Exp $
.\" $OpenBSD: tar.1,v 1.33 2001/05/01 17:58:01 aaron Exp $
.\"
.Dd February 7, 2001
@@ -41,7 +41,7 @@
.Sm off
.Op Fl
.Brq Cm crtux
-.Op Cm befhmopqsvwzHLOPXZ014578
+.Op Cm befhjmopqsvwyzHLOPXZ014578
.Sm on
.Op Ar blocksize
.Op Ar archive
==== //depot/projects/ia64/sbin/vinum/commands.c#6 (text+ko) ====
@@ -36,31 +36,11 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: commands.c,v 1.15 2001/05/22 08:40:21 grog Exp grog $
- * $FreeBSD: src/sbin/vinum/commands.c,v 1.46 2003/03/15 20:49:38 phk Exp $
+ * $Id: commands.c,v 1.22 2003/04/28 06:19:06 grog Exp $
+ * $FreeBSD: src/sbin/vinum/commands.c,v 1.47 2003/05/01 01:39:49 grog Exp $
*/
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <netdb.h>
-#include <paths.h>
-#include <setjmp.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
#include "vext.h"
-#include <sys/types.h>
-#include <sys/linker.h>
-#include <sys/module.h>
-#include <sys/resource.h>
-#include <sys/wait.h>
-#include <readline/history.h>
-#include <readline/readline.h>
#include <devstat.h>
static void dorename(struct vinum_rename_msg *msg, const char *oldname, const char *name, int maxlen);
@@ -122,8 +102,8 @@
char *configline;
configline = fgets(buffer, BUFSIZE, dfd);
- if (history)
- fprintf(history, "%s", buffer);
+ if (History)
+ fprintf(History, "%s", buffer);
if (configline == NULL) {
if (ferror(dfd))
@@ -268,6 +248,9 @@
}
}
checkupdates(); /* make sure we're updating */
+ /* Arguably we should be cleverer about this. */
+ if (no_devfs)
+ make_devices();
}
}
@@ -277,28 +260,31 @@
char reply[32];
int error;
- printf(" WARNING! This command will completely wipe out your vinum configuration.\n"
- " All data will be lost. If you really want to do this, enter the text\n\n"
- " NO FUTURE\n"
- " Enter text -> ");
- fgets(reply, sizeof(reply), stdin);
- if (strcmp(reply, "NO FUTURE\n")) /* changed his mind */
- printf("\n No change\n");
- else {
- error = ioctl(superdev, VINUM_RESETCONFIG, NULL); /* trash config on disk */
- if (error) {
- if (errno == EBUSY)
- fprintf(stderr, "Can't reset configuration: objects are in use\n");
- else
- perror("Can't find vinum config");
- } else {
- if (no_devfs)
- make_devices(); /* recreate the /dev/vinum hierarchy */
- printf("\b Vinum configuration obliterated\n");
- start_daemon(); /* then restart the daemon */
+ if (isatty(STDIN_FILENO)) {
+ printf(" WARNING! This command will completely wipe out your vinum configuration.\n"
+ " All data will be lost. If you really want to do this, enter the text\n\n"
+ " NO FUTURE\n"
+ " Enter text -> ");
+ fgets(reply, sizeof(reply), stdin);
+ if (strcmp(reply, "NO FUTURE\n")) /* changed his mind */
+ printf("\n No change\n");
+ else {
+ error = ioctl(superdev, VINUM_RESETCONFIG, NULL); /* trash config on disk */
+ if (error) {
+ if (errno == EBUSY)
+ fprintf(stderr, "Can't reset configuration: objects are in use\n");
+ else
+ perror("Can't find vinum config");
+ } else {
+ if (no_devfs)
+ make_devices(); /* recreate the /dev/vinum hierarchy */
+ printf("\b Vinum configuration obliterated\n");
+ start_daemon(); /* then restart the daemon */
+ }
}
- }
- checkupdates(); /* make sure we're updating */
+ checkupdates(); /* make sure we're updating */
+ } else
+ fprintf(stderr, "Please enter this command from a terminal\n");
}
/* Initialize subdisks */
@@ -310,8 +296,8 @@
int objno;
enum objecttype type; /* type returned */
- if (history)
- fflush(history); /* don't let all the kids do it. */
+ if (History)
+ fflush(History); /* don't let all the kids do it. */
for (objindex = 0; objindex < argc; objindex++) {
objno = find_object(argv[objindex], &type); /* find the object */
if (objno < 0)
@@ -399,13 +385,6 @@
}
}
if (failed == 0) {
-#if 0
- message->index = plexno; /* pass object number */
- message->type = plex_object; /* and type of object */
- message->state = object_up;
- message->force = 1; /* insist */
- ioctl(superdev, VINUM_SETSTATE, message);
-#endif
syslog(LOG_INFO | LOG_KERN, "plex %s initialized", plex.name);
} else
syslog(LOG_ERR | LOG_KERN, "couldn't initialize plex %s, %d processes died",
@@ -545,10 +524,11 @@
for (i = 0; i < devs; i++) {
struct devstat *stat = &statinfo.dinfo->devices[i];
+ /* Submitted by Pete Carah <pete at ns.altadena.net> */
if ((((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */
- || ((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_STORARRAY)) /* storage array */
- &&((stat->device_type & DEVSTAT_TYPE_PASS) == 0) /* and not passthrough */
- &&((stat->device_name[0] != '\0'))) { /* and it has a name */
+ ||((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_STORARRAY)) /* storage array */
+ &&((stat->device_type & DEVSTAT_TYPE_PASS) == 0) /* and not passthrough */
+ &&((stat->device_name[0] != '\0'))) { /* and it has a name */
sprintf(enamelist, _PATH_DEV "%s%d", stat->device_name, stat->unit_number);
token[tokens] = enamelist; /* point to it */
tokens++; /* one more token */
@@ -2098,7 +2078,8 @@
/*
* First, check our drives.
*/
- if (argc & 1) {
+ if ((argc < 2)
+ || (argc & 1)) {
fprintf(stderr, "You need an even number of drives to create a mirrored volume\n");
return;
}
==== //depot/projects/ia64/sbin/vinum/list.c#6 (text+ko) ====
@@ -39,27 +39,13 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: list.c,v 1.25 2000/12/20 03:38:43 grog Exp grog $
- * $FreeBSD: src/sbin/vinum/list.c,v 1.37 2003/03/15 20:49:38 phk Exp $
+ * $Id: list.c,v 1.32 2003/04/28 06:19:06 grog Exp $
+ * $FreeBSD: src/sbin/vinum/list.c,v 1.38 2003/05/01 01:38:55 grog Exp $
*/
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <netdb.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
+#include "vext.h"
#include <sys/utsname.h>
-#include <sys/resource.h>
-#include "vext.h"
#include <dev/vinum/request.h>
-/* #include <dev/vinum/vinumhdr.h> */
#include <devstat.h>
/*
@@ -599,6 +585,8 @@
(long long) sd.sectors * DEV_BSIZE,
(long long) sd.sectors / (MEGABYTE / DEV_BSIZE),
sd_state(sd.state));
+ if (sd.flags & VF_RETRYERRORS)
+ printf("\t\tretryerrors\n");
if (sd.plexno >= 0) {
get_plex_info(&plex, sd.plexno);
printf("\t\tPlex %s", plex.name);
@@ -828,6 +816,21 @@
return &text[11];
}
+/* Return the difference in microseconds between two timevals. */
+inline struct timeval
+timediff(struct timeval then, struct timeval now)
+{
+ struct timeval diff;
+
+ diff.tv_sec = now.tv_sec - then.tv_sec;
+ diff.tv_usec = now.tv_usec - then.tv_usec;
+ if (diff.tv_usec < 0) {
+ diff.tv_usec += 1000000;
+ diff.tv_sec--;
+ }
+ return diff;
+}
+
void
vinum_info(int argc, char *argv[], char *argv0[])
{
@@ -835,6 +838,8 @@
struct mc malloced;
int i;
struct rqinfo rq;
+ struct timeval lasttime; /* time of previous request */
+ struct timeval diff; /* difference from now */
if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) {
perror("Can't get vinum config");
@@ -848,7 +853,8 @@
perror("Can't get information");
return;
}
- printf("Total of %d blocks malloced, total memory: %d\nMaximum allocs: %8d, malloc table at 0x%08x\n",
+ printf("Total of %d blocks malloced, total memory: %d\n"
+ "Maximum allocs: %8d, malloc table at 0x%08x\n",
meminfo.mallocs,
meminfo.total_malloced,
meminfo.highwater,
@@ -875,147 +881,194 @@
(char *) &malloced.file);
}
if (Verbose) {
- printf("\nTime\t\t Event\t Buf\tDev\t Offset\tBytes\tSD\tSDoff\tDoffset\tGoffset\n\n");
+ if (Verbose > 1) {
+ lasttime.tv_sec = 0;
+ lasttime.tv_usec = 0;
+ printf("\n Time\t\t Event\t Buf\tDev\t Offset\t"
+ "Bytes\tSD\tSDoff\tDoffset\tGoffset\n\n");
+ } else
+ printf("\nTime\t\t Event\t Buf\tDev\t Offset\tBytes\tSD"
+ "\tSDoff\tDoffset\tGoffset\n\n");
for (i = RQINFO_SIZE - 1; i >= 0; i--) { /* go through the request list in order */
*((int *) &rq) = i;
if (ioctl(superdev, VINUM_RQINFO, &rq) < 0) {
perror("Can't get information");
return;
}
- /* Compress devminor into something printable. */
- rq.devminor = (rq.devminor & 0xff)
- | ((rq.devminor & 0xfff0000) >> 8);
- switch (rq.type) {
- case loginfo_unused: /* never been used */
- break;
+ if (rq.type != loginfo_unused) {
+ switch (Verbose) {
+ case 2:
+ if ((lasttime.tv_usec != 0) || (lasttime.tv_sec != 0)) {
+ diff = timediff(lasttime, rq.timestamp);
+ if (diff.tv_sec != 0)
+ printf("\n+ %d.%06d sec:\n ", diff.tv_sec, diff.tv_usec);
+ else
+ printf("+%6d µs ", diff.tv_usec);
+ } else
+ printf(" ");
+ break;
+
+ case 3:
+ if ((lasttime.tv_usec != 0) || (lasttime.tv_sec != 0))
+ diff = timediff(lasttime, rq.timestamp);
+ if (diff.tv_sec != 0)
+ printf("\n+ %d.%06d sec:\n ", diff.tv_sec, diff.tv_usec);
+ else if (rq.type == loginfo_iodone) {
+ diff = timediff(rq.info.rqe.launchtime, rq.timestamp);
+ printf("+%6d µs ",
+ diff.tv_usec);
+ } else
+ printf(" ");
+ break;
+
+ default:
+ break;
+ }
- case loginfo_user_bp: /* this is the bp when strategy is called */
- printf("%s %dVS %s %p\t%2d.%-6d 0x%9llx\t%d\n",
- timetext(&rq.timestamp),
- rq.type,
- rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount);
- break;
+ /* Compress devminor into something printable. */
+ rq.devminor = (rq.devminor & 0xff)
+ | ((rq.devminor & 0xfff0000) >> 8);
+ switch (rq.type) {
+ case loginfo_user_bp: /* this is the bp when strategy is called */
+ printf("%s %dVS %s %p\t%2d.%-6d 0x%9llx\t%d\n",
+ timetext(&rq.timestamp),
+ rq.type,
+ rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.b.b_blkno,
+ rq.info.b.b_bcount);
+ break;
- case loginfo_sdiol: /* subdisk I/O launch */
- case loginfo_user_bpl: /* and this is the bp at launch time */
- printf("%s %dLR %s %p\t%2d.%-6d 0x%9llx\t%ld\n",
- timetext(&rq.timestamp),
- rq.type,
- rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount);
- break;
+ case loginfo_sdiol: /* subdisk I/O launch */
+ case loginfo_user_bpl: /* and this is the bp at launch time */
+ printf("%s %dLR %s %p\t%2d.%-6d 0x%9llx\t%ld\n",
+ timetext(&rq.timestamp),
+ rq.type,
+ rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.b.b_blkno,
+ rq.info.b.b_bcount);
+ break;
- case loginfo_rqe: /* user RQE */
- printf("%s 3RQ %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
+ case loginfo_rqe: /* user RQE */
+ /*
+ * We have two timestamps
+ * in this request, and
+ * they might not agree by
+ * one or two µs. Make
+ * them agree by force.
+ */
+ rq.timestamp = rq.info.rqe.launchtime;
+ printf("%s 3RQ %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
+ timetext(&rq.timestamp),
+ rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.rqe.b.b_blkno,
+ rq.info.rqe.b.b_bcount,
+ rq.info.rqe.sdno,
+ rq.info.rqe.sdoffset,
+ rq.info.rqe.dataoffset,
+ rq.info.rqe.groupoffset);
+ break;
- case loginfo_iodone: /* iodone called */
- printf("%s 4DN %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
+ case loginfo_iodone: /* iodone called */
+ printf("%s 4DN %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
+ timetext(&rq.timestamp),
+ rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.rqe.b.b_blkno,
+ rq.info.rqe.b.b_bcount,
+ rq.info.rqe.sdno,
+ rq.info.rqe.sdoffset,
+ rq.info.rqe.dataoffset,
+ rq.info.rqe.groupoffset);
+ break;
- case loginfo_raid5_data: /* RAID-5 write data block */
- printf("%s 5RD %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
+ case loginfo_raid5_data: /* RAID-5 write data block */
+ printf("%s 5RD %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
+ timetext(&rq.timestamp),
+ rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.rqe.b.b_blkno,
+ rq.info.rqe.b.b_bcount,
+ rq.info.rqe.sdno,
+ rq.info.rqe.sdoffset,
+ rq.info.rqe.dataoffset,
+ rq.info.rqe.groupoffset);
+ break;
- case loginfo_raid5_parity: /* RAID-5 write parity block */
- printf("%s 6RP %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
- timetext(&rq.timestamp),
- rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.devmajor,
- rq.devminor,
- rq.info.rqe.b.b_blkno,
- rq.info.rqe.b.b_bcount,
- rq.info.rqe.sdno,
- rq.info.rqe.sdoffset,
- rq.info.rqe.dataoffset,
- rq.info.rqe.groupoffset);
- break;
+ case loginfo_raid5_parity: /* RAID-5 write parity block */
+ printf("%s 6RP %s %p\t%2d.%-6d 0x%9llx\t%ld\t%d\t%6x\t%6x\t%x\n",
+ timetext(&rq.timestamp),
+ rq.info.rqe.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.devmajor,
+ rq.devminor,
+ rq.info.rqe.b.b_blkno,
+ rq.info.rqe.b.b_bcount,
+ rq.info.rqe.sdno,
+ rq.info.rqe.sdoffset,
+ rq.info.rqe.dataoffset,
+ rq.info.rqe.groupoffset);
+ break;
- case loginfo_sdio: /* subdisk I/O */
- printf("%s %dVS %s %p\t\t 0x%9llx\t%ld\t%d\n",
- timetext(&rq.timestamp),
- rq.type,
- rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount,
- rq.devminor);
- break;
+ case loginfo_sdio: /* subdisk I/O */
+ printf("%s %dVS %s %p\t\t 0x%9llx\t%ld\t%d\n",
+ timetext(&rq.timestamp),
+ rq.type,
+ rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.info.b.b_blkno,
+ rq.info.b.b_bcount,
+ rq.devminor);
+ break;
- case loginfo_sdiodone: /* subdisk I/O done */
- printf("%s %dSD %s %p\t\t 0x%9llx\t%ld\t%d\n",
- timetext(&rq.timestamp),
- rq.type,
- rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
- rq.bp,
- rq.info.b.b_blkno,
- rq.info.b.b_bcount,
- rq.devminor);
- break;
+ case loginfo_sdiodone: /* subdisk I/O done */
+ printf("%s %dSD %s %p\t\t 0x%9llx\t%ld\t%d\n",
+ timetext(&rq.timestamp),
+ rq.type,
+ rq.info.b.b_iocmd == BIO_READ ? "Read " : "Write",
+ rq.bp,
+ rq.info.b.b_blkno,
+ rq.info.b.b_bcount,
+ rq.devminor);
+ break;
- case loginfo_lockwait:
- printf("%s Lockwait %p\t 0x%x\n",
- timetext(&rq.timestamp),
- rq.bp,
- rq.info.lockinfo.stripe);
- break;
+ case loginfo_lockwait:
+ printf("%s Lockwait %p\t 0x%x\n",
+ timetext(&rq.timestamp),
+ rq.bp,
+ rq.info.lockinfo.stripe);
+ break;
- case loginfo_lock:
- printf("%s Lock %p\t 0x%x\n",
- timetext(&rq.timestamp),
- rq.bp,
- rq.info.lockinfo.stripe);
- break;
+ case loginfo_lock:
+ printf("%s Lock %p\t 0x%x\n",
+ timetext(&rq.timestamp),
+ rq.bp,
+ rq.info.lockinfo.stripe);
+ break;
- case loginfo_unlock:
- printf("%s Unlock\t %p\t 0x%x\n",
- timetext(&rq.timestamp),
- rq.bp,
- rq.info.lockinfo.stripe);
- break;
+ case loginfo_unlock:
+ printf("%s Unlock\t %p\t 0x%x\n",
+ timetext(&rq.timestamp),
+ rq.bp,
+ rq.info.lockinfo.stripe);
+ break;
+ default:
+ printf("*** invalid log type: %d ***\n", rq.type);
+ }
+ if (Verbose > 1)
+ lasttime = rq.timestamp;
}
}
}
@@ -1214,7 +1267,7 @@
{
int i;
- if (argc == 0) { /* start everything */
+ if (argc == 0) { /* dump everything */
int devs = devstat_getnumdevs(NULL);
struct statinfo statinfo;
char *namelist;
==== //depot/projects/ia64/sbin/vinum/v.c#5 (text+ko) ====
@@ -36,37 +36,14 @@
* otherwise) arising in any way out of the use of this software, even if
* advised of the possibility of such damage.
*
- * $Id: v.c,v 1.31 2000/09/03 01:29:26 grog Exp grog $
- * $FreeBSD: src/sbin/vinum/v.c,v 1.37 2003/01/16 23:48:34 joerg Exp $
+ * $Id: v.c,v 1.35 2003/04/26 02:02:49 grog Exp $
+ * $FreeBSD: src/sbin/vinum/v.c,v 1.38 2003/05/01 01:39:42 grog Exp $
*/
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <grp.h>
-#include <sys/mman.h>
-#include <netdb.h>
-#include <paths.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
#include "vext.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <readline/history.h>
-#include <readline/readline.h>
-#include <sys/linker.h>
-#include <sys/module.h>
-#include <sys/resource.h>
-#include <sys/sysctl.h>
FILE *cf; /* config file handle */
-FILE *history; /* history file */
+FILE *History; /* history file */
char *historyfile; /* and its name */
char *dateformat; /* format in which to store date */
@@ -150,11 +127,11 @@
errno);
exit(1);
}
- history = fopen(historyfile, "a+");
- if (history != NULL) {
+ History = fopen(historyfile, "a+");
+ if (History != NULL) {
timestamp();
- fprintf(history, "*** " VINUMMOD " started ***\n");
- fflush(history); /* before we start the daemon */
+ fprintf(History, "*** " VINUMMOD " started ***\n");
+ fflush(History); /* before we start the daemon */
}
if (sysctlbyname("vfs.devfs.generation", NULL, NULL, NULL, 0) == 0)
no_devfs = 0;
@@ -246,8 +223,8 @@
if (tokens)
parseline(tokens, token); /* and do what he says */
}
- if (history)
- fflush(history);
+ if (History)
+ fflush(History);
}
}
return 0; /* normal completion */
@@ -336,11 +313,11 @@
int j;
enum keyword command; /* command to execute */
- if (history != NULL) { /* save the command to history file */
+ if (History != NULL) { /* save the command to history file */
timestamp();
for (i = 0; i < args; i++) /* all args */
- fprintf(history, "%s ", argv[i]);
- fputs("\n", history);
+ fprintf(History, "%s ", argv[i]);
+ fputs("\n", History);
}
if ((args == 0) /* empty line */
||(*argv[0] == '#')) /* or a comment, */
@@ -544,9 +521,9 @@
perror(VINUMMOD ": Can't write to " _PATH_DEV);
return;
}
- if (history) {
+ if (History) {
timestamp();
- fprintf(history, "*** Created devices ***\n");
+ fprintf(History, "*** Created devices ***\n");
}
if (superdev >= 0) /* super device open */
close(superdev);
@@ -559,10 +536,9 @@
if (mknod(VINUM_SUPERDEV_NAME,
S_IRUSR | S_IWUSR | S_IFCHR, /* user only */
- makedev(VINUM_CDEV_MAJOR, VINUM_SUPERDEV)) < 0)
+ makedev(VINUM_CDEV_MAJOR, VINUM_SUPERDEV_VOL)) < 0)
fprintf(stderr, "Can't create %s: %s\n", VINUM_SUPERDEV_NAME, strerror(errno));
-
superdev = open(VINUM_SUPERDEV_NAME, O_RDWR); /* open the super device */
if (superdev < 0) {
perror(VINUM_SUPERDEV_NAME);
@@ -570,7 +546,7 @@
}
if (mknod(VINUM_DAEMON_DEV_NAME, /* daemon super device */
S_IRUSR | S_IWUSR | S_IFCHR, /* user only */
- makedev(VINUM_CDEV_MAJOR, VINUM_DAEMON_DEV)) < 0)
+ makedev(VINUM_CDEV_MAJOR, VINUM_DAEMON_VOL)) < 0)
fprintf(stderr, "Can't create %s: %s\n", VINUM_DAEMON_DEV_NAME, strerror(errno));
if (ioctl(superdev, VINUM_GETCONFIG, &vinum_conf) < 0) {
@@ -608,26 +584,29 @@
get_volume_info(&vol, volno);
if (vol.state != volume_unallocated) { /* we could have holes in our lists */
- voldev = VINUMDEV(volno, 0, 0, VINUM_VOLUME_TYPE); /* create a device number */
+ voldev = VINUMDEV(volno, VINUM_VOLUME_TYPE); /* create a device number */
/* Create /dev/vinum/<myvol> */
sprintf(filename, VINUM_DIR "/%s", vol.name);
if (mknod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, voldev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
/* Create /dev/vinum/vol/<myvol> */
sprintf(filename, VINUM_DIR "/vol/%s", vol.name);
if (mknod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, voldev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
if (vol.plexes > 0) {
/* Create /dev/vinum/vol/<myvol>.plex/ */
sprintf(filename, VINUM_DIR "/vol/%s.plex", vol.name);
if (mkdir(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IXOTH) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
}
if (recurse)
for (plexno = 0; plexno < vol.plexes; plexno++)
@@ -654,23 +633,26 @@
sprintf(filename, VINUM_DIR "/plex/%s", plex.name);
if (mknod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, plexdev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
if (plex.volno >= 0) {
get_volume_info(&vol, plex.volno);
- plexdev = VINUMDEV(plex.volno, plexno, 0, VINUM_PLEX_TYPE);
+ plexdev = VINUMDEV(plex.volno, VINUM_PLEX_TYPE);
/* Create device /dev/vinum/vol/<vol>.plex/<plex> */
sprintf(filename, VINUM_DIR "/vol/%s.plex/%s", vol.name, plex.name);
if (mknod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, plexdev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
/* Create directory /dev/vinum/vol/<vol>.plex/<plex>.sd */
sprintf(filename, VINUM_DIR "/vol/%s.plex/%s.sd", vol.name, plex.name);
if (mkdir(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IXOTH) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
}
if (recurse) {
for (sdno = 0; sdno < plex.subdisks; sdno++) {
@@ -696,7 +678,8 @@
sprintf(filename, VINUM_DIR "/sd/%s", sd.name);
if (mknod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, sddev) < 0)
fprintf(stderr, "Can't create %s: %s\n", filename, strerror(errno));
- (void)chown(filename, UID_ROOT, gid_operator);
+ else
+ chown(filename, UID_ROOT, gid_operator);
}
}
@@ -877,7 +860,7 @@
char datetext[MAXDATETEXT];
time_t sec;
- if (history != NULL) {
+ if (History != NULL) {
if (gettimeofday(&now, NULL) != 0) {
fprintf(stderr, "Can't get time: %s\n", strerror(errno));
return;
@@ -885,7 +868,7 @@
sec = now.tv_sec;
date = localtime(&sec);
strftime(datetext, MAXDATETEXT, dateformat, date),
- fprintf(history,
+ fprintf(History,
"%s.%06ld ",
datetext,
now.tv_usec);
==== //depot/projects/ia64/sbin/vinum/vext.h#6 (text+ko) ====
@@ -35,14 +35,15 @@
*/
/*
- * $Id: vext.h,v 1.19 2001/05/23 23:00:12 grog Exp grog $
- * $FreeBSD: src/sbin/vinum/vext.h,v 1.26 2003/02/16 14:13:23 phk Exp $
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list