Source-Changes-HG archive

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

[src/netbsd-9]: src/sys Pull up following revision(s) (requested by riastradh...



details:   https://anonhg.NetBSD.org/src/rev/6df52325b09c
branches:  netbsd-9
changeset: 843986:6df52325b09c
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Mar 21 15:52:09 2020 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #795):

        sys/dev/dksubr.c: revision 1.112
        sys/arch/xen/xen/xbd_xenbus.c: revision 1.95
        sys/dev/scsipi/sd.c: revision 1.328
        sys/dev/dkvar.h: revision 1.32
        sys/dev/ld.c: revision 1.109
        sys/dev/cgd.c: revision 1.120
        sys/dev/raidframe/rf_netbsdkintf.c: revision 1.380
        sys/dev/ata/wd.c: revision 1.458

Add a flag to dk_dump for virtual disk devices.

If a disk is backed by a physical medium other than itself, such as
cgd(4), then it passes DK_DUMP_RECURSIVE to disable the recursion
detection for dk_dump.

If, however, a device represents a physical medium on its own, such
as wd(4), then it passes 0 instead.

With this, I can now dump to dk on cgd on dk on wd.

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c      |   6 +++---
 sys/dev/ata/wd.c                   |   6 +++---
 sys/dev/cgd.c                      |   6 +++---
 sys/dev/dksubr.c                   |  12 +++++++-----
 sys/dev/dkvar.h                    |   6 ++++--
 sys/dev/ld.c                       |   6 +++---
 sys/dev/raidframe/rf_netbsdkintf.c |   8 ++++----
 sys/dev/scsipi/sd.c                |   6 +++---
 8 files changed, 30 insertions(+), 26 deletions(-)

diffs (245 lines):

diff -r 4266142d91d2 -r 6df52325b09c sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.92.4.1 2020/03/21 15:52:09 martin Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.92 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.92.4.1 2020/03/21 15:52:09 martin Exp $");
 
 #include "opt_xen.h"
 
@@ -930,7 +930,7 @@
 
        DPRINTF(("xbddump(%d, %" PRId64 ", %p, %lu)\n", dev, blkno, va,
            (unsigned long)size));
-       return dk_dump(&sc->sc_dksc, dev, blkno, va, size);
+       return dk_dump(&sc->sc_dksc, dev, blkno, va, size, 0);
 }
 
 static int
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/ata/wd.c  Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.452.2.1 2020/03/21 15:18:57 martin Exp $ */
+/*     $NetBSD: wd.c,v 1.452.2.2 2020/03/21 15:52:09 martin Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.452.2.1 2020/03/21 15:18:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.452.2.2 2020/03/21 15:52:09 martin Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -1570,7 +1570,7 @@
                return (ENXIO);
        dksc = &wd->sc_dksc;
 
-       return dk_dump(dksc, dev, blkno, va, size);
+       return dk_dump(dksc, dev, blkno, va, size, 0);
 }
 
 static int
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/cgd.c
--- a/sys/dev/cgd.c     Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/cgd.c     Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.116.10.1 2020/03/21 15:18:57 martin Exp $ */
+/* $NetBSD: cgd.c,v 1.116.10.2 2020/03/21 15:52:09 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.1 2020/03/21 15:18:57 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.116.10.2 2020/03/21 15:52:09 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -770,7 +770,7 @@
        DPRINTF_FOLLOW(("cgddump(0x%"PRIx64", %" PRId64 ", %p, %lu)\n",
            dev, blkno, va, (unsigned long)size));
        GETCGD_SOFTC(cs, dev);
-       return dk_dump(&cs->sc_dksc, dev, blkno, va, size);
+       return dk_dump(&cs->sc_dksc, dev, blkno, va, size, DK_DUMP_RECURSIVE);
 }
 
 /*
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/dksubr.c  Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $ */
+/* $NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109 2019/06/28 14:56:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.109.2.1 2020/03/21 15:52:09 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -761,7 +761,7 @@
 /* ARGSUSED */
 int
 dk_dump(struct dk_softc *dksc, dev_t dev,
-    daddr_t blkno, void *vav, size_t size)
+    daddr_t blkno, void *vav, size_t size, int flags)
 {
        const struct dkdriver *dkd = dksc->sc_dkdev.dk_driver;
        struct disk_geom *dg = &dksc->sc_dkdev.dk_geom;
@@ -784,7 +784,8 @@
        /* ensure that we are not already dumping */
        if (dk_dumping)
                return EFAULT;
-       dk_dumping = 1;
+       if ((flags & DK_DUMP_RECURSIVE) == 0)
+               dk_dumping = 1;
 
        if (dkd->d_dumpblocks == NULL) {
                DPRINTF(DKDB_DUMP, ("%s: no dumpblocks\n", __func__));
@@ -863,7 +864,8 @@
                va += nblk * lp->d_secsize;
        }
 
-       dk_dumping = 0;
+       if ((flags & DK_DUMP_RECURSIVE) == 0)
+               dk_dumping = 0;
 
        return 0;
 }
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/dkvar.h
--- a/sys/dev/dkvar.h   Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/dkvar.h   Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dkvar.h,v 1.30 2017/11/01 19:15:31 mlelstv Exp $ */
+/* $NetBSD: dkvar.h,v 1.30.10.1 2020/03/21 15:52:09 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -83,6 +83,8 @@
        ((_dksc)->sc_dkdev.dk_bopenmask & (_pmask)  &&  \
        ((_dksc)->sc_dkdev.dk_copenmask & (_pmask))))
 
+#define        DK_DUMP_RECURSIVE       __BIT(0) /* this is a virtual disk */
+
 /*
  * Functions that are exported to the pseudo disk implementations:
  */
@@ -106,7 +108,7 @@
 int    dk_ioctl(struct dk_softc *, dev_t,
                 u_long, void *, int, struct lwp *);
 int    dk_dump(struct dk_softc *, dev_t,
-               daddr_t, void *, size_t);
+               daddr_t, void *, size_t, int);
 void   dk_getdisklabel(struct dk_softc *, dev_t);
 void   dk_getdefaultlabel(struct dk_softc *, struct disklabel *);
 
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/ld.c
--- a/sys/dev/ld.c      Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/ld.c      Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.106.4.1 2020/02/11 08:37:34 martin Exp $      */
+/*     $NetBSD: ld.c,v 1.106.4.2 2020/03/21 15:52:09 martin Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.106.4.1 2020/02/11 08:37:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.106.4.2 2020/03/21 15:52:09 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -507,7 +507,7 @@
        if ((sc->sc_flags & LDF_ENABLED) == 0)
                return (ENODEV);
 
-       return dk_dump(dksc, dev, blkno, va, size);
+       return dk_dump(dksc, dev, blkno, va, size, 0);
 }
 
 static int
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.376 2019/03/01 11:06:56 pgoyette Exp $    */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.376.4.1 2020/03/21 15:52:09 martin Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: Utah $Hdr: cd.c 1.6 90/11/28$
+ * from: Utah $Hdr$
  *
  *      @(#)cd.c        8.2 (Berkeley) 11/16/93
  */
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.376 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.376.4.1 2020/03/21 15:52:09 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -663,7 +663,7 @@
         */
        blkno += RF_PROTECTED_SECTORS;
 
-       return dk_dump(dksc, dev, blkno, va, size);
+       return dk_dump(dksc, dev, blkno, va, size, DK_DUMP_RECURSIVE);
 }
 
 static int
diff -r 4266142d91d2 -r 6df52325b09c sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Sat Mar 21 15:47:00 2020 +0000
+++ b/sys/dev/scsipi/sd.c       Sat Mar 21 15:52:09 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.327 2019/03/19 06:59:40 mlelstv Exp $ */
+/*     $NetBSD: sd.c,v 1.327.4.1 2020/03/21 15:52:09 martin Exp $      */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.327 2019/03/19 06:59:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.327.4.1 2020/03/21 15:52:09 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -1192,7 +1192,7 @@
        if ((periph->periph_flags & PERIPH_MEDIA_LOADED) == 0)
                return (ENXIO);
 
-       return dk_dump(dksc, dev, blkno, va, size);
+       return dk_dump(dksc, dev, blkno, va, size, 0);
 }
 
 static int



Home | Main Index | Thread Index | Old Index