From owner-svn-src-stable@FreeBSD.ORG Wed Jan 5 12:47:42 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D53A91065672; Wed, 5 Jan 2011 12:47:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A99548FC17; Wed, 5 Jan 2011 12:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05Clgv1078556; Wed, 5 Jan 2011 12:47:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05ClgZO078553; Wed, 5 Jan 2011 12:47:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101051247.p05ClgZO078553@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 5 Jan 2011 12:47:42 +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: r217003 - in stable/8/sys: dev/md geom X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 12:47:42 -0000 Author: kib Date: Wed Jan 5 12:47:42 2011 New Revision: 217003 URL: http://svn.freebsd.org/changeset/base/217003 Log: MFC r216794: Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4). Non-zero value of attribute means that device supports BIO_DELETE. Modified: stable/8/sys/dev/md/md.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/dev/md/md.c ============================================================================== --- stable/8/sys/dev/md/md.c Wed Jan 5 12:45:11 2011 (r217002) +++ stable/8/sys/dev/md/md.c Wed Jan 5 12:47:42 2011 (r217003) @@ -716,11 +716,12 @@ md_kthread(void *arg) } mtx_unlock(&sc->queue_mtx); if (bp->bio_cmd == BIO_GETATTR) { - if (sc->fwsectors && sc->fwheads && + if ((sc->fwsectors && sc->fwheads && (g_handleattr_int(bp, "GEOM::fwsectors", sc->fwsectors) || g_handleattr_int(bp, "GEOM::fwheads", - sc->fwheads))) + sc->fwheads))) || + g_handleattr_int(bp, "GEOM::candelete", 1)) error = -1; else error = EOPNOTSUPP; Modified: stable/8/sys/geom/geom_disk.c ============================================================================== --- stable/8/sys/geom/geom_disk.c Wed Jan 5 12:45:11 2011 (r217002) +++ stable/8/sys/geom/geom_disk.c Wed Jan 5 12:47:42 2011 (r217003) @@ -297,7 +297,11 @@ g_disk_start(struct bio *bp) } while (bp2 != NULL); break; case BIO_GETATTR: - if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors)) + if (g_handleattr_int(bp, "GEOM::candelete", + (dp->d_flags & DISKFLAG_CANDELETE) != 0)) + break; + else if (g_handleattr_int(bp, "GEOM::fwsectors", + dp->d_fwsectors)) break; else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads)) break;