Module Name:    src
Committed By:   chs
Date:           Thu Jun  8 22:24:29 UTC 2017

Modified Files:
        src/sbin/dkscan_bsdlabel: dkscan_bsdlabel.c dkscan_util.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c
cvs rdiff -u -r1.4 -r1.5 src/sbin/dkscan_bsdlabel/dkscan_util.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c
diff -u src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.3 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.4
--- src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.3	Sat Aug 27 16:43:07 2011
+++ src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c	Thu Jun  8 22:24:29 2017
@@ -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 @@ main(int argc, char **argv)
 		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);

Index: src/sbin/dkscan_bsdlabel/dkscan_util.h
diff -u src/sbin/dkscan_bsdlabel/dkscan_util.h:1.4 src/sbin/dkscan_bsdlabel/dkscan_util.h:1.5
--- src/sbin/dkscan_bsdlabel/dkscan_util.h:1.4	Thu Mar 15 02:02:21 2012
+++ src/sbin/dkscan_bsdlabel/dkscan_util.h	Thu Jun  8 22:24:29 2017
@@ -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);

Reply via email to