Source-Changes-HG archive

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

[src/trunk]: src/sbin/dkscan_bsdlabel use a minimal "struct disk" in userland...



details:   https://anonhg.NetBSD.org/src/rev/a2f16c866886
branches:  trunk
changeset: 354261:a2f16c866886
user:      chs <chs%NetBSD.org@localhost>
date:      Thu Jun 08 22:24:29 2017 +0000

description:
use a minimal "struct disk" in userland rather than the full kernel structure.
needed due to upcoming sys/disk.h changes needed for ZFS.

diffstat:

 sbin/dkscan_bsdlabel/dkscan_bsdlabel.c |  9 +++++++--
 sbin/dkscan_bsdlabel/dkscan_util.h     |  4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r 20a95a8340d9 -r a2f16c866886 sbin/dkscan_bsdlabel/dkscan_bsdlabel.c
--- a/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c    Thu Jun 08 22:23:56 2017 +0000
+++ b/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c    Thu Jun 08 22:24:29 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkscan_bsdlabel.c,v 1.3 2011/08/27 16:43:07 joerg Exp $ */
+/* $NetBSD: dkscan_bsdlabel.c,v 1.4 2017/06/08 22:24:29 chs Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -41,6 +41,11 @@
 
 #include "dkscan_util.h"
 
+struct disk {
+       const char      *dk_name;       /* disk name */
+       int             dk_blkshift;    /* shift to convert DEV_BSIZE to blks */
+};
+
 #include "dkwedge_bsdlabel.c"
 
 __dead static void usage(void);
@@ -80,7 +85,7 @@
                devpart = argv[optind];
 
        memset(&d, 0, sizeof(d));
-       d.dk_name  = __UNCONST(devpart);
+       d.dk_name  = devpart;
        dkwedge_discover_bsdlabel(&d, NULL);
 
        close(disk_fd);
diff -r 20a95a8340d9 -r a2f16c866886 sbin/dkscan_bsdlabel/dkscan_util.h
--- a/sbin/dkscan_bsdlabel/dkscan_util.h        Thu Jun 08 22:23:56 2017 +0000
+++ b/sbin/dkscan_bsdlabel/dkscan_util.h        Thu Jun 08 22:24:29 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkscan_util.h,v 1.4 2012/03/15 02:02:21 joerg Exp $ */
+/* $NetBSD: dkscan_util.h,v 1.5 2017/06/08 22:24:29 chs Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -34,6 +34,8 @@
 
 u_int dkcksum(struct disklabel *);
 u_int dkcksum_sized(struct disklabel *, size_t);
+struct disk;
+struct vnode;
 int dkwedge_read(struct disk *pdk, struct vnode *vp, daddr_t blkno,
        void *tbuf, size_t len);
 int dkwedge_add(struct dkwedge_info *dkw);



Home | Main Index | Thread Index | Old Index