Module Name: src
Committed By: mlelstv
Date: Tue Nov 4 08:00:44 UTC 2014
Modified Files:
src/sbin/dkctl: dkctl.8 dkctl.c
Log Message:
Add 'makewedges' option to autodiscover wedges from a changed label.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sbin/dkctl/dkctl.8
cvs rdiff -u -r1.20 -r1.21 src/sbin/dkctl/dkctl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/dkctl/dkctl.8
diff -u src/sbin/dkctl/dkctl.8:1.23 src/sbin/dkctl/dkctl.8:1.24
--- src/sbin/dkctl/dkctl.8:1.23 Tue Jan 4 23:29:51 2011
+++ src/sbin/dkctl/dkctl.8 Tue Nov 4 08:00:44 2014
@@ -1,4 +1,4 @@
-.\" $NetBSD: dkctl.8,v 1.23 2011/01/04 23:29:51 wiz Exp $
+.\" $NetBSD: dkctl.8,v 1.24 2014/11/04 08:00:44 mlelstv Exp $
.\"
.\" Copyright 2002 Wasabi Systems, Inc.
.\" All rights reserved.
@@ -165,6 +165,11 @@ Display information about the specified
in this case is the wedge name.
.It Ic listwedges
List all of the wedges configured on the specified disk.
+.It Ic makewedges
+Delete all wedges configured on the specified disk, and autodiscover
+the wedges again. Wedges that are in use are not deleted and conflicting
+or overlapping wedges are not created. You need to list wedges
+to find out what has changed.
.It Ic strategy Op Ar name
Get and set the disk I/O scheduler (buffer queue strategy) on the
drive.
Index: src/sbin/dkctl/dkctl.c
diff -u src/sbin/dkctl/dkctl.c:1.20 src/sbin/dkctl/dkctl.c:1.21
--- src/sbin/dkctl/dkctl.c:1.20 Sat Aug 27 16:34:38 2011
+++ src/sbin/dkctl/dkctl.c Tue Nov 4 08:00:44 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: dkctl.c,v 1.20 2011/08/27 16:34:38 joerg Exp $ */
+/* $NetBSD: dkctl.c,v 1.21 2014/11/04 08:00:44 mlelstv Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: dkctl.c,v 1.20 2011/08/27 16:34:38 joerg Exp $");
+__RCSID("$NetBSD: dkctl.c,v 1.21 2014/11/04 08:00:44 mlelstv Exp $");
#endif
@@ -101,6 +101,7 @@ static void disk_addwedge(int, char *[])
static void disk_delwedge(int, char *[]);
static void disk_getwedgeinfo(int, char *[]);
static void disk_listwedges(int, char *[]);
+static void disk_makewedges(int, char *[]);
static void disk_strategy(int, char *[]);
static struct command commands[] = {
@@ -149,6 +150,11 @@ static struct command commands[] = {
disk_listwedges,
O_RDONLY },
+ { "makewedges",
+ "",
+ disk_makewedges,
+ O_RDWR },
+
{ "strategy",
"[name]",
disk_strategy,
@@ -666,6 +672,20 @@ disk_listwedges(int argc, char *argv[])
}
}
+static void
+disk_makewedges(int argc, char *argv[])
+{
+ int bits;
+
+ if (argc != 0)
+ usage();
+
+ if (ioctl(fd, DIOCMWEDGES, &bits) == -1)
+ err(1, "%s: makewedges", dvname);
+ else
+ printf("successfully scanned %s.\n", dvname);
+}
+
static int
dkw_sort(const void *a, const void *b)
{