From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 17 05:55:41 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7217106566C; Fri, 17 Jun 2011 05:55:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CC038FC0A; Fri, 17 Jun 2011 05:55:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5H5tfLu062950; Fri, 17 Jun 2011 05:55:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5H5tfRU062946; Fri, 17 Jun 2011 05:55:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201106170555.p5H5tfRU062946@svn.freebsd.org> From: Alexander Motin Date: Fri, 17 Jun 2011 05:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223172 - stable/8/sys/geom X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2011 05:55:41 -0000 Author: mav Date: Fri Jun 17 05:55:41 2011 New Revision: 223172 URL: http://svn.freebsd.org/changeset/base/223172 Log: MFC r219950: Change BIO_GETATTR("GEOM::kerneldump") API to make set_dumper() called by consumer (geom_dev) instead of provider (geom_disk). This allows any geom insert it's code into the dump call chain, implementing more sophisticated functionality then just disk partitioning. Modified: stable/8/sys/geom/geom.h stable/8/sys/geom/geom_dev.c stable/8/sys/geom/geom_disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/geom/geom.h ============================================================================== --- stable/8/sys/geom/geom.h Fri Jun 17 05:30:12 2011 (r223171) +++ stable/8/sys/geom/geom.h Fri Jun 17 05:55:41 2011 (r223172) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -304,6 +305,7 @@ extern struct sx topology_lock; struct g_kerneldump { off_t offset; off_t length; + struct dumperinfo di; }; MALLOC_DECLARE(M_GEOM); Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Fri Jun 17 05:30:12 2011 (r223171) +++ stable/8/sys/geom/geom_dev.c Fri Jun 17 05:55:41 2011 (r223172) @@ -281,8 +281,11 @@ g_dev_ioctl(struct cdev *dev, u_long cmd kd.length = OFF_MAX; i = sizeof kd; error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); - if (!error) - dev->si_flags |= SI_DUMPDEV; + if (!error) { + error = set_dumper(&kd.di); + if (!error) + dev->si_flags |= SI_DUMPDEV; + } break; case DIOCGFLUSH: error = g_io_flush(cp); Modified: stable/8/sys/geom/geom_disk.c ============================================================================== --- stable/8/sys/geom/geom_disk.c Fri Jun 17 05:30:12 2011 (r223171) +++ stable/8/sys/geom/geom_disk.c Fri Jun 17 05:55:41 2011 (r223172) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -169,10 +168,8 @@ g_disk_access(struct g_provider *pp, int static void g_disk_kerneldump(struct bio *bp, struct disk *dp) -{ - int error; +{ struct g_kerneldump *gkd; - struct dumperinfo di; struct g_geom *gp; gkd = (struct g_kerneldump*)bp->bio_data; @@ -183,16 +180,15 @@ g_disk_kerneldump(struct bio *bp, struct g_io_deliver(bp, ENODEV); return; } - di.dumper = dp->d_dump; - di.priv = dp; - di.blocksize = dp->d_sectorsize; - di.maxiosize = dp->d_maxsize; - di.mediaoffset = gkd->offset; + gkd->di.dumper = dp->d_dump; + gkd->di.priv = dp; + gkd->di.blocksize = dp->d_sectorsize; + gkd->di.maxiosize = dp->d_maxsize; + gkd->di.mediaoffset = gkd->offset; if ((gkd->offset + gkd->length) > dp->d_mediasize) gkd->length = dp->d_mediasize - gkd->offset; - di.mediasize = gkd->length; - error = set_dumper(&di); - g_io_deliver(bp, error); + gkd->di.mediasize = gkd->length; + g_io_deliver(bp, 0); } static void