Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2013 10:21:21 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
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
Message-ID:  <201310221021.r9MALLhP097274@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310221021.r9MALLhP097274>