From owner-svn-src-all@FreeBSD.ORG Tue Oct 22 10:21:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CBBE049A; Tue, 22 Oct 2013 10:21:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B92762EAD; Tue, 22 Oct 2013 10:21:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MALLBG097277; Tue, 22 Oct 2013 10:21:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MALLhP097274; Tue, 22 Oct 2013 10:21:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201310221021.r9MALLhP097274@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Oct 2013 10:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r256884 - in head: share/man/man9 sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 10:21:22 -0000 Author: mav Date: Tue Oct 22 10:21:20 2013 New Revision: 256884 URL: http://svnweb.freebsd.org/changeset/base/256884 Log: Remove Giant-locked drivers support (DISKFLAG_NEEDSGIANT flag) from disk(9). Since at least FreeBSD 7 we had only four of them in the base tree, and in head branch, thanks to jhb@, we have no any for more then a year. Modified: head/share/man/man9/disk.9 head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/share/man/man9/disk.9 ============================================================================== --- head/share/man/man9/disk.9 Tue Oct 22 10:10:34 2013 (r256883) +++ head/share/man/man9/disk.9 Tue Oct 22 10:21:20 2013 (r256884) @@ -106,8 +106,6 @@ and may not be subsequently changed: Optional flags indicating to the storage framework what optional features or descriptions the storage device driver supports. Currently supported flags are -.Dv DISKFLAG_NEEDSGIANT -(maintained by device driver), .Dv DISKFLAG_OPEN (maintained by storage framework), .Dv DISKFLAG_CANDELETE Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Oct 22 10:10:34 2013 (r256883) +++ head/sys/geom/geom_disk.c Tue Oct 22 10:21:20 2013 (r256884) @@ -91,22 +91,6 @@ static SYSCTL_NODE(_kern_geom, OID_AUTO, DECLARE_GEOM_CLASS(g_disk_class, g_disk); -static void __inline -g_disk_lock_giant(struct disk *dp) -{ - - if (dp->d_flags & DISKFLAG_NEEDSGIANT) - mtx_lock(&Giant); -} - -static void __inline -g_disk_unlock_giant(struct disk *dp) -{ - - if (dp->d_flags & DISKFLAG_NEEDSGIANT) - mtx_unlock(&Giant); -} - static int g_disk_access(struct g_provider *pp, int r, int w, int e) { @@ -133,12 +117,10 @@ g_disk_access(struct g_provider *pp, int error = 0; if ((pp->acr + pp->acw + pp->ace) == 0 && (r + w + e) > 0) { if (dp->d_open != NULL) { - g_disk_lock_giant(dp); error = dp->d_open(dp); if (bootverbose && error != 0) printf("Opened disk %s -> %d\n", pp->name, error); - g_disk_unlock_giant(dp); if (error != 0) return (error); } @@ -161,12 +143,10 @@ g_disk_access(struct g_provider *pp, int dp->d_flags |= DISKFLAG_OPEN; } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { - g_disk_lock_giant(dp); error = dp->d_close(dp); if (error != 0) printf("Closed disk %s -> %d\n", pp->name, error); - g_disk_unlock_giant(dp); } sc->state = G_STATE_ACTIVE; if (sc->led[0] != 0) @@ -287,9 +267,7 @@ g_disk_ioctl(struct g_provider *pp, u_lo if (dp->d_ioctl == NULL) return (ENOIOCTL); - g_disk_lock_giant(dp); error = dp->d_ioctl(dp, cmd, data, fflag, td); - g_disk_unlock_giant(dp); return (error); } @@ -328,9 +306,7 @@ g_disk_start(struct bio *bp) mtx_lock(&sc->start_mtx); devstat_start_transaction_bio(dp->d_devstat, bp); mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); dp->d_strategy(bp); - g_disk_unlock_giant(dp); break; } off = 0; @@ -384,9 +360,7 @@ g_disk_start(struct bio *bp) mtx_lock(&sc->start_mtx); devstat_start_transaction_bio(dp->d_devstat, bp2); mtx_unlock(&sc->start_mtx); - g_disk_lock_giant(dp); dp->d_strategy(bp2); - g_disk_unlock_giant(dp); bp2 = bp3; bp3 = NULL; } while (bp2 != NULL); @@ -442,9 +416,7 @@ g_disk_start(struct bio *bp) bp->bio_disk = dp; bp->bio_to = (void *)bp->bio_done; bp->bio_done = g_disk_done_single; - g_disk_lock_giant(dp); dp->d_strategy(bp); - g_disk_unlock_giant(dp); break; default: error = EOPNOTSUPP; Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Tue Oct 22 10:10:34 2013 (r256883) +++ head/sys/geom/geom_disk.h Tue Oct 22 10:21:20 2013 (r256884) @@ -102,7 +102,6 @@ struct disk { void *d_drv1; }; -#define DISKFLAG_NEEDSGIANT 0x1 #define DISKFLAG_OPEN 0x2 #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8