svn commit: r195436 - in head/sys: dev/ata geom geom/part sys

Marcel Moolenaar marcel at FreeBSD.org
Wed Jul 8 05:56:15 UTC 2009


Author: marcel
Date: Wed Jul  8 05:56:14 2009
New Revision: 195436
URL: http://svn.freebsd.org/changeset/base/195436

Log:
  Revert revisions 188839 and 188868. Use of the ioctl in geom_dev.c
  is invalid because the ioctl happens without prior open. The ioctl
  got introduced to provide backward compatibility for extended
  partitions, but it ended up not being used because it didn't work
  as expected. Since there are no consumers of the ioctl and the
  implementation is broken, the best fix is to remove the code
  entirely.
  
  Spotted by:	phk
  Approved by:	re (kensmith)

Modified:
  head/sys/dev/ata/atapi-cd.c
  head/sys/geom/geom_dev.c
  head/sys/geom/part/g_part.c
  head/sys/geom/part/g_part_if.m
  head/sys/sys/disk.h

Modified: head/sys/dev/ata/atapi-cd.c
==============================================================================
--- head/sys/dev/ata/atapi-cd.c	Wed Jul  8 02:31:35 2009	(r195435)
+++ head/sys/dev/ata/atapi-cd.c	Wed Jul  8 05:56:14 2009	(r195436)
@@ -219,10 +219,7 @@ acd_geom_ioctl(struct g_provider *pp, u_
 	case CDIOCRESET:
 	    acd_test_ready(dev);
 	    break;
-
-	case DIOCGPROVIDERALIAS:
-	    break;
-
+	   
 	default:
 	    acd_read_toc(dev);
 	    acd_prevent_allow(dev, 1);

Modified: head/sys/geom/geom_dev.c
==============================================================================
--- head/sys/geom/geom_dev.c	Wed Jul  8 02:31:35 2009	(r195435)
+++ head/sys/geom/geom_dev.c	Wed Jul  8 05:56:14 2009	(r195436)
@@ -113,7 +113,6 @@ g_dev_taste(struct g_class *mp, struct g
 {
 	struct g_geom *gp;
 	struct g_consumer *cp;
-	char *alias;
 	int error;
 	struct cdev *dev;
 
@@ -135,17 +134,6 @@ g_dev_taste(struct g_class *mp, struct g
 	gp->softc = dev;
 	dev->si_drv1 = gp;
 	dev->si_drv2 = cp;
-
-	g_topology_unlock();
-
-	alias = g_malloc(MAXPATHLEN, M_WAITOK | M_ZERO);
-	error = (pp->geom->ioctl == NULL) ? ENODEV :
-	    pp->geom->ioctl(pp, DIOCGPROVIDERALIAS, alias, 0, curthread);
-	if (!error && alias[0] != '\0')
-		make_dev_alias(dev, "%s", alias);
-	g_free(alias);
-
-	g_topology_lock();
 	return (gp);
 }
 

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Wed Jul  8 02:31:35 2009	(r195435)
+++ head/sys/geom/part/g_part.c	Wed Jul  8 05:56:14 2009	(r195436)
@@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$");
 
 #include <sys/param.h>
 #include <sys/bio.h>
-#include <sys/disk.h>
 #include <sys/diskmbr.h>
 #include <sys/endian.h>
 #include <sys/kernel.h>
@@ -92,7 +91,6 @@ static g_taste_t g_part_taste;
 
 static g_access_t g_part_access;
 static g_dumpconf_t g_part_dumpconf;
-static g_ioctl_t g_part_ioctl;
 static g_orphan_t g_part_orphan;
 static g_spoiled_t g_part_spoiled;
 static g_start_t g_part_start;
@@ -109,7 +107,6 @@ static struct g_class g_part_class = {
 	/* Geom methods. */
 	.access = g_part_access,
 	.dumpconf = g_part_dumpconf,
-	.ioctl = g_part_ioctl,
 	.orphan = g_part_orphan,
 	.spoiled = g_part_spoiled,
 	.start = g_part_start,
@@ -1611,31 +1608,6 @@ g_part_dumpconf(struct sbuf *sb, const c
 	}
 }
 
-static int
-g_part_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag,
-    struct thread *td)
-{
-	struct g_geom *gp;
-	struct g_part_table *table;
-	struct g_part_entry *entry;
-	int error;
-
-	gp = pp->geom;
-	table = gp->softc;
-	entry = pp->private;
-
-	switch (cmd) {
-	case DIOCGPROVIDERALIAS:
-		error = G_PART_DEVALIAS(table, entry, data, MAXPATHLEN);
-		break;
-	default:
-		error = ENOTTY;
-		break;
-	}
-
-	return (error);
-}
-
 static void
 g_part_orphan(struct g_consumer *cp)
 {

Modified: head/sys/geom/part/g_part_if.m
==============================================================================
--- head/sys/geom/part/g_part_if.m	Wed Jul  8 02:31:35 2009	(r195435)
+++ head/sys/geom/part/g_part_if.m	Wed Jul  8 05:56:14 2009	(r195436)
@@ -85,15 +85,6 @@ METHOD int destroy {
 	struct g_part_parms *gpp;
 };
 
-# devalias() - return the name (if any) to be used as an alias for
-# the device special file created for the partition entry.
-METHOD int devalias {
-	struct g_part_table *table;
-	struct g_part_entry *entry;
-	char *buf;
-	size_t bufsz;
-};
-
 # dumpconf()
 METHOD void dumpconf {
 	struct g_part_table *table;

Modified: head/sys/sys/disk.h
==============================================================================
--- head/sys/sys/disk.h	Wed Jul  8 02:31:35 2009	(r195435)
+++ head/sys/sys/disk.h	Wed Jul  8 05:56:14 2009	(r195436)
@@ -104,10 +104,4 @@ void disk_err(struct bio *bp, const char
 	 * must be at least MAXPATHLEN bytes long.
 	 */
 
-#define	DIOCGPROVIDERALIAS _IOR('d', 139, char[MAXPATHLEN])
-	/*-
-	 * Store the provider alias, if present, in a buffer. The buffer must
-	 * be at least MAXPATHLEN bytes long.
-	 */
-
 #endif /* _SYS_DISK_H_ */


More information about the svn-src-head mailing list