CVS commit: src/sbin/dkscan_bsdlabel
Module Name:src Committed By: jdolecek Date: Sat Apr 11 17:21:16 UTC 2020 Modified Files: src/sbin/dkscan_bsdlabel: dkscan_bsdlabel.c Log Message: adjust to work with updated dkwedge_bsdlabel.c - provide geteblk() and brelse() which just allocate/free the memory To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.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/dkscan_bsdlabel/dkscan_bsdlabel.c diff -u src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.4 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.5 --- src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.4 Thu Jun 8 22:24:29 2017 +++ src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c Sat Apr 11 17:21:16 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dkscan_bsdlabel.c,v 1.4 2017/06/08 22:24:29 chs Exp $ */ +/* $NetBSD: dkscan_bsdlabel.c,v 1.5 2020/04/11 17:21:16 jdolecek Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -38,6 +38,7 @@ #include #include #include +#include #include "dkscan_util.h" @@ -46,6 +47,22 @@ struct disk { int dk_blkshift; /* shift to convert DEV_BSIZE to blks */ }; +static struct buf * +geteblk(int size) +{ + struct buf *bp = malloc(sizeof(*bp) + size); + + bp->b_data = (void *)[1]; + + return bp; +} + +static void +brelse(struct buf *bp, int set) +{ + free(bp); +} + #include "dkwedge_bsdlabel.c" __dead static void usage(void);
CVS commit: src/sbin/dkscan_bsdlabel
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(, 0, sizeof(d)); - d.dk_name = __UNCONST(devpart); + d.dk_name = devpart; dkwedge_discover_bsdlabel(, 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);
CVS commit: src/sbin/dkscan_bsdlabel
Module Name:src Committed By: dsl Date: Tue Jan 1 18:44:27 UTC 2013 Modified Files: src/sbin/dkscan_bsdlabel: dkscan_util.c Log Message: Explicitly include sys/ioctl.h To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/dkscan_bsdlabel/dkscan_util.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/dkscan_bsdlabel/dkscan_util.c diff -u src/sbin/dkscan_bsdlabel/dkscan_util.c:1.2 src/sbin/dkscan_bsdlabel/dkscan_util.c:1.3 --- src/sbin/dkscan_bsdlabel/dkscan_util.c:1.2 Mon Apr 28 20:23:08 2008 +++ src/sbin/dkscan_bsdlabel/dkscan_util.c Tue Jan 1 18:44:27 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: dkscan_util.c,v 1.2 2008/04/28 20:23:08 martin Exp $ */ +/* $NetBSD: dkscan_util.c,v 1.3 2013/01/01 18:44:27 dsl Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -36,6 +36,7 @@ #include stdarg.h #include err.h #include sys/param.h +#include sys/ioctl.h #include sys/proc.h #include sys/disk.h #include sys/disklabel.h
CVS commit: src/sbin/dkscan_bsdlabel
Module Name:src Committed By: joerg Date: Sat Aug 27 16:43:07 UTC 2011 Modified Files: src/sbin/dkscan_bsdlabel: dkscan_bsdlabel.c dkscan_util.h Log Message: Mark usage as static and dead. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c \ 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.2 src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.3 --- src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c:1.2 Mon Apr 28 20:23:08 2008 +++ src/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c Sat Aug 27 16:43:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dkscan_bsdlabel.c,v 1.2 2008/04/28 20:23:08 martin Exp $ */ +/* $NetBSD: dkscan_bsdlabel.c,v 1.3 2011/08/27 16:43:07 joerg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -43,6 +43,8 @@ #include dkwedge_bsdlabel.c +__dead static void usage(void); + int main(int argc, char **argv) { Index: src/sbin/dkscan_bsdlabel/dkscan_util.h diff -u src/sbin/dkscan_bsdlabel/dkscan_util.h:1.2 src/sbin/dkscan_bsdlabel/dkscan_util.h:1.3 --- src/sbin/dkscan_bsdlabel/dkscan_util.h:1.2 Mon Apr 28 20:23:08 2008 +++ src/sbin/dkscan_bsdlabel/dkscan_util.h Sat Aug 27 16:43:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: dkscan_util.h,v 1.2 2008/04/28 20:23:08 martin Exp $ */ +/* $NetBSD: dkscan_util.h,v 1.3 2011/08/27 16:43:07 joerg Exp $ */ /*- * Copyright (c) 2007 The NetBSD Foundation, Inc. @@ -39,8 +39,6 @@ int dkwedge_add(struct dkwedge_info *dkw); void aprint_error(const char *format, ...); void aprint_verbose(const char *format, ...); -void usage(void); - extern int verbose; /* are we verbose? */ extern int no_action; /* don't do anything, just print info */