use a minimal "struct disk" in userland rather than the full kernel structure.

needed due to upcoming sys/disk.h changes needed for ZFS.
This commit is contained in:
chs 2017-06-08 22:24:29 +00:00
parent 5d781b0ad8
commit 71997035dc
2 changed files with 10 additions and 3 deletions

View File

@ -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);

View File

@ -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);