summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2009-07-08 05:56:14 +0000
committermarcel <marcel@FreeBSD.org>2009-07-08 05:56:14 +0000
commit8fa709769a72b5c4b2e95bf92bb0b53836b4881a (patch)
tree5caadd9b3e91865617319d5117cb5c08cd75adf6 /sys
parent13615958a8931e00cfc0760e1d87d16a8e52a40a (diff)
downloadFreeBSD-src-8fa709769a72b5c4b2e95bf92bb0b53836b4881a.zip
FreeBSD-src-8fa709769a72b5c4b2e95bf92bb0b53836b4881a.tar.gz
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)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/atapi-cd.c5
-rw-r--r--sys/geom/geom_dev.c12
-rw-r--r--sys/geom/part/g_part.c28
-rw-r--r--sys/geom/part/g_part_if.m9
-rw-r--r--sys/sys/disk.h6
5 files changed, 1 insertions, 59 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c
index 7fd80c4..aee8374 100644
--- a/sys/dev/ata/atapi-cd.c
+++ b/sys/dev/ata/atapi-cd.c
@@ -219,10 +219,7 @@ acd_geom_ioctl(struct g_provider *pp, u_long cmd, void *addr, int fflag, struct
case CDIOCRESET:
acd_test_ready(dev);
break;
-
- case DIOCGPROVIDERALIAS:
- break;
-
+
default:
acd_read_toc(dev);
acd_prevent_allow(dev, 1);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index b304c51..b40dea0 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -113,7 +113,6 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
{
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_provider *pp, int insist __unused)
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);
}
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 68df8c4..78c3650 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -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 char *indent, struct g_geom *gp,
}
}
-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)
{
diff --git a/sys/geom/part/g_part_if.m b/sys/geom/part/g_part_if.m
index 506e540..8252f0c 100644
--- a/sys/geom/part/g_part_if.m
+++ b/sys/geom/part/g_part_if.m
@@ -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;
diff --git a/sys/sys/disk.h b/sys/sys/disk.h
index b645cd3..4fe2e09 100644
--- a/sys/sys/disk.h
+++ b/sys/sys/disk.h
@@ -104,10 +104,4 @@ void disk_err(struct bio *bp, const char *what, int blkdone, int nl);
* 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_ */
OpenPOWER on IntegriCloud