Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/dkctl Add 'makewedges' option to autodiscover wedges fr...



details:   https://anonhg.NetBSD.org/src/rev/ff2eb5b69255
branches:  trunk
changeset: 333438:ff2eb5b69255
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Tue Nov 04 08:00:44 2014 +0000

description:
Add 'makewedges' option to autodiscover wedges from a changed label.

diffstat:

 sbin/dkctl/dkctl.8 |   7 ++++++-
 sbin/dkctl/dkctl.c |  24 ++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 3 deletions(-)

diffs (80 lines):

diff -r 0260f3cb702d -r ff2eb5b69255 sbin/dkctl/dkctl.8
--- a/sbin/dkctl/dkctl.8        Tue Nov 04 07:51:54 2014 +0000
+++ b/sbin/dkctl/dkctl.8        Tue Nov 04 08:00:44 2014 +0000
@@ -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 @@
 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.
diff -r 0260f3cb702d -r ff2eb5b69255 sbin/dkctl/dkctl.c
--- a/sbin/dkctl/dkctl.c        Tue Nov 04 07:51:54 2014 +0000
+++ b/sbin/dkctl/dkctl.c        Tue Nov 04 08:00:44 2014 +0000
@@ -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_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 @@
          disk_listwedges,
          O_RDONLY },
 
+       { "makewedges",
+         "",
+         disk_makewedges,
+         O_RDWR },
+
        { "strategy",
          "[name]",
          disk_strategy,
@@ -666,6 +672,20 @@
        }
 }
 
+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)
 {



Home | Main Index | Thread Index | Old Index