Source-Changes-HG archive

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

[src/trunk]: src/sbin/dkscan_bsdlabel adjust to work with updated dkwedge_bsd...



details:   https://anonhg.NetBSD.org/src/rev/ed573c5e85e4
branches:  trunk
changeset: 1009066:ed573c5e85e4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Apr 11 17:21:16 2020 +0000

description:
adjust to work with updated dkwedge_bsdlabel.c - provide geteblk() and
brelse() which just allocate/free the memory

diffstat:

 sbin/dkscan_bsdlabel/dkscan_bsdlabel.c |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 4a0a0468ccce -r ed573c5e85e4 sbin/dkscan_bsdlabel/dkscan_bsdlabel.c
--- a/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c    Sat Apr 11 16:55:33 2020 +0000
+++ b/sbin/dkscan_bsdlabel/dkscan_bsdlabel.c    Sat Apr 11 17:21:16 2020 +0000
@@ -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 <err.h>
 #include <util.h>
 #include <sys/disk.h>
+#include <sys/buf.h>
 
 #include "dkscan_util.h"
 
@@ -46,6 +47,22 @@
        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 *)&bp[1];
+
+       return bp;
+}
+
+static void
+brelse(struct buf *bp, int set)
+{
+       free(bp);
+}
+
 #include "dkwedge_bsdlabel.c"
 
 __dead static void usage(void);



Home | Main Index | Thread Index | Old Index